Minor code cleaning for the function get_lang().

skala
Ivan Tcholakov 15 years ago
parent e7f0ef640f
commit c5e36d049a
  1. 13
      main/inc/lib/internationalization.lib.php

@ -124,21 +124,14 @@ function get_lang($variable, $reserved = null, $language = null) {
$_api_is_translated, $_api_is_translated_call;
// Caching results from some API functions, for speed.
static $encoding, $is_utf8_encoding, $langpath, $test_server_mode, $show_special_markup;
if (!isset($is_utf8_encoding)) {
static $initialized, $encoding, $is_utf8_encoding, $langpath, $test_server_mode, $show_special_markup;
if (!isset($initialized)) {
$encoding = api_get_system_encoding();
}
if (!isset($is_utf8_encoding)) {
$is_utf8_encoding = api_is_utf8($encoding);
}
if (!isset($langpath)) {
$langpath = api_get_path(SYS_LANG_PATH);
}
if (!isset($test_server_mode)) {
$test_server_mode = api_get_setting('server_type') == 'test';
}
if (!isset($show_special_markup)) {
$show_special_markup = api_get_setting('hide_dltt_markup') != 'true' || $test_server_mode;
$initialized = true;
}
// Combining both ways for requesting specific language.

Loading…
Cancel
Save