[enh] Better multilingual for application views.

This commit is contained in:
opi 2014-06-01 19:26:49 +02:00
parent 344146c8ed
commit 8808a5f327
3 changed files with 22 additions and 14 deletions

View file

@ -713,12 +713,11 @@ app = Sammy('#main', function (sam) {
data.settings.allowed_users = (data.settings.allowed_users) ? data.settings.allowed_users.replace(',', ', ') : '';
// Multilingual description
if (window.navigator && window.navigator.language) {
data.description = (typeof data.manifest.description[window.navigator.language] !== 'indefined') ?
data.manifest.description[window.navigator.language] :
data.manifest.description['en']
;
}
appData.description = (typeof appData.manifest.description[y18n.locale] !== 'indefined') ?
appData.manifest.description[y18n.locale] :
appData.manifest.description['en']
;
c.view('app/app_info', data);
});
@ -752,7 +751,7 @@ app = Sammy('#main', function (sam) {
label: domain,
});
})
appData.manifest.arguments.install[k].help = "<a href='#/domains'>Manage domains</a>";
appData.manifest.arguments.install[k].help = "<a href='#/domains'>"+y18n.t('manage_domains')+"</a>";
}
// Special case for admin input.
@ -764,17 +763,21 @@ app = Sammy('#main', function (sam) {
label: user.fullname+' ('+user.mail+')'
});
})
appData.manifest.arguments.install[k].help = "<a href='#/users'>Manage users</a>";
appData.manifest.arguments.install[k].help = "<a href='#/users'>"+y18n.t('manage_users')+"</a>";
}
// Multilingual description
appData.manifest.arguments.install[k].label = (typeof appData.manifest.arguments.install[k].ask[y18n.locale] !== 'indefined') ?
appData.manifest.arguments.install[k].ask[y18n.locale] :
appData.manifest.arguments.install[k].ask['en']
;
});
// Multilingual description
if (window.navigator && window.navigator.language) {
appData.description = (typeof appData.manifest.description[window.navigator.language] !== 'indefined') ?
appData.manifest.description[window.navigator.language] :
appData.manifest.description['en']
;
}
appData.description = (typeof appData.manifest.description[y18n.locale] !== 'indefined') ?
appData.manifest.description[y18n.locale] :
appData.manifest.description['en']
;
c.view('app/app_install', appData);
});

View file

@ -104,6 +104,8 @@
"app_access_removeall_btn" : "Remove all access",
"app_access_clearall_btn" : "Clear all access",
"multi_instance" : "Multi instance",
"manage_domains" : "Manage domains",
"manage_users" : "Manage users",
"backup" : "Backup",
"backup_warning_title" : "The backup system is not implemented yet.",

View file

@ -104,6 +104,9 @@
"app_access_removeall_btn" : "Supprimer tous les accès",
"app_access_clearall_btn" : "Effacer toutes les règles accès",
"multi_instance" : "Multi instance",
"manage_domains" : "Gerer les domaines",
"manage_users" : "Gerer les utilisateurs",
"backup" : "Sauvegarde",
"backup_warning_title" : "Le système de sauvegarde n'est pas encore implémenté.",