summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan-Christoph Borchardt <hey@jancborchardt.net>2013-02-15 03:21:49 -0800
committerJan-Christoph Borchardt <hey@jancborchardt.net>2013-02-15 03:21:49 -0800
commit8b09fbc150d92c65194cc9a5a9bca4678d53fca3 (patch)
tree81597014bd409d2dcd29ab709b9270153fa2e1d9
parent6cee4c43ad63062e81230fe8c0bcfc59b77dc5c9 (diff)
parentd2f34183a6c479aa4724598234a3dfcd3ed0eb1e (diff)
downloadnextcloud-server-8b09fbc150d92c65194cc9a5a9bca4678d53fca3.tar.gz
nextcloud-server-8b09fbc150d92c65194cc9a5a9bca4678d53fca3.zip
Merge pull request #1700 from owncloud/fixing-1680-master
Fixing 1680 master
-rw-r--r--lib/l10n.php2
-rw-r--r--settings/languageCodes.php13
-rw-r--r--settings/personal.php28
3 files changed, 32 insertions, 11 deletions
diff --git a/lib/l10n.php b/lib/l10n.php
index e272bcd79f3..1e07a9b9557 100644
--- a/lib/l10n.php
+++ b/lib/l10n.php
@@ -343,7 +343,7 @@ class OC_L10N{
if(is_dir($dir)) {
$files=scandir($dir);
foreach($files as $file) {
- if(substr($file, -4, 4) == '.php') {
+ if(substr($file, -4, 4) === '.php' && substr($file, 0, 4) !== 'l10n') {
$i = substr($file, 0, -4);
$available[] = $i;
}
diff --git a/settings/languageCodes.php b/settings/languageCodes.php
index 71655800856..2939461f341 100644
--- a/settings/languageCodes.php
+++ b/settings/languageCodes.php
@@ -50,6 +50,17 @@ return array(
'lv'=>'Latviešu',
'mk'=>'македонски',
'uk'=>'Українська',
-'vi'=>'tiếng việt',
+'vi'=>'Tiếng Việt',
'zh_TW'=>'臺灣話',
+'af_ZA'=> 'Afrikaans',
+'bn_BD'=>'Bengali',
+'ta_LK'=>'தமிழ்',
+'zh_HK'=>'Chinese (Hong Kong)',
+'oc'=>'Occitan (post 1500)',
+'is'=>'Icelandic',
+'pl_PL'=>'Polski',
+'ka_GE'=>'Georgian for Georgia',
+'ku_IQ'=>'Kurdish Iraq',
+'ru_RU'=>'Русский язык',
+'si_LK'=>'Sinhala'
);
diff --git a/settings/personal.php b/settings/personal.php
index c2df8db1ccc..9bbc66c9b7f 100644
--- a/settings/personal.php
+++ b/settings/personal.php
@@ -19,26 +19,36 @@ $storageInfo=OC_Helper::getStorageInfo();
$email=OC_Preferences::getValue(OC_User::getUser(), 'settings', 'email', '');
-$lang=OC_Preferences::getValue( OC_User::getUser(), 'core', 'lang', OC_L10N::findLanguage() );
+$userLang=OC_Preferences::getValue( OC_User::getUser(), 'core', 'lang', OC_L10N::findLanguage() );
$languageCodes=OC_L10N::findAvailableLanguages();
-sort ($languageCodes);
-
-//put the current language in the front
-unset($languageCodes[array_search($lang, $languageCodes)]);
-array_unshift($languageCodes, $lang);
$languageNames=include 'languageCodes.php';
$languages=array();
foreach($languageCodes as $lang) {
$l=OC_L10N::get('settings', $lang);
if(substr($l->t('__language_name__'), 0, 1)!='_') {//first check if the language name is in the translation file
- $languages[]=array('code'=>$lang, 'name'=>$l->t('__language_name__'));
+ $ln=array('code'=>$lang, 'name'=> (string)$l->t('__language_name__'));
}elseif(isset($languageNames[$lang])) {
- $languages[]=array('code'=>$lang, 'name'=>$languageNames[$lang]);
+ $ln=array('code'=>$lang, 'name'=>$languageNames[$lang]);
}else{//fallback to language code
- $languages[]=array('code'=>$lang, 'name'=>$lang);
+ $ln=array('code'=>$lang, 'name'=>$lang);
+ }
+
+ if ($lang === $userLang) {
+ $userLang = $ln;
+ } else {
+ $languages[]=$ln;
}
}
+
+// sort now by displayed language not the iso-code
+usort( $languages, function ($a, $b) {
+ return strcmp($a['name'], $b['name']);
+});
+
+//put the current language in the front
+array_unshift($languages, $userLang);
+
//links to clients
$clients = array(
'desktop' => OC_Config::getValue('customclient_desktop', 'http://owncloud.org/sync-clients/'),