From 09750589f572daf816c8facb71e50a0cf5ea294f Mon Sep 17 00:00:00 2001 From: Stanislav Levin Date: Wed, 12 Sep 2018 17:48:44 +0300 Subject: [PATCH] Drop concatenated title of remove dialog As for now the default title of remove dialogs is set to 'Remove ${entity}', where 'entity' is also translatable text. This construction is used via method 'create_remove_dialog' of Search facet for the all association 'Delete' actions of entities. The such concatenation 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/7699 Reviewed-By: Serhii Tsymbaliuk --- install/ui/src/freeipa/search.js | 6 ++---- install/ui/src/freeipa/sudo.js | 4 +--- ipaserver/plugins/internal.py | 5 ++++- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/install/ui/src/freeipa/search.js b/install/ui/src/freeipa/search.js index 42303cbf5..0966403c3 100644 --- a/install/ui/src/freeipa/search.js +++ b/install/ui/src/freeipa/search.js @@ -230,10 +230,8 @@ IPA.search_facet = function(spec, no_init) { dialog.facet = that; dialog.pkey_prefix = that.managed_entity_pkey_prefix(); - title = text.get('@i18n:dialogs.remove_title'); - var label = that.managed_entity.metadata.label; - dialog.title = title.replace('${entity}', label); - + dialog.title = dialog.title || + text.get('@i18n:dialogs.remove_title_default'); dialog.set_values(values); return dialog; diff --git a/install/ui/src/freeipa/sudo.js b/install/ui/src/freeipa/sudo.js index 733e4119c..dd9b7e5e0 100644 --- a/install/ui/src/freeipa/sudo.js +++ b/install/ui/src/freeipa/sudo.js @@ -855,7 +855,6 @@ IPA.sudo.options_section = function(spec) { that.show_remove_dialog = function() { - var label = IPA.get_command_option('sudorule_add_option', 'ipasudoopt').label; var values = that.table.get_selected_values(); if (!values.length) { @@ -866,8 +865,7 @@ IPA.sudo.options_section = function(spec) { var pkey = that.facet.get_pkey(); - var title = text.get('@i18n:dialogs.remove_title'); - title = title.replace('${entity}', label); + var title = text.get('@i18n:objects.sudooptions.remove'); var dialog = IPA.deleter_dialog({ title: title, diff --git a/ipaserver/plugins/internal.py b/ipaserver/plugins/internal.py index 8670d6977..256f04b9a 100644 --- a/ipaserver/plugins/internal.py +++ b/ipaserver/plugins/internal.py @@ -287,7 +287,7 @@ class i18n_messages(Command): "prospective": _("Prospective"), "redirection": _("Redirection"), "remove_empty": _("Select entries to be removed."), - "remove_title": _("Remove ${entity}"), + "remove_title_default": _("Remove"), "result": _("Result"), "show_details": _("Show details"), "success": _("Success"), @@ -866,6 +866,9 @@ class i18n_messages(Command): "specified_users": _("Specified Users and Groups"), "user": _("Who"), }, + "sudooptions": { + "remove": _("Remove sudo options"), + }, "topology": { "autogenerated": _("Autogenerated"), "segment_details": _("Segment details"),