How to merge language files | |
To merge language files from different branches you should use doc/devtools/mergelang.php script. Say you want to update 7.x with some translations you did on trunk to the Brazilian Portuguese (pt-br) file. The first think you have to do is make sure that language.php file in 7.x is updated. Running get_strings.php from within your branch folder will get new string that have been added to Tiki: php get_strings.php lang=pt-br And than mergelang.php: php doc/devtools/mergelang.php pathToTikiTrunk pathToTiki7x lang=pt-br Where pathToTikiTrunk is the path to trunk root directory and pathToTiki7x is the path to 7.x root directory. lang can be a single language code or a list of language codes separated by commas. This param is optional and if you omit all language files will be updated. For each English string that this script find in both files, it will replace the translation in the 7.x version with the translation from trunk version (even if the string is untranslated in 7.x). |
i18n.tiki.org | |
i18n.tiki.org will always use trunk (the next version of Tiki in development). Periodically (every one or two weeks) Rodrigo exports the translations done there to the SVN repository (on trunk). Before exporting the translation in i18n.tiki.org from the database, he updates the language.php files, so no translation should be lost in this process.
|
Discussion | |
|
Table of contents | |
Problems | |
http://old.nabble.com/language.php%3A-trunk-versus-3.0-tt23746165.html 2 conflicting things are desirable in the way translations are managed :
The problem is that the strings in language.php do not always stay in the same order so merging can be a nightmare (string by string). As the person doing merges generally knows only a fraction of languages, handling conflicts is a challenge. However, one easy solution to this problem is doing an alphabetical sorting of all lines in language.php, so that they have the same order regardless of versions, with some new lines in between here and there in the trunk version of language.php, and some missing. As far as Xavi knows, simple editors (such as gedit in GNU/Linux-Gnome, and probably many others in other OS's) already handle lines starting with "// text" as if they were starting with "text", and thus, keeping a line in the same place (once alphabetically ordered) regardless of the fact that it's been already translated or not. |
Options | |
|
Translate to trunk, no automatic backport (The safe way) | |
Translators decide to backport to branch or not as they wish.
|
Translate to trunk, with automatic backport to stable branches? | |
|
Translate to stable branch, with merge up | |
|
Unversioned translation files | |
Instead of having one translation per branch, a single out-of-tree translation file would be used. This avoids merge issues. |
Roadmap | |
We should ideally move to unversioned translation files. One drawback they have is they contain some translations unused in certain versions. However it would be possible to strip unused translations if we can tell which translations a version uses. Current translations have a unused translations section which contains translations that could be used but that get_strings doesn't detect as being used. When all translated strings are properly marked in the code, stripping will become possible safely. However, we have to keep in mind that mods used the same single and central language.php file for their translations. So that when someone reviews strings to be (potentially) striped out, some solution has to be provided for translations (such as Catalan) which have many strings for some mods translated (nowadays, and potentially in the future also). Potential solutions:
|
Suggestions | |
Translation in trunk and no backport, but providing a downloadlink for certain languages that are very actively translated.
Update these few files out of trunk on a regular base. Keep strings in Trunk that are not used anymore, but needed in the former branch, as long as the former branch is supported.
For certain custom translations this would anyway to be considered by an admin.
|
Related | |