From 234c71ca8187dede91785d595f66f70fea8efbe9 Mon Sep 17 00:00:00 2001 From: Stanislav Levin Date: Fri, 21 Sep 2018 11:37:01 +0300 Subject: [PATCH] Drop concatenated title of 'add' dialog As for now the default title of 'add' dialog is set to something like 'Add ${entity}', where 'entity' is also translatable text. Such construction is used via method 'adder_dialog' of Entity for the all 'Add' actions. This leads to a bad quality translation and should be changed to an entire sentence. From now a mentioned title is taken from a spec and should be specified explicitly. Fixes: https://pagure.io/freeipa/issue/7707 Reviewed-By: Serhii Tsymbaliuk --- install/ui/src/freeipa/entity.js | 6 +----- ipaserver/plugins/internal.py | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/install/ui/src/freeipa/entity.js b/install/ui/src/freeipa/entity.js index 61698e859..a7901df93 100644 --- a/install/ui/src/freeipa/entity.js +++ b/install/ui/src/freeipa/entity.js @@ -709,11 +709,7 @@ exp.entity_builder = IPA.entity_builder = function(entity) { spec.$factory = spec.$factory || IPA.entity_adder_dialog; spec.name = spec.name || 'add'; - if (!spec.title) { - var title = text.get('@i18n:dialogs.add_title'); - var label = entity.metadata.label_singular; - spec.title = title.replace('${entity}', label); - } + spec.title = spec.title || text.get('@i18n:dialogs.add_title_default'); return that.dialog(spec); }; diff --git a/ipaserver/plugins/internal.py b/ipaserver/plugins/internal.py index 7007c1073..fd62192cb 100644 --- a/ipaserver/plugins/internal.py +++ b/ipaserver/plugins/internal.py @@ -264,7 +264,7 @@ class i18n_messages(Command): "dialogs": { "add_confirmation": _("${entity} successfully added"), "add_custom_value": _("Add custom value"), - "add_title": _("Add ${entity}"), + "add_title_default": _("Add"), "available": _("Available"), "batch_error_message": _("Some operations failed."), "batch_error_title": _("Operations Error"),