]> git.mxchange.org Git - friendica.git/blobdiff - include/pgettext.php
get rid of 'Friendika'
[friendica.git] / include / pgettext.php
index 83e76ba9d60b9b1c0d05254a53b3647fb64090bc..5a0eab0b01078267a424c65ce47e22ab32879aa5 100644 (file)
  */
 
 
-if(! function_exists('get_language')) {
-function get_language() {
+if(! function_exists('get_browser_language')) {
+function get_browser_language() {
 
-       if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
+       if (x($_SERVER,'HTTP_ACCEPT_LANGUAGE')) {
            // break up string into pieces (languages and q factors)
        preg_match_all('/([a-z]{1,8}(-[a-z]{1,8})?)\s*(;\s*q\s*=\s*(1|0\.[0-9]+))?/i', 
                        $_SERVER['HTTP_ACCEPT_LANGUAGE'], $lang_parse);
@@ -49,6 +49,7 @@ function get_language() {
        if(isset($preferred))
                return $preferred;
 
+    $a = get_app();
        return ((isset($a->config['system']['language'])) ? $a->config['system']['language'] : 'en');
 }}