Changeset - 5b841d56bf74
[Not reviewed]
default
0 1 0
Thomas De Schampheleire - 7 years ago 2019-03-12 21:22:43
thomas.de_schampheleire@nokia.com
i18n: how_to: add instructions to regenerate translations

The wrap value of '76' is determined empirically by checking the total
diff after regeneration using wrap values 70 - 90, using 'wc' to find the
smallest delta. It also corresponds with the help text of Weblate that says
that the default is to 'wrap at 77 characters'.
1 file changed with 24 insertions and 2 deletions:
0 comments (0 inline, 0 general)
kallithea/i18n/how_to
Show inline comments
 
@@ -26,14 +26,14 @@ makes things easier.
 
Weblate performs sanity checks all the time and tries to prevent you from ignoring
 
them. Most common mistakes are inconsistent punctuation, whitespace, missing or extra
 
format parameters, untranslated strings copied into the translation. Please perform
 
necessary corrections when they're needed, or override the false positives.
 

	
 

	
 
Merging translations from Weblate
 
---------------------------------
 
Merging translations from Weblate (admin-only)
 
----------------------------------------------
 

	
 
Weblate rebases its changes every time it pulls from our repository. Pulls are triggered
 
by a web hook from Our Own Kallithea every time it receives new commits. Usually merging
 
the new translations is a straightforward process consisting of a pull from the Weblate-hosted
 
repository which is available under the Data Exports tab in the Weblate interface.
 

	
 
@@ -42,12 +42,34 @@ when two translators work with different
 
It makes sense sometimes to re-order or fold commits by the same author when they touch
 
just the same language translation. That, however, may confuse Weblate sometimes, in
 
which case it should be manually convinced it has to discard the commits it created by
 
using its administrative interface.
 

	
 

	
 
Regenerating translatations after source code changes (admin-only)
 
------------------------------------------------------------------
 

	
 
When the Kallithea source code changes, both the location as the content of
 
translation strings can change. It is therefore necessary to regularly
 
regenerate the `kallithea.pot` file containing these strings, as well as aligning
 
the translation files (`*.po`).
 

	
 
First update the translation strings::
 

	
 
    python2 setup.py extract_messages
 

	
 
Then regenerate the translation files. This could either be done with `python2
 
setup.py update_catalog` or with `msgmerge` from the `gettext` package. As
 
Weblate is also touching these translation files, it is preferred to use the
 
same tools (`msgmerge`) and settings as Weblate to minimize the diff::
 

	
 
    find kallithea/i18n -name kallithea.po | xargs -I '{}' \
 
        msgmerge --width=76 --backup=none --previous --update '{}' \
 
        kallithea/i18n/kallithea.pot
 

	
 

	
 
Manual creation of a new language translation
 
---------------------------------------------
 

	
 
In the prepared development environment, run the following to ensure
 
all translation strings are extracted and up-to-date::
 

	
0 comments (0 inline, 0 general)