Skip to content

Commit 4d44002

Browse files
committed
Clean up formatting of resync-translations.md
1 parent 626db51 commit 4d44002

File tree

1 file changed

+70
-56
lines changed

1 file changed

+70
-56
lines changed

docs/i18n-l10n/resync-translations.md

Lines changed: 70 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -8,97 +8,111 @@ html_meta:
88

99
(resync-translations-label)=
1010

11-
## Resync translations in Plone back-end
11+
## Resync translations in the Plone backend
1212

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. Those translations are not only used in Plone Classic, but many of them are also exposed through the REST API to Volto.
13+
Plone {term}`PO file`s need to be updated each time a new string is added into the Plone interface or each time one of those strings is updated.
14+
Those translations are not only used in Plone Classic UI, but many of them are also exposed through the REST API to Volto.
1415

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+
Usually the Plone Translations Team updates these PO files.
17+
Here we will explain the procedure to update them.
1618

17-
1. Clone the relevant branch of [buildout.coredev](https://github.com/plone/buildout.coredev) corresponding to the Plone version you want to update.
19+
1. Clone the relevant branch of [buildout.coredev](https://github.com/plone/buildout.coredev) corresponding to the Plone version you want to update.
1820

19-
2. Initialize the buildout.
21+
2. Initialize the buildout.
2022

21-
```bash
22-
./bootstraph.sh
23-
```
23+
```shell
24+
./bootstraph.sh
25+
```
2426

25-
3. Run buildout using the `experimental/i18n.cfg` file:
27+
3. Run buildout using the `experimental/i18n.cfg` file:
2628

27-
```bash
28-
./bin/buildout -c experimental/i18n.cfg
29-
```
29+
```shell
30+
./bin/buildout -c experimental/i18n.cfg
31+
```
3032

31-
4. Run the `i18n-update-all` script:
33+
4. Run the `i18n-update-all` script:
3234

33-
```bash
34-
./bin/i18n-update-all
35-
```
35+
```shell
36+
./bin/i18n-update-all
37+
```
3638

37-
The script will go through Plone source code and will update all `pot` and `po` files in the plone.app.locales package.
39+
The script will go through Plone source code and will update all `pot` and `po` files in the `plone.app.locales` package.
3840

39-
5. Commit the changes and push back to GitHub:
41+
5. Commit the changes and push back to GitHub:
4042

41-
```bash
42-
cd src/plone.app.locales
43-
git add plone
44-
git commit -m "Update translation files"
45-
git push origin
46-
```
43+
```shell
44+
cd src/plone.app.locales
45+
git add plone
46+
git commit -m "Update translation files"
47+
git push origin
48+
```
4749

48-
## Create a new plone.app.locales release
4950

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+
(create-new-plone.app.locales-release-label)=
5152

52-
1. Create a virtualenv with zest.releaser and zest.pocompile installed:
53+
## Create a new `plone.app.locales` release
5354

54-
```bash
55-
`which python3.8` -m venv .
56-
./bin/pip install zest.releaser zest.pocompile
57-
source bin/activate
58-
```
55+
Translators will take care of translating `po` files into their languages.
56+
When the release manager requests to create a new `plone.app.locales` release, the procedure is the following:
5957

60-
2. Go to plone.app.locales directory and pull the changes:
58+
1. Create a virtualenv with `zest.releaser` and `zest.pocompile` installed:
6159

62-
```bash
63-
cd src/plone.app.locales
64-
git pull
65-
```
60+
```shell
61+
`which python3.10` -m venv .
62+
./bin/pip install zest.releaser zest.pocompile
63+
source bin/activate
64+
```
6665

67-
3. Verify there is a changelog entry for each change, add any missing entries if necessary.
66+
2. Go to the `plone.app.locales` directory and pull the changes:
6867

68+
```shell
69+
cd src/plone.app.locales
70+
git pull
71+
```
6972

70-
4. Verify there is no errors in the po files:
73+
3. Verify there is a changelog entry for each change, adding any missing entries if necessary.
7174

72-
```bash
73-
for po in `find . -name "*.po"` ; do msgfmt --no-hash -o `dirname $po`/`basename $po .po`.mo $po; done
74-
```
75+
4. Verify there are no errors in the PO files:
7576

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+
```shell
78+
for po in `find . -name "*.po"` ; do msgfmt --no-hash -o `dirname $po`/`basename $po .po`.mo $po; done
79+
```
7780

78-
5. Release:
81+
You can ignore the errors `'msgid' and 'msgstr' entries do not both end with '\n'`.
82+
If there are other errors, please fix them.
7983

80-
```bash
81-
fullrelease
82-
```
84+
5. Release.
85+
86+
```shell
87+
fullrelease
88+
```
89+
90+
6. Check that the release is published on PyPI at https://pypi.org/project/plone.app.locales/.
8391

84-
6. Check that the release is published on pypi: https://pypi.org/project/plone.app.locales/
92+
7. Inform the release manager about the new version.
8593

86-
7. Inform the release manager about the new version
8794

88-
## Resync of translations in Volto
95+
(resync-translations-volto-label)=
8996

90-
In Volto, the GitHub test setup warns a developer when her new bits require regenerating the translation file. This is done running a yarn script as follows:
97+
## Resync translations in Volto
9198

92-
```bash
99+
In Volto, the GitHub test setup warns a developer when their new contributions require regenerating the translation file.
100+
This is done by running a yarn script as follows:
101+
102+
```shell
93103
yarn i18n
94104
```
95105

96-
This will update the po files and will leave them ready to be translated by translators.
106+
This will update the PO files and will leave them ready to be translated by translators.
107+
108+
109+
(create-release-volto-translations)=
97110

98-
## Create a new release of Volto with the new translations
111+
## Create a release of Volto with the new translations
99112

100-
The Volto release process requires running the same yarn script as in the previous step to convert the translations in po files to the JSON files that Volto uses to render the user interface.
113+
The Volto release process requires running the same yarn script as in the previous step.
114+
It will convert the translations in PO files to the JSON files that Volto uses to render the user interface.
101115

102-
```bash
116+
```shell
103117
yarn i18n
104118
```

0 commit comments

Comments
 (0)