diff --git a/include/functions.inc b/include/functions.inc
index 5358c6f097ac7d0a780ecc27bff3e7a487ee3b0a..05bdfd5632cb4c979f0801f340ef37802f52f2d1 100644 (file)
--- a/include/functions.inc
+++ b/include/functions.inc
require_once ("class_config.inc");
require_once ("class_userinfo.inc");
require_once ("class_plugin.inc");
+require_once ("class_dhcpPlugin.inc");
require_once ("class_pluglist.inc");
require_once ("class_tabs.inc");
require_once ("class_mail-methods.inc");
function get_browser_language()
{
/* Try to use users primary language */
+ global $config;
$ui= get_userinfo();
if ($ui != NULL){
if ($ui->language != ""){
}
}
+ /* Try to use users primary language */
+ if ($ui != NULL){
+ if ($ui->language != ""){
+ return ($ui->language.".UTF-8");
+ }
+ }
+
/* Load supported languages */
$gosa_languages= get_languages();
@@ -2514,17 +2523,30 @@ function get_languages($languages_in_own_language = FALSE,$strip_region_tag = FA
"sv_SE" => "Swedish",
"zh_CN" => "Chinese",
"ru_RU" => "Russian");
+
+ $tmp2= array(
+ "de_DE" => _("German"),
+ "fr_FR" => _("French"),
+ "it_IT" => _("Italian"),
+ "es_ES" => _("Spanish"),
+ "en_US" => _("English"),
+ "nl_NL" => _("Dutch"),
+ "pl_PL" => _("Polish"),
+ "sv_SE" => _("Swedish"),
+ "zh_CN" => _("Chinese"),
+ "ru_RU" => _("Russian"));
$ret = array();
if($languages_in_own_language){
+
$old_lang = setlocale(LC_ALL, 0);
foreach($tmp as $key => $name){
$lang = $key.".UTF-8";
setlocale(LC_ALL, $lang);
if($strip_region_tag){
- $ret[preg_replace("/^([^_]*).*$/","\\1",$key)] = _($name)." (".$name.")";
+ $ret[preg_replace("/^([^_]*).*$/","\\1",$key)] = _($name)." (".$tmp2[$key].")";
}else{
- $ret[$key] = _($name)." (".$name.")";
+ $ret[$key] = _($name)." (".$tmp2[$key].")";
}
}
setlocale(LC_ALL, $old_lang);