|
| 1 | +--- |
| 2 | +html_meta: |
| 3 | + "description": "How to contribute to the Plone translations." |
| 4 | + "property=og:description": "How to contribute to the Plone translations." |
| 5 | + "property=og:title": "Contributing Plone Core Translations" |
| 6 | + "keywords": "Plone, Internationalization, i18n, language, translation, localization" |
| 7 | +--- |
| 8 | + |
| 9 | +(contributing-plone-core-translations-label)= |
| 10 | + |
| 11 | +# Contributing Plone Core Translations |
| 12 | + |
| 13 | +```{admonition} Description |
| 14 | +How to contribute to the Plone translations. |
| 15 | +``` |
| 16 | + |
| 17 | + |
| 18 | +## Introduction |
| 19 | + |
| 20 | +Request write access to https://github.com/collective/plone.app.locales to be able to commit your translation directly. |
| 21 | + |
| 22 | +To do so, [join the collective GitHub organization](https://collective.github.io/). |
| 23 | + |
| 24 | +You can fork the repository and work from there. |
| 25 | + |
| 26 | + |
| 27 | +## Updating Translations |
| 28 | + |
| 29 | +If you want to test your latest translation with unreleased packages containing i18n fixes, get the buildout as follows, updating it for your versions: |
| 30 | + |
| 31 | +```shell |
| 32 | +cd ~/buildouts # or wherever you want to put things |
| 33 | +git clone -b 6.0 https://github.com/plone/buildout.coredev ./plone6devel |
| 34 | +virtualenv --no-site-packages plone6devpy |
| 35 | +cd plone6devel |
| 36 | +../plone6devpy/bin/pip install -r requirements.txt |
| 37 | +../plone6devpy/bin/buildout bootstrap |
| 38 | +bin/buildout -c experimental/i18n.cfg |
| 39 | +bin/instance fg |
| 40 | +``` |
| 41 | + |
| 42 | +To update the buildout later, use the following commands: |
| 43 | + |
| 44 | +```shell |
| 45 | +git pull |
| 46 | +bin/develop up -f |
| 47 | +``` |
| 48 | + |
| 49 | +To update your translation, change your working directory to `locales`: |
| 50 | + |
| 51 | +```shell |
| 52 | +cd src/plone.app.locales/plone/app/locales/ |
| 53 | +``` |
| 54 | + |
| 55 | +Here you have the following directories: |
| 56 | + |
| 57 | +- `locales` used for core Plone translations. |
| 58 | +- `locales-addons` used for some add-ons packages. |
| 59 | + |
| 60 | +Open the `.po` file with [poedit](https://poedit.net/), [Virtaal](http://virtaal.translatehouse.org/), or [any other i18n tool](https://docs.translatehouse.org/projects/localization-guide/en/latest/guide/tools/trans_editors.html). |
| 61 | + |
| 62 | +For example for French: |
| 63 | + |
| 64 | +```shell |
| 65 | +poedit locales/fr/LC_MESSAGES/plone.po |
| 66 | +``` |
| 67 | + |
| 68 | +Please do a `git pull` before editing a `.po` file to be sure you have the latest version. |
| 69 | + |
| 70 | + |
| 71 | +### Committing Directly |
| 72 | + |
| 73 | +You can commit your translation from the `locales` directory: |
| 74 | + |
| 75 | +```shell |
| 76 | +git commit -a -m "Updated French translation" |
| 77 | +git push |
| 78 | +``` |
| 79 | + |
| 80 | + |
| 81 | +### Creating a Pull Request |
| 82 | + |
| 83 | +If you do not have commit access on GitHub [collective group](https://github.com/collective), you can do the following: |
| 84 | + |
| 85 | +- Login to GitHub. |
| 86 | +- Go to GitHub [plone.app.locales](https://github.com/collective/plone.app.locales). |
| 87 | +- Press {guilabel}`Fork`. |
| 88 | + GitHub creates a copy of `plone.app.locales` package for you. |
| 89 | +- Then on your computer in `plone.app.locales`, do a special git push to your own repository: |
| 90 | + |
| 91 | + ```shell |
| 92 | + git push [email protected]:YOURUSERNAMEHERE/plone.app.locales.git |
| 93 | + ``` |
| 94 | + |
| 95 | +- Go to GitHub `https://github.com/YOURUSERNAME/plone.app.locales`. |
| 96 | +- Press {guilabel}`Create Pull request`. |
| 97 | + Fill it in. |
| 98 | + |
| 99 | +The request will appear for `plone.app.locales` authors. |
| 100 | + |
| 101 | +If it does not get merged in a timely manner, ask on the Plone Community Forum category [Translations and i18n/l10n](https://community.plone.org/c/development/i18nl10n). |
| 102 | + |
| 103 | + |
| 104 | +## Resyncing translations |
| 105 | + |
| 106 | +When an i18n fix is done in the code, you need to regenerate the `.pot` file and resync the `.po` files from this `.pot` file. |
| 107 | + |
| 108 | +There is a `bin/i18n` command to resync the `.po` files for the different i18n domains. |
| 109 | +[See its `README.txt` file for how to use it](https://github.com/collective/plone.app.locales/blob/master/utils/README.txt). |
| 110 | + |
| 111 | +To release a new `plone.app.locales` version, [read `RELEASING.rst`](https://github.com/collective/plone.app.locales/blob/master/utils/RELEASING.rst). |
| 112 | + |
| 113 | + |
| 114 | +## Support |
| 115 | + |
| 116 | +Please ask questions on the Plone Community Forum category [Translations and i18n/l10n](https://community.plone.org/c/development/i18nl10n). |
0 commit comments