From 171c6a01d8a7be0960fe76cd9a6bd67f41506f2e Mon Sep 17 00:00:00 2001 From: Stanislav Levin Date: Tue, 25 Sep 2018 10:44:47 +0300 Subject: [PATCH] Drop concatenated title of add dialog for association_table widget As for now the default title of add dialogs, which are initialized from 'association_table' widget, is set to something like 'Add ${other_entity} into ${entity} ${primary_key}', where 'other_entity' and 'entity' are also translatable texts. This construction is used via method 'create_add_dialog' of 'association_table' widget for the all 'Add' actions within details of entities. 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/7712 Fixes: https://pagure.io/freeipa/issue/7714 Reviewed-By: Serhii Tsymbaliuk --- install/ui/src/freeipa/association.js | 6 +----- install/ui/src/freeipa/rule.js | 4 ---- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/install/ui/src/freeipa/association.js b/install/ui/src/freeipa/association.js index 6d8edc2c0..8038e2d41 100644 --- a/install/ui/src/freeipa/association.js +++ b/install/ui/src/freeipa/association.js @@ -184,7 +184,7 @@ IPA.attribute_adder_dialog = function(spec) { required: true } ]; - spec.title = spec.title || text.get('@i18n:dialogs.add_title').replace('${entity}', metadata.label); + spec.title = spec.title || text.get('@i18n:dialogs.add_title_default'); spec.subject = metadata.label; var that = IPA.entity_adder_dialog(spec); @@ -638,14 +638,10 @@ IPA.association_table_widget = function (spec) { that.create_add_dialog = function() { - var entity_label = that.entity.metadata.label_singular; var pkey = that.facet.get_pkey(); - var other_entity_label = that.other_entity.metadata.label; var title = that.add_title; - title = title.replace('${entity}', entity_label); title = title.replace('${primary_key}', pkey); - title = title.replace('${other_entity}', other_entity_label); return IPA.association_adder_dialog({ title: title, diff --git a/install/ui/src/freeipa/rule.js b/install/ui/src/freeipa/rule.js index 0f39d434f..7c7e6f1c1 100644 --- a/install/ui/src/freeipa/rule.js +++ b/install/ui/src/freeipa/rule.js @@ -153,14 +153,10 @@ IPA.rule_association_table_widget = function(spec) { that.create_add_dialog = function() { - var entity_label = that.entity.metadata.label_singular; var pkey = that.facet.get_pkey(); - var other_entity_label = that.other_entity.metadata.label; var title = that.add_title; - title = title.replace('${entity}', entity_label); title = title.replace('${primary_key}', pkey); - title = title.replace('${other_entity}', other_entity_label); var exclude = that.values; if (that.external) {