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

use array_replace_recursive, as array_merge_recursive produces arrays for existing keys

parent a9796183
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -77,7 +77,7 @@ class Translate ...@@ -77,7 +77,7 @@ class Translate
if (!Common::isValidFilename($language) || !is_readable($path)) { if (!Common::isValidFilename($language) || !is_readable($path)) {
throw new Exception(Piwik_TranslateException('General_ExceptionLanguageFileNotFound', array($language))); throw new Exception(Piwik_TranslateException('General_ExceptionLanguageFileNotFound', array($language)));
} }
$data = file_get_contents($path); $data = file_get_contents($path);
$translations = json_decode($data, true); $translations = json_decode($data, true);
$this->mergeTranslationArray($translations); $this->mergeTranslationArray($translations);
$this->setLocale(); $this->setLocale();
...@@ -90,7 +90,7 @@ class Translate ...@@ -90,7 +90,7 @@ class Translate
$GLOBALS['Piwik_translations'] = array(); $GLOBALS['Piwik_translations'] = array();
} }
// we could check that no string overlap here // we could check that no string overlap here
$GLOBALS['Piwik_translations'] = array_merge_recursive($GLOBALS['Piwik_translations'], $translation); $GLOBALS['Piwik_translations'] = array_replace_recursive($GLOBALS['Piwik_translations'], $translation);
} }
/** /**
......
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