From d4635f0eaab2ba198c2553577b6dd2ce84ef050b Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Thu, 29 Oct 2020 23:49:23 +0100 Subject: [PATCH] Fix i18n key IDs so that translators don't have to retranslate something already translated.. --- locales/en.json | 15 +++++++-------- src/yunohost/utils/legacy.py | 10 +++++----- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/locales/en.json b/locales/en.json index 511f4bfe6..570dbcf18 100644 --- a/locales/en.json +++ b/locales/en.json @@ -420,13 +420,13 @@ "migration_description_0016_php70_to_php73_pools": "Migrate php7.0-fpm 'pool' conf files to php7.3", "migration_description_0017_postgresql_9p6_to_11": "Migrate databases from PostgreSQL 9.6 to 11", "migration_description_0018_xtable_to_nftable": "Migrate old network traffic rules to the new nftable system", - "migration_description_0019_extends_permissions_features_1": "Extend/rework the app permission management system", - "migration_0019_create_group": "Creating a group for each user...", - "migration_0019_LDAP_update_failed": "Unable to update LDAP. Error: {error:s}", - "migration_0019_migrate_permission": "Migrating permissions from apps settings to LDAP...", - "migration_0019_update_LDAP_database": "Updating LDAP database...", - "migration_0019_update_LDAP_schema": "Updating LDAP schema...", - "migration_0019_failed_to_remove_stale_object": "Unable to remove stale object {dn}: {error}", + "migration_description_0019_extend_permissions_features": "Extend/rework the app permission management system", + "migration_0011_create_group": "Creating a group for each user...", + "migration_0011_LDAP_update_failed": "Unable to update LDAP. Error: {error:s}", + "migration_0011_migrate_permission": "Migrating permissions from apps settings to LDAP...", + "migration_0011_update_LDAP_database": "Updating LDAP database...", + "migration_0011_update_LDAP_schema": "Updating LDAP schema...", + "migration_0011_failed_to_remove_stale_object": "Unable to remove stale object {dn}: {error}", "migration_0015_start" : "Starting migration to Buster", "migration_0015_patching_sources_list": "Patching the sources.lists...", "migration_0015_main_upgrade": "Starting main upgrade...", @@ -452,7 +452,6 @@ "migration_0019_migration_failed_trying_to_rollback": "Could not migrate... trying to roll back the system.", "migration_0019_rollback_success": "System rolled back.", "migration_0019_slapd_config_will_be_overwritten": "It looks like you manually edited the slapd configuration. For this critical migration, YunoHost needs to force the update of the slapd configuration. The original files will be backuped in {conf_backup_folder}.", - "migration_0011_update_LDAP_schema": "Updating LDAP schema...", "migrations_already_ran": "Those migrations are already done: {ids}", "migrations_cant_reach_migration_file": "Could not access migrations files at the path '%s'", "migrations_dependencies_not_satisfied": "Run these migrations: '{dependencies_id}', before migration {id}.", diff --git a/src/yunohost/utils/legacy.py b/src/yunohost/utils/legacy.py index fb5893a1b..b21f0f25c 100644 --- a/src/yunohost/utils/legacy.py +++ b/src/yunohost/utils/legacy.py @@ -33,12 +33,12 @@ class SetupGroupPermissions(): try: ldap.remove(dn) except Exception as e: - raise YunohostError("migration_0019_failed_to_remove_stale_object", dn=dn, error=e) + raise YunohostError("migration_0011_failed_to_remove_stale_object", dn=dn, error=e) @staticmethod def migrate_LDAP_db(): - logger.info(m18n.n("migration_0019_update_LDAP_database")) + logger.info(m18n.n("migration_0011_update_LDAP_database")) from yunohost.utils.ldap import _get_ldap_interface ldap = _get_ldap_interface() @@ -64,9 +64,9 @@ class SetupGroupPermissions(): for rdn, attr_dict in ldap_map['depends_children'].items(): ldap.add(rdn, attr_dict) except Exception as e: - raise YunohostError("migration_0019_LDAP_update_failed", error=e) + raise YunohostError("migration_0011_LDAP_update_failed", error=e) - logger.info(m18n.n("migration_0019_create_group")) + logger.info(m18n.n("migration_0011_create_group")) # Create a group for each yunohost user user_list = ldap.search('ou=users,dc=yunohost,dc=org', @@ -81,7 +81,7 @@ class SetupGroupPermissions(): @staticmethod def migrate_app_permission(app=None): - logger.info(m18n.n("migration_0019_migrate_permission")) + logger.info(m18n.n("migration_0011_migrate_permission")) apps = _installed_apps()