Skip to content
Extraits de code Groupes Projets
Valider ff8e583c rédigé par sgiehl's avatar sgiehl
Parcourir les fichiers

fixed translation issue with plugins; plugin default translations (en), were...

fixed translation issue with plugins; plugin default translations (en), were not loaded if a translation file for a specific language exists
parent 50c8c46f
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -841,19 +841,29 @@ class Manager extends Singleton
$defaultLangPath = sprintf($path, $langCode);
$defaultEnglishLangPath = sprintf($path, 'en');
if (file_exists($defaultLangPath)) {
$translations = $this->getTranslationsFromFile($defaultLangPath);
} elseif (file_exists($defaultEnglishLangPath)) {
$translationsLoaded = false;
// merge in english translations as default first
if (file_exists($defaultEnglishLangPath)) {
$translations = $this->getTranslationsFromFile($defaultEnglishLangPath);
} else {
return false;
$translationsLoaded = true;
if (isset($translations[$pluginName])) {
// only merge translations of plugin - prevents overwritten strings
Translate::mergeTranslationArray(array($pluginName => $translations[$pluginName]));
}
}
if (isset($translations[$pluginName])) {
// only merge translations of plugin - prevents overwritten strings
Translate::mergeTranslationArray(array($pluginName => $translations[$pluginName]));
// merge in specific language translations (to overwrite english defaults)
if (file_exists($defaultLangPath)) {
$translations = $this->getTranslationsFromFile($defaultLangPath);
$translationsLoaded = true;
if (isset($translations[$pluginName])) {
// only merge translations of plugin - prevents overwritten strings
Translate::mergeTranslationArray(array($pluginName => $translations[$pluginName]));
}
}
return true;
return $translationsLoaded;
}
/**
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter