summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3805bee)
raw | patch | inline | side by side (parent: 3805bee)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 31 Aug 2007 11:12:39 +0000 (11:12 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 31 Aug 2007 11:12:39 +0000 (11:12 +0000) |
get_browser_language will now return langauge with following priority.
User-language
Global-Language
Browser-Language
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7180 594d385d-05f5-0310-b6e9-bd551577e9d8
User-language
Global-Language
Browser-Language
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7180 594d385d-05f5-0310-b6e9-bd551577e9d8
html/main.php | patch | blob | history | |
include/functions.inc | patch | blob | history |
diff --git a/html/main.php b/html/main.php
index 5a7261cb9e7ee7516d8b95e3dcffdacc649b0982..2a25aa99be64dcdae1296069e9972bfd6e6f1321 100644 (file)
--- a/html/main.php
+++ b/html/main.php
$_SESSION['Last_init_lang'] = get_browser_language();
}
-/* Language setup */
-if ($config->data['MAIN']['LANG'] == ""){
-
- /* If last language != current force navi reload */
- if($_SESSION['Last_init_lang'] != get_browser_language()){
- $reload_navigation = true;
- }
- $lang= get_browser_language();
- $_SESSION['Last_init_lang'] = $lang;
-} else {
- $lang= $config->data['MAIN']['LANG'];
+/* If last language != current force navi reload */
+$lang= get_browser_language();
+if($_SESSION['Last_init_lang'] != $lang){
+ $reload_navigation = true;
}
+/* Language setup */
+$_SESSION['Last_init_lang'] = $lang;
+
/* Preset current main base */
if(!isset($_SESSION['CurrentMainBase'])){
$_SESSION['CurrentMainBase']= get_base_from_people($ui->dn);
diff --git a/include/functions.inc b/include/functions.inc
index 014b0c031c6b1e1f41fe62b85c577b62c08076ad..7c559dbbea42e3c88fe606d812f1cfff5d7a80d6 100644 (file)
--- a/include/functions.inc
+++ b/include/functions.inc
function get_browser_language()
{
/* Try to use users primary language */
+ global $config;
$ui= get_userinfo();
if ($ui != NULL){
if ($ui->language != ""){
}
}
+ /* Check for global language settings in gosa.conf */
+ if(isset($config->data['MAIN']['LANG']) && !empty($config->data['MAIN']['LANG'])) {
+ $lang = $config->data['MAIN']['LANG'];
+ if(!preg_match("/utf/i",$lang)){
+ $lang .= ".UTF-8";
+ }
+ return($lang);
+ }
+
/* Load supported languages */
$gosa_languages= get_languages();