From c5064775513e098aca7b01d28e3eae0cefeee2a4 Mon Sep 17 00:00:00 2001 From: ljf Date: Thu, 14 Oct 2021 12:03:26 +0200 Subject: [PATCH] [fix] i18n keys --- locales/en.json | 2 +- src/yunohost/domain.py | 2 +- src/yunohost/tests/test_user-group.py | 2 +- src/yunohost/utils/config.py | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/locales/en.json b/locales/en.json index 53b0a7e83..2c9652b9c 100644 --- a/locales/en.json +++ b/locales/en.json @@ -312,7 +312,7 @@ "domain_dyndns_root_unknown": "Unknown DynDNS root domain", "domain_exists": "The domain already exists", "domain_hostname_failed": "Unable to set new hostname. This might cause an issue later (it might be fine).", - "domain_name_unknown": "Domain '{domain}' unknown", + "domain_unknown": "Domain '{domain}' unknown", "domain_remove_confirm_apps_removal": "Removing this domain will remove those applications:\n{apps}\n\nAre you sure you want to do that? [{answers}]", "domain_uninstall_app_first": "Those applications are still installed on your domain:\n{apps}\n\nPlease uninstall them using 'yunohost app remove the_app_id' or move them to another domain using 'yunohost app change-url the_app_id' before proceeding to domain removal", "domain_registrar_is_not_configured": "The registrar is not yet configured for domain {domain}.", diff --git a/src/yunohost/domain.py b/src/yunohost/domain.py index 4729b0a1d..acb0f0168 100644 --- a/src/yunohost/domain.py +++ b/src/yunohost/domain.py @@ -102,7 +102,7 @@ def domain_list(exclude_subdomains=False): def _assert_domain_exists(domain): if domain not in domain_list()["domains"]: - raise YunohostValidationError("domain_name_unknown", domain=domain) + raise YunohostValidationError("domain_unknown", domain=domain) def _list_subdomains_of(parent_domain): diff --git a/src/yunohost/tests/test_user-group.py b/src/yunohost/tests/test_user-group.py index 60e748108..d65366a9a 100644 --- a/src/yunohost/tests/test_user-group.py +++ b/src/yunohost/tests/test_user-group.py @@ -221,7 +221,7 @@ def test_create_user_already_exists(mocker): def test_create_user_with_domain_that_doesnt_exists(mocker): - with raiseYunohostError(mocker, "domain_name_unknown"): + with raiseYunohostError(mocker, "domain_unknown"): user_create("alice", "Alice", "White", "doesnt.exists", "test123Ynh") diff --git a/src/yunohost/utils/config.py b/src/yunohost/utils/config.py index b19cecf3b..faa2821d1 100644 --- a/src/yunohost/utils/config.py +++ b/src/yunohost/utils/config.py @@ -220,9 +220,9 @@ class ConfigPanel: self.new_values = {} if self.save_path and not creation and not os.path.exists(self.save_path): - raise YunohostError(f"{self.entity_type}_doesnt_exists", name=entity) + raise YunohostError(f"{self.entity_type}_unknown", name=entity) if self.save_path and creation and os.path.exists(self.save_path): - raise YunohostError(f"{self.entity_type}_already_exists", name=entity) + raise YunohostError(f"{self.entity_type}_exists", name=entity) # Search for hooks in the config panel self.hooks = {func: getattr(self, func)