Bugzilla – Attachment 149601 Details for
Bug 31694
MARC overlay rules presets don't change anything if presets are translated
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31694: (follow-up) Use values for operations to avoid translation issues
Bug-31694-follow-up-Use-values-for-operation-to-av.patch (text/plain), 4.10 KB, created by
Kevin Carnes
on 2023-04-13 13:34:40 UTC
(
hide
)
Description:
Bug 31694: (follow-up) Use values for operations to avoid translation issues
Filename:
MIME Type:
Creator:
Kevin Carnes
Created:
2023-04-13 13:34:40 UTC
Size:
4.10 KB
patch
obsolete
>From aca2424b3ba7664fa86fa3257c6cf5c13857d027 Mon Sep 17 00:00:00 2001 >From: Kevin Carnes <kevin.carnes@ub.lu.se> >Date: Thu, 13 Apr 2023 15:20:02 +0200 >Subject: [PATCH] Bug 31694: (follow-up) Use values for operation to avoid > translation issues >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > > To test: > * Try adding a preset rule that has an operation with different translations > for the column and the pull down (e.g. Outrepasser for fr-CA) > * Without the patch it appears as Custom (e.g. Personnalisé) > * With then patch it appears correctly (e.g. Outrepasser) >--- > .../en/modules/admin/marc-overlay-rules.tt | 19 ++++++------------- > 1 file changed, 6 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 58f1150067..f4a75f399d 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 >@@ -262,10 +262,10 @@ > </td> > <td>[% rule.tag | html %]</td> > <td class="rule-preset"></td> >- <td class="rule-operation-action" data-operation="add">[% IF rule.add %]Add[% ELSE %]Skip[% END %]</td> >- <td class="rule-operation-action" data-operation="append">[% IF rule.append %]Append[% ELSE %]Skip[% END %]</td> >- <td class="rule-operation-action" data-operation="remove">[% IF rule.remove %]Remove[% ELSE %]Skip[% END %]</td> >- <td class="rule-operation-action" data-operation="delete">[% IF rule.delete %]Delete[% ELSE %]Skip[% END %]</td> >+ <td class="rule-operation-action" data-operation="add" data-value="[% rule.add %]">[% IF rule.add %]Add[% ELSE %]Skip[% END %]</td> >+ <td class="rule-operation-action" data-operation="append" data-value="[% rule.append %]">[% IF rule.append %]Append[% ELSE %]Skip[% END %]</td> >+ <td class="rule-operation-action" data-operation="remove" data-value="[% rule.remove %]">[% IF rule.remove %]Remove[% ELSE %]Skip[% END %]</td> >+ <td class="rule-operation-action" data-operation="delete" data-value="[% rule.delete %]">[% IF rule.delete %]Delete[% ELSE %]Skip[% END %]</td> > <td class="actions"> > <a href="?op=remove&id=[% rule.id | uri %]" title="Delete" class="btn btn-default btn-xs"><i class="fa fa-trash"></i> Delete</a> > <a href="?op=edit&id=[% rule.id | uri %]" title="Edit" class="btn btn-default btn-xs"><i class="fa fa-pencil"></i> Edit</a> >@@ -429,13 +429,6 @@ > 'delete': 0 > }; > >- 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; >- > function hash_config(config) { > return JSON.stringify(config, Object.keys(config).sort()); > } >@@ -455,10 +448,10 @@ > var operations_config = {}; > $('.rule-operation-action', $this).each(function() { > var $operation = $(this); >- operations_config[$operation.data('operation')] = overlay_rules_label_to_value[$operation.text()]; >+ operations_config[$operation.data('operation')] = $operation.data('value'); > }); > $('.rule-preset', $this).text( >- $('option[value="' + operations_config_overlay_rule_preset(operations_config) + '"]').text() || _("Custom") >+ $('select[name="preset"] option[value="' + operations_config_overlay_rule_preset(operations_config) + '"]').text() > ); > }); > >-- >2.25.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 31694
:
141401
|
142579
|
142580
|
142598
|
144407
|
144408
|
144409
|
149601
|
149602
|
155123
|
155124
|
155125
|
155126
|
159121
|
159122
|
159123
|
159124
|
159192
|
159250
|
159251
|
159252
|
159253
|
160194
|
160195
|
160196
|
160197
|
160198