Improvement import languages
- file .po is loaded in folder content/translations.
This commit is contained in:
@@ -302,15 +302,12 @@ class workspaceTools
|
|||||||
$names = explode(".", basename($poFile));
|
$names = explode(".", basename($poFile));
|
||||||
$extension = array_pop($names);
|
$extension = array_pop($names);
|
||||||
$langid = array_pop($names);
|
$langid = array_pop($names);
|
||||||
if (strcasecmp($langid, "en") == 0) {
|
if (strcasecmp($langid, "en") != 0 && $first) {
|
||||||
CLI::logging("Updating database translations with $poName\n");
|
|
||||||
Language::import($poFile, false, true);
|
|
||||||
} elseif ($first) {
|
|
||||||
CLI::logging("Updating XML form translations with $poName\n");
|
CLI::logging("Updating XML form translations with $poName\n");
|
||||||
Language::import($poFile, true, false);
|
Language::import($poFile, true, false);
|
||||||
CLI::logging("Updating database translations with $poName\n");
|
|
||||||
Language::import($poFile, false, true);
|
|
||||||
}
|
}
|
||||||
|
CLI::logging("Updating database translations with $poName\n");
|
||||||
|
Language::import($poFile, false, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -275,9 +275,11 @@ class Language extends BaseLanguage
|
|||||||
$oLanguage->update( array ('LAN_ID' => $languageID,'LAN_ENABLED' => '1'
|
$oLanguage->update( array ('LAN_ID' => $languageID,'LAN_ENABLED' => '1'
|
||||||
) );
|
) );
|
||||||
|
|
||||||
$trn = new Translation();
|
if ($updateXml) {
|
||||||
$trn->generateFileTranslation( $LOCALE );
|
$trn = new Translation();
|
||||||
$trn->addTranslationEnvironment( $LOCALE, $POHeaders, $countItemsSuccess );
|
$trn->generateFileTranslation( $LOCALE );
|
||||||
|
$trn->addTranslationEnvironment( $LOCALE, $POHeaders, $countItemsSuccess );
|
||||||
|
}
|
||||||
|
|
||||||
//fill the results
|
//fill the results
|
||||||
$results = new stdClass();
|
$results = new stdClass();
|
||||||
|
|||||||
@@ -97,6 +97,12 @@ try {
|
|||||||
);
|
);
|
||||||
$configuration->saveConfig( 'LANGUAGE_META', $importResults->lang );
|
$configuration->saveConfig( 'LANGUAGE_META', $importResults->lang );
|
||||||
|
|
||||||
|
$dir = PATH_CORE . 'content' . PATH_SEP . 'translations' . PATH_SEP;
|
||||||
|
if (! is_writable( $dir )) {
|
||||||
|
throw new Exception( G::LoadTranslation( 'ID_CONTENT_FOLDER_PERMISSIONS' ) );
|
||||||
|
}
|
||||||
|
G::uploadFile($languageFile, $dir, $languageFilename, 0777);
|
||||||
|
|
||||||
ini_set( 'max_execution_time', $sMaxExecutionTime );
|
ini_set( 'max_execution_time', $sMaxExecutionTime );
|
||||||
|
|
||||||
} catch (Exception $oError) {
|
} catch (Exception $oError) {
|
||||||
|
|||||||
Reference in New Issue
Block a user