Bugzilla – Attachment 159124 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-operations-to-a.patch (text/plain), 4.18 KB, created by
David Nind
on 2023-11-19 20:52:40 UTC
(
hide
)
Description:
Bug 31694: (follow-up) Use values for operations to avoid translation issues
Filename:
MIME Type:
Creator:
David Nind
Created:
2023-11-19 20:52:40 UTC
Size:
4.18 KB
patch
obsolete
>From c937e041687403012954a73d5c82ed52fc08ad42 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 operations 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 the patch it appears correctly (e.g. Outrepasser) > >Signed-off-by: David Nind <david@davidnind.com> >--- > .../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 7a6064a135..d7615eb43b 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 >@@ -263,10 +263,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-can"></i> Delete</a> > <a href="?op=edit&id=[% rule.id | uri %]" title="Edit" class="btn btn-default btn-xs"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit</a> >@@ -430,13 +430,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()); > } >@@ -456,10 +449,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.30.2
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