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
 
@@ -29,8 +29,8 @@ format parameters, untranslated strings 
 
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
 
@@ -45,6 +45,28 @@ which case it should be manually convinc
 
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
 
---------------------------------------------
 

	
0 comments (0 inline, 0 general)