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 <stsymbal@redhat.com>
This commit is contained in:
Stanislav Levin 2018-09-21 11:37:01 +03:00 committed by Serhii Tsymbaliuk
parent 4b60bc3814
commit 234c71ca81
2 changed files with 2 additions and 6 deletions

View File

@ -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);
};

View File

@ -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"),