Skip to content

Commit 71a9545

Browse files
Update pot generation command.
1 parent 1413166 commit 71a9545

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

docs/Localization.rst

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@ Localization
44
For developers
55
==============
66

7-
When you change a string in a template or in a web server, you have to generate again the file :gh_blob:`cms/server/po/messages.pot`. To do so, run this command inside :gh_tree:`cms/`.
7+
When you change a string in a template or in a web server, you have to generate again the file :gh_blob:`cms/server/po/messages.pot`. To do so, run this command from the root of the repository.
88

99
.. sourcecode:: bash
1010

11-
xgettext -o server/po/messages.pot --language=Python --no-location --width=79 --keyword=_:1,2 --keyword=N_ --keyword=N_:1,2 \
12-
grading/__init__.py grading/ScoreType.py grading/scoretypes/*.py grading/tasktypes/*.py \
13-
server/*.py server/templates/admin/*.html server/templates/contest/*.html
11+
xgettext -o cms/server/po/messages.pot --language=Python --no-location \
12+
--keyword=_:1,2 --keyword=N_ --keyword=N_:1,2 --width=79 \
13+
cms/grading/*.py cms/grading/*/*.py cms/server/*.py \
14+
cms/server/templates/admin/*.html \
15+
cms/server/templates/contest/*.html
1416

1517
When you have a new translation, or an update of an old translation, you need to update the ``.mo`` files (the compiled versions of the ``.po`` files). You can run ``./setup.py build`` to update all translations (and also do a couple of other things, like compiling the sandbox). Alternatively, run the following inside :gh_tree:`cms/server/`.
1618

@@ -30,7 +32,7 @@ To begin translating to a new language, run this command, from :gh_tree:`cms/ser
3032

3133
msginit --width=79 -l <two_letter_code_of_language>
3234

33-
Right after that, open :file:`<code>.po` and fill the information in the header. To translate a string, simply fill the corresponding msgstr with the translations.
35+
Right after that, open :file:`<code>.po` and fill the information in the header. To translate a string, simply fill the corresponding msgstr with the translations. You can also use specialized translation softwares such as poEdit and others.
3436

3537
If the developers updated the ``.pot`` file, you do not need to start from scratch. Instead, you can create a new ``.po`` file that merges the old translated string with the new, to-be-translated ones. The command is the following, run inside :gh_tree:`cms/server/po/`.
3638

0 commit comments

Comments
 (0)