Hi,
I made a small script for updating language-files to contain all entries that are in the english files.
<?
include("danish.inc.php");
$dk=$_lang;
unset($_lang);
include("english.inc.php");
$en=$_lang;
unset($_lang);
echo "<?php\n";
foreach($en as $key => $value)
{
if (isset($dk[$key])) {
echo "\$_lang[\"".$key."\"] = '".str_replace('\'','\\\'',$dk[$key])."';\n";
}
else {
echo "\$_lang[\"".$key."\"] = ''; // English version: '".str_replace('\'','\\\'',$value)."'\n";
}
}
echo "?>";
?>
It copies entries already in the non-english file and creates new empty entries for the non-existant entries. The english text is added as a comment after the empty string.
It doesn’t care about comments in the language files and hence the header should be added manually afterwards. It there are entries in the non-english file that are not in the english file, they will be lost.
After running the script you can manually find all the strings by running a simple search for "English version" in your favourite text editor.
I used this script to update the danish Manager-translation to match the English in 0.9.6.1 and put the result in the wiki:
http://wiki.modxcms.com/index.php/Manager_da-dk
Questions/comments/corrections are very welcome (if it’s regarding the translation I suggest using the scandinavian forum, where I created a topic:
http://modxcms.com/forums/index.php/topic,21775.0.html)
/Kleist