|
|
Mads Kiilerich
|
36a36ebdf4bb
|
3 years ago
|
|
|
|
|
Mads Kiilerich
|
6bde1c0a04d4
|
5 years ago
|
|
|
|
|
Mads Kiilerich
|
19735bc60455
|
6 years ago
|
|
|
|
|
Mads Kiilerich
|
e505395c3a03
|
6 years ago
|
|
i18n: better stripping of header comment for new translations
Also strip any header occurrence of:
# FIRST AUTHOR <EMAIL@ADDRESS>, 2019. #
while preserving stripping of:
#, fuzzy
and leading empty comment lines.
|
|
|
Mads Kiilerich
|
30e137b4ff18
|
6 years ago
|
|
scripts/i18n: also normalize casing of UTF-8 in Content-Type f626260a376c introduced invariant msgmerge casing. Do the same when normalizing to ensure consistency also without msgmerge and to avoid unnecessary conflicts.
|
|
|
Mads Kiilerich
|
5553ecc962e0
|
6 years ago
|
|
scripts/i18n: introduce --merge-pot-file to control normalization
There are actually *two* kinds of normalization:
- in main branches, where we just want the translations - not any trivially derived information or temporary or unstructured data. - in i18n branches, where we want the trivially derived information, and also want to preserve any other information there might be in the .po files.
If no pot file is specifed, do it as on the main branches and strip everything but actual translations. This mode will primarily be used when grafting or rebasing changes from i18n branches.
When a pot file is specified, run GNU msgmerge with it on the po files. The pot file should ideally be fully updated (as done by extract_messages). That will establish a common baseline, leaving only the essential changes as needing merge.
If merging from default branches to 18n, it is better to skip .po and .pot in first 'hg merge' pass, while resolving everything else. Then, with the uncommitted merge, run 'extract_messages', and then merge the .po files using --merge-pot-file kallithea/i18n/kallithea.pot .
(Actually, these two different modes could perhaps be auto detected ...)
|
|
|
Thomas De Schampheleire
|
93dabafa567e
|
6 years ago
|
|
scripts/i18n: add command 'normalized-diff'
Add a command 'normalized-diff' that takes two (po) files and diff normalized copies of them.
|
|
|
Thomas De Schampheleire
|
ae9d205f4407
|
6 years ago
|
|
scripts/i18n: add command 'normalize-po-files'
The translation files in the Kallithea repository contained references to the location(s) of each string in the repository. This is useful to translators, but is not needed for all other users.
The big problem with that information is that it changes very commonly as a result of normal development in Kallithea, causing a lot of unimportant delta in the Kallithea repository, thus causing unnecessary repository growth.
In this commit, a basic version of the script is added, only containing the code to normalize the translation files by removing generated and outdated data.
This can be used to check or ensure internal consistency between code and translations, by extracting and merging and then removing most of it again with normalize-po-files:
./setup.py extract_messages
for po in kallithea/i18n/*/LC_MESSAGES/kallithea.po; do msgmerge --width=76 --backup=none --previous --update $po kallithea/i18n/kallithea.pot ; done
scripts/i18n normalize-po-files kallithea/i18n/kallithea.pot kallithea/i18n/*/LC_MESSAGES/kallithea.po
Includes contributions from Mads Kiilerich.
|
|
|
Thomas De Schampheleire
|
4bc712f1ec93
|
6 years ago
|
|
scripts/i18n: introduce new i18n maintenance script
The translation files in the Kallithea repository contained references to the location(s) of each string in the repository. This is useful to translators, but is not needed for all other users.
The big problem with that information is that it changes very commonly as a result of normal development in Kallithea, causing a lot of unimportant delta in the Kallithea repository, thus causing unnecessary repository growth.
A script 'i18n' is added to help maintain the i18n files. Functionality will be added later.
|