|
|
Mads Kiilerich
|
68eee0e7f4f5
|
5 years ago
|
|
isort: upgrade to 5.1.2
The changes to non-top-level imports seem nice.
|
|
|
Mads Kiilerich
|
80ffe0f29857
|
6 years ago
|
|
|
|
|
Mads Kiilerich
|
f8314738030a
|
6 years ago
|
|
scripts/i18n: let 'normalized-merge' leave 3-way conflict markers in output file
3-way conflict markers in the output file can be convenient ... and they do no harm when merge tools like kdiff3 will overwrite output anyway.
|
|
|
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
|
46e78e583ed3
|
6 years ago
|
|
scripts/i18n: add command 'normalized-merge' for use with Mercurial's 'merge-tool' option
Add a 'normalized-merge' command to scripts/i18n that will first normalize the i18n files contributing to the merge, then perform a standard merge. If that merge fails (e.g. due to real conflicts) the normalized files are left behind, and the user needs to run another merge tool manually and resolve the merge of these.
Use by putting following snippets in your .hgrc file:
[merge-tools] i18n.executable = /path/to/scripts/i18n i18n.args = normalized-merge $local $base $other $output
or
[merge-tools] i18n.executable = python3 i18n.args = /path/to/scripts/i18n normalized-merge $local $base $other $output
and when i18n files conflict, get all 3 sides of the merge normalized before merge by running:
hg resolve 'kallithea/i18n/*/LC_MESSAGES/kallithea.po' --tool i18n
|
|
|
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.
|