I have just patched lang.php to fix MDL-8409. So called "orphaned strings" are now kept in language pack files. The orphans are strings that do not have their referential English version in en_utf8. How may this happen? For example, you have translated the file "admin.php" from 1.8-dev English version. For some reason you edit and save this file at 1.7.1 site. The strings that were added after 1.7.1 are now kept in saved version with the "// ORPHANED" comment at the end of line. Until this patch, such strings would have been silently removed.
This patch should prevent accidental removals of already translated strings.
Hey, that is a great improvement David. Thanks for that.
Thanks David! Much waited enhancement!
À propos, what about MDL-6688? Is there any chance to have it resolved for 1.8 (or 1.9)?
Would automatic removing of all UTF8 non breaking spaces during the file save be acceptable?
Hi David,
I replied to your question in the bug tracker, MDL-6688.
I replied to your question in the bug tracker, MDL-6688.
I have just realized that this new "orphans" feature allows quite a new thing. A friend of mine sent me some of his old 1.6 translated string files (*.php). How to merge them into the current pack? So easy!
Thus me as a language pack coordinator can easily merge translated pieces of strings sent by volunteers - even these pieces were translated using older version. No strings should get lost
- I updated my language pack from CVS
- I made a backup of current version of the sent string files into the /tmp/backup
- I copied sent files and overwrote the current ones
- I copied the the current files back from /tmp/backup into the language pack directory - BUT I did not overwrite them. I chose append when asked by file manager. Thus those sent files looked like:
<?PHP // $Id created with old 1.6 month ago$
$string['blahblah'] = 'My friend's version';
$string['wasmissing'] = 'This was missing in the HEAD';
$string['only16string'] = 'This is not in HEAD 1.8 any more';
?>
<?PHP // $Id created with HEAD 1.8 week ago$
$string['blahblah'] = 'My own version';
?> - When re-saved in lang.php, the file gets merged as wanted (because the $string is an array, the later defined strings win):
<?PHP // $Id created with HEAD 1.8 today$
$string['blahblah'] = 'My own version';
$string['wasmissing'] = 'This was missing in the HEAD';
$string['only16string'] = 'This is not in HEAD 1.8 any more'; // ORPHANED
?>
Thus me as a language pack coordinator can easily merge translated pieces of strings sent by volunteers - even these pieces were translated using older version. No strings should get lost