Skip to content
Snippets Groups Projects
Commit ac6b26be authored by Jaime Pérez's avatar Jaime Pérez
Browse files

Use \SimpleSAML\Logger in the new Localization class, and fix general...

Use \SimpleSAML\Logger in the new Localization class, and fix general Exception being called from a namespace.
parent 77944238
No related branches found
No related tags found
No related merge requests found
......@@ -110,16 +110,17 @@ class Localization
$langPath = $localeDir.'/'.$defLangcode.'/LC_MESSAGES/';
if (is_dir($langPath) && is_readable($langPath)) {
// Report that the localization for the preferred language is missing
$error = "Localization not found for langcode '$langcode' at '$langPath', falling back to langcode '$defLangcode'";
\SimpleSAML_Logger::error($_SERVER['PHP_SELF'].' - '.$error);
$error = "Localization not found for langcode '$langcode' at '$langPath', falling back to langcode '".
$defLangcode."'";
\SimpleSAML\Logger::error($_SERVER['PHP_SELF'].' - '.$error);
return $langPath;
}
// Locale for default language missing even, error out
$error = "Localization directory missing/broken for langcode '$langcode' and domain '$domain'";
\SimpleSAML_Logger::critical($_SERVER['PHP_SELF'].' - '.$error);
throw new Exception($error);
\SimpleSAML\Logger::critical($_SERVER['PHP_SELF'].' - '.$error);
throw new \Exception($error);
}
......@@ -144,7 +145,7 @@ class Localization
$t->loadTranslations($translations);
} else {
$error = "Localization file '$poFile' not found in '$langPath', falling back to default";
\SimpleSAML_Logger::error($_SERVER['PHP_SELF'].' - '.$error);
\SimpleSAML\Logger::error($_SERVER['PHP_SELF'].' - '.$error);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment