You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Added automatic language detection based on HTTP_ACCEPT_LANGUAGE
header. New function _translate, that translates string to required
language.
New file: setlang.php?l=language_code - sets session language.
// works like sprintf if more than one arguments called
3
+
/**
4
+
* Translates string by a given key in first parameter to current session language. Works like sprintf
5
+
* @global array $LANG Associative array of language pharses
6
+
* @return string Translated string
7
+
* @see _translate()
8
+
*/
9
9
function_() {
10
+
$args = func_get_args();
11
+
array_unshift($args,$_SESSION['language']);
12
+
returncall_user_func_array("_translate",$args);
13
+
}
14
+
15
+
/**
16
+
* Translates string to given language in first parameter, key given in second parameter (dynamically loads required language). Works like spritf from second parameter
17
+
* @global array $LANG Associative array of language pharses
0 commit comments