X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fpgettext.php;h=6ffed3ba35da72f205065f678b7726c34e45d034;hb=c69d60644f46246978a7b52da79e7e58c74e31e6;hp=ae1ce009c11765654e3d4101462a3fb04abd2dee;hpb=2fe80e051bb0314e94609530f422679263a7c709;p=friendica.git diff --git a/include/pgettext.php b/include/pgettext.php index ae1ce009c1..6ffed3ba35 100644 --- a/include/pgettext.php +++ b/include/pgettext.php @@ -14,7 +14,6 @@ use Friendica\Core\Config; require_once "include/dba.php"; -if (! function_exists('get_browser_language')) { /** * @brief get the prefered language from the HTTP_ACCEPT_LANGUAGE header */ @@ -55,7 +54,7 @@ function get_browser_language() { // in case none matches, get the system wide configured language, or fall back to English return Config::get('system', 'language', 'en'); -}} +} function push_lang($language) { @@ -70,7 +69,7 @@ function push_lang($language) { if (isset($a->strings) && count($a->strings)) { $a->stringsave = $a->strings; } - $a->strings = array(); + $a->strings = []; load_translation_table($language); $lang = $language; } @@ -85,7 +84,7 @@ function pop_lang() { if (isset($a->stringsave)) { $a->strings = $a->stringsave; } else { - $a->strings = array(); + $a->strings = []; } $lang = $a->langsave; @@ -93,7 +92,6 @@ function pop_lang() { // l -if (! function_exists('load_translation_table')) { /** * load string translation table for alternate language * @@ -104,9 +102,9 @@ if (! function_exists('load_translation_table')) { function load_translation_table($lang) { $a = get_app(); - $a->strings = array(); + $a->strings = []; // load enabled plugins strings - $plugins = dba::select('addon', array('name'), array('installed' => true)); + $plugins = dba::select('addon', ['name'], ['installed' => true]); while ($p = dba::fetch($plugins)) { $name = $p['name']; if (file_exists("addon/$name/lang/$lang/strings.php")) { @@ -118,7 +116,7 @@ function load_translation_table($lang) { include("view/lang/$lang/strings.php"); } -}} +} /** * @brief Return the localized version of the provided string with optional string interpolation @@ -219,7 +217,7 @@ function string_plural_select_default($n) * @return array */ function get_available_languages() { - $langs = array(); + $langs = []; $strings_file_paths = glob('view/lang/*/strings.php'); if (is_array($strings_file_paths) && count($strings_file_paths)) {