From d9a25e4d324134fb910d4e1ac2068875ea3f3abd Mon Sep 17 00:00:00 2001 From: Katrin Fischer Date: Mon, 24 Oct 2022 22:40:28 +0000 Subject: [PATCH] Bug 31694: (follow-up) Further improve translatability To test: * Add rules fo different modules and with different settings * Verify the saved module description for a saved rule matches the pull down * Verify the saved filter matches the pull downs (especially for source and patron category) Also: * Renames 'User category' to 'Patron category' * Remove some values from translations, that shouldn't be translated, like value attributs for options. Signed-off-by: David Nind --- .../en/modules/admin/marc-overlay-rules.tt | 54 ++++++++++++++----- 1 file changed, 41 insertions(+), 13 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc-overlay-rules.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc-overlay-rules.tt index 64ec9b5943..a1ae41be9c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc-overlay-rules.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc-overlay-rules.tt @@ -3,6 +3,7 @@ [% USE Asset %] [% USE Koha %] [% USE KohaSpan %] +[% USE Categories %] [% PROCESS 'i18n.inc' %] [% PROCESS 'i18n.inc' %] [% SET footerjs = 1 %] @@ -99,7 +100,7 @@ @@ -231,8 +232,35 @@ [% ELSE %] [% rule.id | html %] - [% rule.module | html %] - [% rule.filter | html %] + + [% SWITCH rule.module %] + [% CASE 'source' %]Source + [% CASE 'categorycode' %]Patron category + [% CASE 'userid' %]Username + [% CASE %][% rule.module | html %] + [% END %] + + + [% IF rule.module == "source" %] + [% SWITCH rule.filter %] + [% CASE 'batchmod' %]Batch record modification + [% CASE 'intranet' %]Staff interface MARC editor + [% CASE 'batchimport' %]Staged MARC import + [% CASE 'z3950' %]Z39.50 + [% CASE 'bulkmarkimport' %]bulkmarkimport.pl + [% CASE 'import_lexile' %]import_lexile.pl + [% CASE %][% rule.filter | html %] + [% END %] + [% ELSIF rule.module == "categorycode" %] + [% IF rule.filter != "*" %] + [% Categories.GetName( rule.filter ) | html %] + [% ELSE %] + [% rule.filter %] + [% END %] + [% ELSE %] + [% rule.filter | html %] + [% END %] + [% rule.tag | html %] [% IF rule.add %]Add[% ELSE %]Skip[% END %] @@ -371,31 +399,31 @@ })); var overlay_rules_presets = {}; - overlay_rules_presets[_("protect")] = { + overlay_rules_presets["protect"] = { 'add': 0, 'append': 0, 'remove': 0, 'delete': 0 }; - overlay_rules_presets[_("overwrite")] = { + overlay_rules_presets["overwrite"] = { 'add': 1, 'append': 1, 'remove': 1, 'delete': 1 }; - overlay_rules_presets[_("add")] = { + overlay_rules_presets["add"] = { 'add': 1, 'append': 0, 'remove': 0, 'delete': 0 }; - overlay_rules_presets[_("addappend")] = { + overlay_rules_presets["addappend"] = { 'add': 1, 'append': 1, 'remove': 0, 'delete': 0 }; - overlay_rules_presets[_("protectfromdeletion")] = { + overlay_rules_presets["protectfromdeletion"] = { 'add': 1, 'append': 1, 'remove': 1, @@ -403,11 +431,11 @@ }; var overlay_rules_label_to_value = {}; - overlay_rules_label_to_value[_("Add")] = 1; - overlay_rules_label_to_value[_("Append")] = 1; - overlay_rules_label_to_value[_("Remove")] = 1; - overlay_rules_label_to_value[_("Delete")] = 1; - overlay_rules_label_to_value[_("Skip")] = 0; + overlay_rules_label_to_value["add"] = 1; + overlay_rules_label_to_value["append"] = 1; + overlay_rules_label_to_value["remove"] = 1; + overlay_rules_label_to_value["delete"] = 1; + overlay_rules_label_to_value["skip"] = 0; function hash_config(config) { return JSON.stringify(config, Object.keys(config).sort()); -- 2.30.2