rtl/ltr setting in language files

This commit is contained in:
Hannes Mannerheim 2015-06-18 14:24:37 +02:00
parent a495d8e448
commit ddf7347f5d
23 changed files with 43 additions and 9 deletions

View File

@ -242,17 +242,30 @@ class QvitterAction extends ApiAction
// scan all files in the locale directory and create a json object with their change date added
$available_languages = array_diff(scandir(QVITTERDIR.'/locale'), array('..', '.'));
foreach($available_languages as $lan) {
foreach($available_languages as $lankey=>$lan) {
$lancode = substr($lan,0,strpos($lan,'.'));
print "\n".' "'.$lancode.'": "'.$lan.'?changed='.date('YmdHis',filemtime(QVITTERDIR.'/locale/'.$lan)).'",';
// also make an array with all language names, to use for generating menu
$languagecodesandnames[$lancode]['english_name'] = Locale::getDisplayLanguage($lancode, 'en');
$languagecodesandnames[$lancode]['name'] = Locale::getDisplayLanguage($lancode, $lancode);
if(Locale::getDisplayRegion($lancode, $lancode)) {
$languagecodesandnames[$lancode]['name'] .= ' ('.Locale::getDisplayRegion($lancode, $lancode).')';
}
if($lancode == 'es_ahorita') { $languagecodesandnames[$lancode]['name'] = 'español (ahorita)'; } // joke
// ahorita meme only on quitter.es
if($lancode == 'es_ahorita') {
if($siterootdomain == 'quitter.es') {
$languagecodesandnames[$lancode]['name'] = 'español (ahorita)';
}
else {
unset($available_languages[$lankey]);
unset($languagecodesandnames[$lancode]);
continue;
}
}
print "\n".' "'.$lancode.'": "'.$lan.'?changed='.date('YmdHis',filemtime(QVITTERDIR.'/locale/'.$lan)).'",';
}
?>

View File

@ -333,11 +333,6 @@ $(window).load(function() {
window.selectedLanguage = 'en';
}
// if this is a RTL-language, add rtl class to body
if(window.selectedLanguage == 'ar'
|| window.selectedLanguage == 'fa') {
$('body').addClass('rtl');
}
// if we already have this version of this language in localstorage, we
// use that cached version. we do this because $.ajax doesn't respect caching, it seems
@ -367,6 +362,11 @@ $(window).load(function() {
function proceedToSetLanguageAndLogin(data){
window.sL = data;
// if this is a RTL-language, add rtl class to body
if(window.sL.directionality == 'rtl') {
$('body').addClass('rtl');
}
window.siteTitle = $('head title').html(); // remember this for later use

View File

@ -1,4 +1,5 @@
{
"directionality":"rtl",
"languageName": "العربيّة",
"loginUsername": "اسم المستخدم أو البريد الإلكترونيّ",
"loginPassword": "كلمة المرور",

View File

@ -1,4 +1,5 @@
{
"directionality":"ltr",
"languageName": "Asturianu",
"loginUsername": "Nome d'usuariu o corréu-e",
"loginPassword": "Contraseña",

View File

@ -1,4 +1,5 @@
{
"directionality":"ltr",
"languageName": "Català",
"loginUsername": "Nom d'usuari o correu electrònic",
"loginPassword": "Contrasenya",

View File

@ -1,4 +1,5 @@
{
"directionality":"ltr",
"languageName": "Deutsch",
"loginUsername": "Benutzername oder E-Mail",
"loginPassword": "Passwort",

View File

@ -1,4 +1,5 @@
{
"directionality":"ltr",
"languageName": "English",
"loginUsername": "Username or e-mail",
"loginPassword": "Password",

View File

@ -1,4 +1,5 @@
{
"directionality":"ltr",
"languageName": "Esperanto",
"loginUsername": "Uzantnomo aŭ retpoŝtadreso",
"loginPassword": "Pasvorto",

View File

@ -1,4 +1,5 @@
{
"directionality":"ltr",
"languageName": "Español",
"loginUsername": "Nombre de usuario o correo electrónico",
"loginPassword": "Contraseña",

View File

@ -1,4 +1,5 @@
{
"directionality":"ltr",
"languageName": "Español (ahorita)",
"loginUsername": "Nombre de usuario o correo electrónico",
"loginPassword": "Contraseña",

View File

@ -1,4 +1,5 @@
{
"directionality":"ltr",
"languageName": "Euskara",
"loginUsername": "Erabiltzaile edo emaila",
"loginPassword": "Pasahitza",

View File

@ -1,4 +1,5 @@
{
"directionality":"rtl",
"languageName": "فارسی",
"loginUsername": "شناسه یا ایمیل",
"loginPassword": "گذرواژه - رمز عبور",

View File

@ -1,4 +1,5 @@
{
"directionality":"ltr",
"languageName": "Suomi",
"loginUsername": "Käyttäjänimi tai sähköposti",
"loginPassword": "Salasana",

View File

@ -1,4 +1,5 @@
{
"directionality":"ltr",
"languageName": "Français",
"loginUsername": "Nom d'utilisateur ou e-mail",
"loginPassword": "Mot de passe",

View File

@ -1,4 +1,5 @@
{
"directionality":"ltr",
"languageName": "Galego",
"loginUsername": "Nome de usuario ou enderezo electrónico",
"loginPassword": "Contrasinal",

View File

@ -1,4 +1,5 @@
{
"directionality":"rtl",
"languageName": "עברית",
"loginUsername": "שם משתמש או דוא״ל",
"loginPassword": "סיסמה",

View File

@ -1,4 +1,5 @@
{
"directionality":"ltr",
"languageName": "Ido",
"loginUsername": "Uzantonomo od e-adreso",
"loginPassword": "Pasovorto",

View File

@ -1,4 +1,5 @@
{
"directionality":"ltr",
"languageName": "Italiano",
"loginUsername": "Nome Utente o indirizzo email",
"loginPassword": "Password",

View File

@ -1,4 +1,5 @@
{
"directionality":"ltr",
"languageName": "Norsk",
"loginUsername": "Brukernavn eller e-Post",
"loginPassword": "Passord",

View File

@ -1,4 +1,5 @@
{
"directionality":"ltr",
"languageName": "Português-Brasil",
"loginUsername": "Nome de usuário ou e-mail",
"loginPassword": "Senha",

View File

@ -1,4 +1,5 @@
{
"directionality":"ltr",
"languageName": "Svenska",
"loginUsername": "Användarnamn eller mejladress",
"loginPassword": "Lösenord",

View File

@ -1,4 +1,5 @@
{
"directionality":"ltr",
"languageName": "简体中文",
"loginUsername": "用户名或邮件地址",
"loginPassword": "密码",

View File

@ -1,4 +1,5 @@
{
"directionality":"ltr",
"languageName": "繁體中文",
"loginUsername": "使用者名稱或電子郵件",
"loginPassword": "密碼",