summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 89cdf41)
raw | patch | inline | side by side (parent: 89cdf41)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 7 Aug 2007 09:56:54 +0000 (09:56 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 7 Aug 2007 09:56:54 +0000 (09:56 +0000) |
get_languages().
Currently implemented into setup and user/generic plugin.
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@6980 594d385d-05f5-0310-b6e9-bd551577e9d8
Currently implemented into setup and user/generic plugin.
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@6980 594d385d-05f5-0310-b6e9-bd551577e9d8
include/functions.inc | patch | blob | history | |
plugins/personal/generic/class_user.inc | patch | blob | history | |
setup/class_setupStep_Language.inc | patch | blob | history |
diff --git a/include/functions.inc b/include/functions.inc
index d52aa1e23e083f69f537d6575f8e0a59c5a83bac..ab5f5db9d9559d7c97daae9e5727480e6da31204 100644 (file)
--- a/include/functions.inc
+++ b/include/functions.inc
return ($vendor);
}
+
+function get_languages($languages_in_own_language = FALSE)
+{
+ $tmp = array(
+ "de_DE" => "German",
+ "fr_FR" => "French",
+ "it_IT" => "Italian",
+ "es_ES" => "Spanish",
+ "en_EN" => "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);
+ $ret[$key] = _($name);
+ }
+ setlocale(LC_ALL, $old_lang);
+ }else{
+ foreach($tmp as $key => $name){
+ $ret[$key] = _($name);
+ }
+ }
+ return($ret);
+}
+
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
?>
index e24e928e034e461dc7495bbfc327e99737c7a7cc..cd87f29ca964a307247d57580f7f76a10b499780 100644 (file)
$smarty->assign("gender_list", $sex);
/* Assign prefered langage */
- $language= array(0 => " ", "fr_FR" => ("fr_FR"), "en_EN" => ("en_EN"),
- "de_DE" => ("de_DE"), "it_IT" => ("it_IT"),
- "nl_NL" => ("nl_NL"), "ru_RU" => ("ru_RU"),
- "zh_CN" => ("zh_CN"), "pl_PL" => ("pl_PL"),
- "sv_SE" => ("sv_SE"), "es_ES" => ("es_ES"));
+
+
+ $language= array_merge(array(0 => " ") ,get_languages());
$smarty->assign("preferredLanguage_list", $language);
/* Get random number for pictures */
index e5beae6cc741ace293ea5aaf4c73d470d6ae6146..e1b5e72ab61c11b2487740b8afb5063b924d967f 100644 (file)
function execute()
{
- $this->languages = array("" => _("Automatic"),
- "de_DE" => _("German"),
- "fr_FR" => _("French"),
- "it_IT" => _("Italian"),
- "es_ES" => _("Spanish"),
- "en_EN" => _("English"),
- "nl_NL" => _("Dutch"),
- "pl_PL" => _("Polish"),
- "sv_SE" => _("Swedish"),
- "zh_CN" => _("Chinese"),
- "ru_RU" => _("Russian"));
+ $this->languages = array_merge(array("" => _("Automatic")),get_languages(TRUE));
asort($this->languages);
$smarty = get_smarty();
$smarty->assign("languages", $this->languages);