Fixed translation upgrade.
This commit is contained in:
@@ -256,14 +256,23 @@ class workspaceTools {
|
||||
*
|
||||
* @param bool $updateXml if true, update the xmlforms
|
||||
*/
|
||||
public function upgradeTranslation($updateXml = true) {
|
||||
public function upgradeTranslation($first = true) {
|
||||
$this->initPropel(true);
|
||||
G::LoadClass('languages');
|
||||
G::LoadThirdParty('pear/json', 'class.json');
|
||||
$languages = new languages();
|
||||
foreach (System::listPoFiles() as $poFile) {
|
||||
CLI::logging("Updating language ".basename($poFile)."\n");
|
||||
$languages->importLanguage($poFile, $updateXml);
|
||||
$poName = basename($poFile);
|
||||
$names = explode(".", basename($poFile));
|
||||
$extension = array_pop($names);
|
||||
$langid = array_pop($names);
|
||||
if (strcasecmp($langid, "en") == 0) {
|
||||
CLI::logging("Updating database translations with $poName\n");
|
||||
$languages->importLanguage($poFile, false, true);
|
||||
} else if ($first) {
|
||||
CLI::logging("Updating XML form translations with $poName\n");
|
||||
$languages->importLanguage($poFile, true, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user