Skip to content

Commit 6b7da21

Browse files
erralstevepiercy
authored andcommitted
more doc
1 parent adfb3eb commit 6b7da21

File tree

3 files changed

+122
-0
lines changed

3 files changed

+122
-0
lines changed

docs/i18n-l10n/contributing-translations.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,38 @@ How to contribute to the Plone translations.
1717

1818
## Introduction
1919

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 or create a new branch and work in that branch.
25+
26+
## Translate Plone
27+
28+
The process of translating Plone UI is the following:
29+
30+
1. Go to https://github.com/collective/plone.app.locales and clone it into your computer
31+
32+
2. Create a new branch to work on your translations. Name the branch with something identifiable. For example: {language}-{date} (ex. fr-20220731)
33+
34+
3. Translate the `po` files under your language of choice at plone/app/locales/locales/{language_code}/LC_MESSAGES/*.po. In Classic UI we have several language files because some of the original messages are spread over several language domains and products.
35+
36+
4. Commit your changes and add a Pull Request with them. Try to have a review from a colleague, specially in case you are translating a file with already some translations. This is just to have coherent translations all over Plone.
37+
38+
39+
## Translate Volto
40+
41+
The process of translating Volto UI is the following:
42+
43+
1. Go to https://github.com/plone/volto 3 and clone it into your computer
44+
2. Create a new branch to prepare the translations. Name the branch with something identifiable. For example: {language}-{date} (ex. fr-20220731)
45+
46+
3.a Translate your language `po` file found at locales/{language_code}/LC_MESSAGES/volto.po
47+
48+
3.b Alternatively, if your language file doesn't exist, create a new folder at locales/{language_code}/LC_MESSAGES/, copy over the volto.pot file there as volto.po and start translating.
49+
50+
4. Commit your changes and add a Pull-Request.
51+
52+
## Support
53+
54+
Please ask questions on the Plone Community Forum category [Translations and i18n/l10n](https://community.plone.org/c/development/i18nl10n/42).

docs/i18n-l10n/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,5 +146,6 @@ translating-text-strings
146146
language-negotiation
147147
translating-content
148148
contributing-translations
149+
resync-translations
149150
```
150151

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
---
2+
html_meta:
3+
"description": "How to create po files from source code."
4+
"property=og:description": "How to create po files from source code."
5+
"property=og:title": "Resync translations"
6+
"keywords": "Plone, Internationalization, i18n, language, translate, content, localization"
7+
---
8+
9+
(resync-translations-label)=
10+
11+
## Resync translations
12+
13+
Plone po files need to be updated each time a new string is added into Plone interface, or each time one of those strings is updated.
14+
15+
Usually Translations team handles the update of those po files so you don't need to worry about it. Here we will explain the procedure to update such files.
16+
17+
1. Clone the relevant branch of [buildout.coredev](https://github.com/plone/buildout.coredev) corresponding to the Plone version you want to update.
18+
19+
2. Initialize the buildout.
20+
21+
```bash
22+
./bootstraph.sh
23+
```
24+
25+
3. Run buildout using the `experimental/i18n.cfg` file:
26+
27+
```bash
28+
./bin/buildout -c experimental/i18n.cfg
29+
```
30+
31+
4. Run the `i18n-update-all` script:
32+
33+
```bash
34+
./bin/i18n-update-all
35+
```
36+
37+
The script will go through Plone source code and will update all `pot` and `po` files in the plone.app.locales package.
38+
39+
5. Commit the changes and push back to GitHub:
40+
41+
```bash
42+
cd src/plone.app.locales
43+
git add plone
44+
git commit -m "Update translation files"
45+
git push origin
46+
```
47+
48+
## Create a new plone.app.locales release
49+
50+
Translators will take care of translating `po` files into their languages. When the release manager requests to create a new plone.app.locales release, the procedure is the following:
51+
52+
1. Create a virtualenv with zest.releaser and zest.pocompile installed:
53+
54+
```bash
55+
`which python3.8` -m venv .
56+
./bin/pip install zest.releaser zest.pocompile
57+
source bin/activate
58+
```
59+
60+
2. Go to plone.app.locales directory and pull the changes:
61+
62+
```bash
63+
cd src/plone.app.locales
64+
git pull
65+
```
66+
67+
3. Verify there is a changelog entry for each change, add any missing entries if necessary.
68+
69+
70+
4. Verify there is no errors in the po files:
71+
72+
```bash
73+
for po in `find . -name "*.po"` ; do msgfmt --no-hash -o `dirname $po`/`basename $po .po`.mo $po; done
74+
```
75+
76+
You can ignore the errors "'msgid' and 'msgstr' entries do not both end with '\n'". If there are other errors, please fix them.
77+
78+
5. Release:
79+
80+
```bash
81+
fullrelease
82+
```
83+
84+
6. Check that the release is published on pypi: https://pypi.org/project/plone.app.locales/
85+
86+
7. Inform the release manager about the new version

0 commit comments

Comments
 (0)