[i18n] Use named variables in app category translations

This commit is contained in:
Jérôme Lebleu 2016-02-05 11:38:34 +01:00
parent 28f5df2eeb
commit 94f81cc655
2 changed files with 16 additions and 13 deletions

View file

@ -16,15 +16,15 @@
"appslist_removed" : "Apps list successfully removed",
"app_unknown" : "Unknown app",
"app_no_upgrade" : "No app to upgrade",
"app_not_installed" : "{:s} is not installed",
"app_not_installed" : "{app:s} is not installed",
"app_not_correctly_installed" : "{app:s} seems to be not correctly installed",
"custom_app_url_required" : "You must provide an URL to upgrade your custom app {:s}",
"app_recent_version_required" : "{:s} requires a more recent version of the moulinette",
"app_upgraded" : "{:s} successfully upgraded",
"app_recent_version_required" : "{app:s} requires a more recent version of YunoHost",
"app_upgraded" : "{app:s} successfully upgraded",
"app_upgrade_failed" : "Unable to upgrade all apps",
"app_id_invalid" : "Invalid app id",
"app_already_installed" : "{:s} is already installed",
"app_removed" : "{:s} successfully removed",
"app_removed" : "{app:s} successfully removed",
"app_location_already_used" : "An app is already installed on this location",
"app_location_install_failed" : "Unable to install the app on this location",
"app_extraction_failed" : "Unable to extract installation files",

View file

@ -215,7 +215,7 @@ def app_info(app, show_status=False, raw=False):
"""
if not _is_installed(app):
raise MoulinetteError(errno.EINVAL,
m18n.n('app_not_installed', app))
m18n.n('app_not_installed', app=app))
if raw:
ret = app_list(filter=app, raw=True)[app]
ret['settings'] = _get_app_settings(app)
@ -258,7 +258,7 @@ def app_map(app=None, raw=False, user=None):
if app is not None:
if not _is_installed(app):
raise MoulinetteError(errno.EINVAL,
m18n.n('app_not_installed', app))
m18n.n('app_not_installed', app=app))
apps = [app,]
else:
apps = os.listdir(apps_setting_path)
@ -323,7 +323,7 @@ def app_upgrade(auth, app=[], url=None, file=None):
installed = _is_installed(app_id)
if not installed:
raise MoulinetteError(errno.ENOPKG,
m18n.n('app_not_installed', app_id))
m18n.n('app_not_installed', app=app_id))
if app_id in upgraded_apps:
continue
@ -351,7 +351,8 @@ def app_upgrade(auth, app=[], url=None, file=None):
if 'min_version' in manifest \
and not has_min_version(manifest['min_version']):
raise MoulinetteError(errno.EPERM,
m18n.n('app_recent_version_required', app_id))
m18n.n('app_recent_version_required',
app=app_id))
app_setting_path = apps_setting_path +'/'+ app_id
@ -390,7 +391,7 @@ def app_upgrade(auth, app=[], url=None, file=None):
# So much win
upgraded_apps.append(app_id)
msignals.display(m18n.n('app_upgraded', app_id), 'success')
msignals.display(m18n.n('app_upgraded', app=app_id), 'success')
if not upgraded_apps:
raise MoulinetteError(errno.ENODATA, m18n.n('app_no_upgrade'))
@ -440,7 +441,8 @@ def app_install(auth, app, label=None, args=None):
if 'min_version' in manifest \
and not has_min_version(manifest['min_version']):
raise MoulinetteError(errno.EPERM,
m18n.n('app_recent_version_required', app_id))
m18n.n('app_recent_version_required',
app=app_id))
# Check if app can be forked
instance_number = _installed_instance_number(app_id, last=True) + 1
@ -535,7 +537,8 @@ def app_remove(auth, app):
from yunohost.hook import hook_exec, hook_remove
if not _is_installed(app):
raise MoulinetteError(errno.EINVAL, m18n.n('app_not_installed', app))
raise MoulinetteError(errno.EINVAL,
m18n.n('app_not_installed', app=app))
app_setting_path = apps_setting_path + app
@ -551,7 +554,7 @@ def app_remove(auth, app):
args_list = [app]
if hook_exec('/tmp/yunohost_remove/scripts/remove', args_list) == 0:
msignals.display(m18n.n('app_removed', app), 'success')
msignals.display(m18n.n('app_removed', app=app), 'success')
if os.path.exists(app_setting_path): shutil.rmtree(app_setting_path)
shutil.rmtree('/tmp/yunohost_remove')
@ -1004,7 +1007,7 @@ def _get_app_settings(app_id):
"""
if not _is_installed(app_id):
raise MoulinetteError(errno.EINVAL,
m18n.n('app_not_installed', app_id))
m18n.n('app_not_installed', app=app_id))
try:
with open(os.path.join(
apps_setting_path, app_id, 'settings.yml')) as f: