mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-12-20 15:33:47 +01:00
LSlang :: setLocale(): don't warn if lang file not found
This commit is contained in:
parent
3c613b7ab4
commit
1dabe6d6aa
1 changed files with 9 additions and 5 deletions
|
@ -76,7 +76,7 @@ class LSlang {
|
||||||
|
|
||||||
// Check
|
// Check
|
||||||
if (self :: localeExist($lang, $encoding)) {
|
if (self :: localeExist($lang, $encoding)) {
|
||||||
LSlog :: debug("LSsession :: setLocale() : Use local '$lang.$encoding'");
|
LSlog :: debug("LSlang :: setLocale() : Use local '$lang.$encoding'");
|
||||||
if ($encoding) {
|
if ($encoding) {
|
||||||
$lang .= '.'.$encoding;
|
$lang .= '.'.$encoding;
|
||||||
}
|
}
|
||||||
|
@ -89,18 +89,22 @@ class LSlang {
|
||||||
|
|
||||||
// Configure and set the text domain
|
// Configure and set the text domain
|
||||||
$fullpath = bindtextdomain(LS_TEXT_DOMAIN, LS_I18N_DIR_PATH);
|
$fullpath = bindtextdomain(LS_TEXT_DOMAIN, LS_I18N_DIR_PATH);
|
||||||
LSlog :: debug("Text domain fullpath is '$fullpath'.");
|
LSlog :: debug("LSlang :: setLocale(): Text domain fullpath is '$fullpath'.");
|
||||||
LSlog :: debug("Text domain is : ".textdomain(LS_TEXT_DOMAIN));
|
LSlog :: debug("LSlang :: setLocale(): Text domain is : ".textdomain(LS_TEXT_DOMAIN));
|
||||||
|
|
||||||
// Include local translation file
|
// Include local translation file
|
||||||
LSsession :: includeFile(LS_I18N_DIR.'/'.$lang.'/lang.php');
|
$lang_file = LS_I18N_DIR.'/'.$lang.'/lang.php';
|
||||||
|
if (LSsession :: includeFile($lang_file, false, false))
|
||||||
|
LSlog :: debug("LSlang :: setLocale(): lang file '$lang_file' loaded.");
|
||||||
|
else
|
||||||
|
LSlog :: debug("LSlang :: setLocale(): no lang file found ($lang_file).");
|
||||||
|
|
||||||
// Include other local translation file(s)
|
// Include other local translation file(s)
|
||||||
foreach(array(LS_I18N_DIR_PATH.'/'.$lang, LS_LOCAL_DIR.'/'.LS_I18N_DIR.'/'.$lang) as $lang_dir) {
|
foreach(array(LS_I18N_DIR_PATH.'/'.$lang, LS_LOCAL_DIR.'/'.LS_I18N_DIR.'/'.$lang) as $lang_dir) {
|
||||||
if (is_dir($lang_dir)) {
|
if (is_dir($lang_dir)) {
|
||||||
foreach (listFiles($lang_dir, '/^lang.+\.php$/') as $file) {
|
foreach (listFiles($lang_dir, '/^lang.+\.php$/') as $file) {
|
||||||
$path = "$lang_dir/$file";
|
$path = "$lang_dir/$file";
|
||||||
LSlog :: debug("LSession :: setLocale() : Local '$lang.$encoding' : load translation file '$path'");
|
LSlog :: debug("LSlang :: setLocale(): Local '$lang.$encoding' : load translation file '$path'");
|
||||||
include($path);
|
include($path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue