Add directory prefix to localisation files
This commit is contained in:
parent
ddde506dcb
commit
dd242052f7
6
base.php
6
base.php
|
@ -157,12 +157,12 @@ function localize($phrase, $count=-1) {
|
||||||
$lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);
|
$lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);
|
||||||
}
|
}
|
||||||
$lang_file_en = NULL;
|
$lang_file_en = NULL;
|
||||||
$lang_file = 'lang/Localization_' . $lang . '.json';
|
$lang_file = dirname(__FILE__). '/lang/Localization_' . $lang . '.json';
|
||||||
if (!file_exists($lang_file)) {
|
if (!file_exists($lang_file)) {
|
||||||
$lang_file = 'lang/' . 'Localization_en.json';
|
$lang_file = dirname(__FILE__). '/lang/' . 'Localization_en.json';
|
||||||
}
|
}
|
||||||
elseif ($lang != "en") {
|
elseif ($lang != "en") {
|
||||||
$lang_file_en = 'lang/' . 'Localization_en.json';
|
$lang_file_en = dirname(__FILE__). '/lang/' . 'Localization_en.json';
|
||||||
}
|
}
|
||||||
$lang_file_content = file_get_contents($lang_file);
|
$lang_file_content = file_get_contents($lang_file);
|
||||||
/* Load the language file as a JSON object and transform it into an associative array */
|
/* Load the language file as a JSON object and transform it into an associative array */
|
||||||
|
|
Loading…
Reference in a new issue