|
1 |
| -# wp-languages.github.io |
2 |
| -[](https://travis-ci.org/wp-languages/wp-languages.github.io) [](http://doge.mit-license.org) |
3 |
| - |
4 |
| -## Features |
5 |
| -- Supports **https** by using github.io ssl. Composer default configuration only accepts **https** by default starting from 2016. |
6 |
| -- Automatically creates composer packages for WordPress translations from api.wordpress.org. |
7 |
| -- This repo provides custom satis repository for WordPress languages. See more in [wp-languages.github.io](https://wp-languages.github.io/). |
8 |
| -- If you would like to add more language files please submit a pull request. |
9 |
| -- Repos are updated daily with Travis CI. |
10 |
| - |
11 |
| -## Example configuration with composer |
12 |
| - |
13 |
| -This example adds all translations from finnish and french packages. |
14 |
| -```json |
15 |
| -{ |
16 |
| - "repositories": [ |
17 |
| - { |
18 |
| - "type": "composer", |
19 |
| - "url": "https://wp-languages.github.io" |
20 |
| - } |
21 |
| - ], |
22 |
| - "require": { |
23 |
| - "koodimonni-language/fi": "*", |
24 |
| - "koodimonni-language/fr_FR": "*" |
25 |
| - }, |
26 |
| - "extra": { |
27 |
| - "dropin-paths": { |
28 |
| - "htdocs/wp-content/languages/": ["vendor:koodimonni-language"], |
29 |
| - "htdocs/wp-content/languages/plugins/": ["vendor:koodimonni-plugin-language"], |
30 |
| - "htdocs/wp-content/languages/themes/": ["vendor:koodimonni-theme-language"] |
31 |
| - } |
32 |
| - } |
33 |
| -} |
34 |
| -``` |
35 |
| - |
36 |
| -## Request packages |
37 |
| -If package what you're looking for can't be found look first the response from api: |
38 |
| - |
39 |
| -[https://api.wordpress.org/translations/core/1.0/](https://api.wordpress.org/translations/core/1.0/) |
40 |
| - |
41 |
| -If your language is not listed in the response we can't help you. You'll need to ask from wp-core translators instead. |
42 |
| - |
43 |
| -This is pretty static repository and we can't add all possible plugins here. |
44 |
| - |
45 |
| -## Manually adding any language zip to your composer.json |
46 |
| -There's also manual method of including any translation in wordpress.org. This is useful because we can't include all plugins in this repository. Let's look how to add french (fr_FR) jetpack translations. First search the api for jetpack translations: |
47 |
| - |
48 |
| -```bash |
49 |
| -$ curl -s 'https://api.wordpress.org/translations/plugins/1.0/?slug=jetpack' | python -m json.tool |
50 |
| -``` |
51 |
| - |
52 |
| -Choose your language zip from json output for example for us it was: |
53 |
| -https://downloads.wordpress.org/translation/plugin/jetpack/3.9.2/fr_FR.zip |
54 |
| - |
55 |
| -Then add it to your composer like this example. You just need to update the version number everytime the package updates. |
56 |
| -```json |
57 |
| -{ |
58 |
| - "repositories": [ |
59 |
| - { |
60 |
| - "type": "package", |
61 |
| - "package": { |
62 |
| - "name": "koodimonni-plugin-language/jetpack-fr_FR", |
63 |
| - "type": "wordpress-language", |
64 |
| - "version": "3.9.2", |
65 |
| - "dist": { |
66 |
| - "type": "zip", |
67 |
| - "url": "https://downloads.wordpress.org/translation/plugin/jetpack/3.9.2/fr_FR.zip", |
68 |
| - "reference": "master" |
69 |
| - } |
70 |
| - } |
71 |
| - } |
72 |
| - ], |
73 |
| - "require": { |
74 |
| - "koodimonni/composer-dropin-installer": "*", |
75 |
| - "koodimonni-plugin-language/jetpack-fr_FR": ">=3.9.2" |
76 |
| - }, |
77 |
| - "extra": { |
78 |
| - "dropin-paths": { |
79 |
| - "htdocs/wp-content/languages/": ["vendor:koodimonni-language"], |
80 |
| - "htdocs/wp-content/languages/plugins/": ["vendor:koodimonni-plugin-language"], |
81 |
| - "htdocs/wp-content/languages/themes/": ["vendor:koodimonni-theme-language"] |
82 |
| - } |
83 |
| - } |
84 |
| -} |
85 |
| -``` |
86 |
| - |
87 |
| -## How to use this project as self-hosted version: |
88 |
| - |
89 |
| -``` |
90 |
| -# Clone the project to your own server |
91 |
| -$ git clone https://github.com/wp-languages/wp-languages.github.io /to/your/htdocs |
92 |
| -$ cd /to/your/htdocs |
93 |
| -$ composer install |
94 |
| -
|
95 |
| -# Set new cronjob |
96 |
| -$ crontab -e |
97 |
| -# Add following line to your cron |
98 |
| -*/30 * * * * cd /to/your/htdocs && php bin/wp-org-api && php bin/satis satis.json . |
99 |
| -``` |
100 |
| - |
101 |
| -## License |
102 |
| -MIT License |
| 1 | +# wp-languages.github.io |
| 2 | +[](http://doge.mit-license.org) |
| 3 | + |
| 4 | +## Features |
| 5 | +- Supports **https** by using github.io ssl. Composer default configuration only accepts **https** by default starting from 2016. |
| 6 | +- Automatically creates composer packages for WordPress translations from api.wordpress.org. |
| 7 | +- This repo provides custom satis repository for WordPress languages. See more in [wp-languages.github.io](https://wp-languages.github.io/). |
| 8 | +- To add more language files please submit a pull request to the `src` branch. |
| 9 | +- Repos are updated hourly with GitHub Actions. |
| 10 | + |
| 11 | +## Example configuration with composer |
| 12 | + |
| 13 | +This example adds all translations from finnish and french packages. |
| 14 | +```json |
| 15 | +{ |
| 16 | + "repositories": [ |
| 17 | + { |
| 18 | + "type": "composer", |
| 19 | + "url": "https://wp-languages.github.io", |
| 20 | + "only": [ |
| 21 | + "koodimonni-language/*", |
| 22 | + "koodimonni-plugin-language/*", |
| 23 | + "koodimonni-theme-language/*" |
| 24 | + ] |
| 25 | + } |
| 26 | + ], |
| 27 | + "require": { |
| 28 | + "koodimonni-language/fi": "*", |
| 29 | + "koodimonni-language/fr_fr": "*" |
| 30 | + }, |
| 31 | + "extra": { |
| 32 | + "dropin-paths": { |
| 33 | + "htdocs/wp-content/languages/": [ |
| 34 | + "vendor:koodimonni-language" |
| 35 | + ], |
| 36 | + "htdocs/wp-content/languages/plugins/": [ |
| 37 | + "vendor:koodimonni-plugin-language" |
| 38 | + ], |
| 39 | + "htdocs/wp-content/languages/themes/": [ |
| 40 | + "vendor:koodimonni-theme-language" |
| 41 | + ] |
| 42 | + } |
| 43 | + } |
| 44 | +} |
| 45 | +``` |
| 46 | + |
| 47 | +## Request packages |
| 48 | +If package what you're looking for can't be found look first the response from api: |
| 49 | + |
| 50 | +[https://api.wordpress.org/translations/core/1.0/](https://api.wordpress.org/translations/core/1.0/) |
| 51 | + |
| 52 | +If your language is not listed in the response we can't help you. You'll need to ask from wp-core translators instead. |
| 53 | + |
| 54 | +This is pretty static repository, and we can't add all possible plugins here. |
| 55 | + |
| 56 | +## Manually adding any language zip to your composer.json |
| 57 | +There's also manual method of including any translation in WordPress.org. This is useful because we can't include all plugins in this repository. Let's look how to add french (fr_FR) jetpack translations. First search the api for jetpack translations: |
| 58 | + |
| 59 | +```bash |
| 60 | +$ curl -s 'https://api.wordpress.org/translations/plugins/1.0/?slug=jetpack' | python -m json.tool |
| 61 | +``` |
| 62 | + |
| 63 | +Choose your language zip from json output for example for us it was: |
| 64 | +https://downloads.wordpress.org/translation/plugin/jetpack/3.9.2/fr_FR.zip |
| 65 | + |
| 66 | +Then add it to your composer like this example. You just need to update the version number everytime the package updates. |
| 67 | +```json |
| 68 | +{ |
| 69 | + "repositories": [ |
| 70 | + { |
| 71 | + "type": "package", |
| 72 | + "package": { |
| 73 | + "name": "koodimonni-plugin-language/jetpack-fr_fr", |
| 74 | + "type": "wordpress-language", |
| 75 | + "version": "3.9.2", |
| 76 | + "dist": { |
| 77 | + "type": "zip", |
| 78 | + "url": "https://downloads.wordpress.org/translation/plugin/jetpack/3.9.2/fr_FR.zip", |
| 79 | + "reference": "master" |
| 80 | + } |
| 81 | + } |
| 82 | + } |
| 83 | + ], |
| 84 | + "require": { |
| 85 | + "koodimonni/composer-dropin-installer": "*", |
| 86 | + "koodimonni-plugin-language/jetpack-fr_fr": ">=3.9.2" |
| 87 | + }, |
| 88 | + "extra": { |
| 89 | + "dropin-paths": { |
| 90 | + "htdocs/wp-content/languages/": [ |
| 91 | + "vendor:koodimonni-language" |
| 92 | + ], |
| 93 | + "htdocs/wp-content/languages/plugins/": [ |
| 94 | + "vendor:koodimonni-plugin-language" |
| 95 | + ], |
| 96 | + "htdocs/wp-content/languages/themes/": [ |
| 97 | + "vendor:koodimonni-theme-language" |
| 98 | + ] |
| 99 | + } |
| 100 | + } |
| 101 | +} |
| 102 | +``` |
| 103 | + |
| 104 | +## How to use this project as self-hosted version: |
| 105 | + |
| 106 | +```bash |
| 107 | +# Clone the project to your own server |
| 108 | +git clone https://github.com/wp-languages/wp-languages.github.io /to/your/htdocs |
| 109 | +cd /to/your/htdocs |
| 110 | +composer install |
| 111 | + |
| 112 | +# Set new cronjob |
| 113 | +crontab -e |
| 114 | + |
| 115 | +# Add following line to your cron |
| 116 | +0 */2 * * * cd /to/your/htdocs && composer run-script cache-build |
| 117 | +``` |
| 118 | + |
| 119 | +And serve the generated `docs` folder. |
| 120 | + |
| 121 | +## License |
| 122 | +MIT License |
0 commit comments