From 79eb70ec61ae35b7984e57096629a5603b0f5707 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Sat, 10 Mar 2018 16:09:16 +0100 Subject: [PATCH] Use number/name in i18n string to avoid breaking existing translations... --- locales/en.json | 4 ++-- src/yunohost/tools.py | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/locales/en.json b/locales/en.json index b0c2ea3d2..9957c25a0 100644 --- a/locales/en.json +++ b/locales/en.json @@ -228,10 +228,10 @@ "migrations_bad_value_for_target": "Invalid number for target argument, available migrations numbers are 0 or {}", "migrations_cant_reach_migration_file": "Can't access migrations files at path %s", "migrations_current_target": "Migration target is {}", - "migrations_error_failed_to_load_migration": "ERROR: failed to load migration {migration_id}", + "migrations_error_failed_to_load_migration": "ERROR: failed to load migration {number} {name}", "migrations_forward": "Migrating forward", "migrations_list_conflict_pending_done": "You cannot use both --previous and --done at the same time.", - "migrations_loading_migration": "Loading migration {migration_id}...", + "migrations_loading_migration": "Loading migration {number} {name}...", "migrations_migration_has_failed": "Migration {number} {name} has failed with exception {exception}, aborting", "migrations_no_migrations_to_run": "No migrations to run", "migrations_show_currently_running_migration": "Running migration {number} {name}...", diff --git a/src/yunohost/tools.py b/src/yunohost/tools.py index 5e6e3f881..c92f3bda4 100644 --- a/src/yunohost/tools.py +++ b/src/yunohost/tools.py @@ -970,9 +970,10 @@ def _load_migration(migration_file): migration_id = migration_file[:-len(".py")] + number, name = migration_id.split("_", 1) + logger.debug(m18n.n('migrations_loading_migration', - migration_id=migration_id, - )) + number=number, name=name)) try: # this is python builtin method to import a module using a name, we @@ -985,8 +986,7 @@ def _load_migration(migration_file): traceback.print_exc() raise MoulinetteError(errno.EINVAL, m18n.n('migrations_error_failed_to_load_migration', - migration_id=migration_id, - )) + number=number, name=name)) class Migration(object):