Include only active translations
This commit is contained in:
parent
8db1469dbc
commit
b4b59779b9
|
@ -60,20 +60,20 @@ function put_file($match) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function put_file_lang($match) {
|
function put_file_lang($match) {
|
||||||
global $lang_ids, $project;
|
global $lang_ids, $project, $langs;
|
||||||
if ($_SESSION["lang"]) {
|
if ($_SESSION["lang"]) {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
$return = "";
|
$return = "";
|
||||||
foreach (glob(dirname(__FILE__) . "/adminer/lang/*.inc.php") as $filename) {
|
foreach ($langs as $lang => $val) {
|
||||||
include $filename; // assign $translations
|
include dirname(__FILE__) . "/adminer/lang/$lang.inc.php"; // assign $translations
|
||||||
$translation_ids = array_flip($lang_ids); // default translation
|
$translation_ids = array_flip($lang_ids); // default translation
|
||||||
foreach ($translations as $key => $val) {
|
foreach ($translations as $key => $val) {
|
||||||
if (isset($val)) {
|
if (isset($val)) {
|
||||||
$translation_ids[$lang_ids[$key]] = $val;
|
$translation_ids[$lang_ids[$key]] = $val;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$return .= "\tcase \"" . basename($filename, '.inc.php') . '": $translations = array(';
|
$return .= "\tcase \"$lang\": \$translations = array(";
|
||||||
foreach ($translation_ids as $val) {
|
foreach ($translation_ids as $val) {
|
||||||
$return .= (is_array($val) ? "array('" . implode("', '", array_map('add_apo_slashes', $val)) . "')" : "'" . add_apo_slashes($val) . "'") . ", ";
|
$return .= (is_array($val) ? "array('" . implode("', '", array_map('add_apo_slashes', $val)) . "')" : "'" . add_apo_slashes($val) . "'") . ", ";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue