Bug 31694 - MARC overlay rules presets don't change anything if presets are translated
Summary: MARC overlay rules presets don't change anything if presets are translated
Status: Pushed to stable
Alias: None
Product: Koha
Classification: Unclassified
Component: System Administration (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Shi Yao Wang
QA Contact: Julian Maurice
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-10-05 19:30 UTC by Caroline Cyr La Rose
Modified: 2024-01-12 21:56 UTC (History)
9 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
24.05.00,23.11.02,23.05.08


Attachments
Bug 31694: MARC overlay rules presets don't change anything if presets are translated (5.16 KB, patch)
2022-10-05 20:04 UTC, Caroline Cyr La Rose
Details | Diff | Splinter Review
Bug 31694: MARC overlay rules presets don't change anything if presets are translated (5.16 KB, patch)
2022-10-24 22:44 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 31694: (follow-up) Further improve translatability (6.38 KB, patch)
2022-10-24 22:44 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 31694: (follow-up) Further improve translatability (6.38 KB, patch)
2022-10-25 06:07 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 31694: MARC overlay rules presets don't change anything if presets are translated (2.11 KB, patch)
2022-12-02 19:53 UTC, Shi Yao Wang
Details | Diff | Splinter Review
Bug 31694: (follow-up) Fix preset display issue (1.85 KB, patch)
2022-12-02 21:11 UTC, Shi Yao Wang
Details | Diff | Splinter Review
wrong preset caused by different fr-CA translation (43.07 KB, image/png)
2022-12-02 21:25 UTC, Shi Yao Wang
Details
Bug 31694: (follow-up) Use values for operations to avoid translation issues (4.10 KB, patch)
2023-04-13 13:34 UTC, Kevin Carnes
Details | Diff | Splinter Review
Bug 31694: (follow-up) Use values for operations to avoid translation issues (4.10 KB, patch)
2023-04-13 13:37 UTC, Kevin Carnes
Details | Diff | Splinter Review
Bug 31694: MARC overlay rules presets don't change anything if presets are translated (5.16 KB, patch)
2023-09-01 14:37 UTC, Shi Yao Wang
Details | Diff | Splinter Review
Bug 31694: (follow-up) Further improve translatability (6.31 KB, patch)
2023-09-01 14:37 UTC, Shi Yao Wang
Details | Diff | Splinter Review
Bug 31694: (follow-up) Fix preset display issue (1.85 KB, patch)
2023-09-01 14:37 UTC, Shi Yao Wang
Details | Diff | Splinter Review
Bug 31694: (follow-up) Use values for operations to avoid translation issues (4.13 KB, patch)
2023-09-01 14:37 UTC, Shi Yao Wang
Details | Diff | Splinter Review
Bug 31694: MARC overlay rules presets don't change anything if presets are translated (5.20 KB, patch)
2023-11-19 20:52 UTC, David Nind
Details | Diff | Splinter Review
Bug 31694: (follow-up) Further improve translatability (6.36 KB, patch)
2023-11-19 20:52 UTC, David Nind
Details | Diff | Splinter Review
Bug 31694: (follow-up) Fix preset display issue (1.90 KB, patch)
2023-11-19 20:52 UTC, David Nind
Details | Diff | Splinter Review
Bug 31694: (follow-up) Use values for operations to avoid translation issues (4.18 KB, patch)
2023-11-19 20:52 UTC, David Nind
Details | Diff | Splinter Review
Bug 31694: (follow-up) Use values for operations to avoid translation issues (4.22 KB, patch)
2023-11-22 13:39 UTC, Jan Kissig
Details | Diff | Splinter Review
Bug 31694: MARC overlay rules presets don't change anything if presets are translated (5.25 KB, patch)
2023-11-25 21:41 UTC, Jan Kissig
Details | Diff | Splinter Review
Bug 31694: (follow-up) Further improve translatability (6.41 KB, patch)
2023-11-25 21:41 UTC, Jan Kissig
Details | Diff | Splinter Review
Bug 31694: (follow-up) Fix preset display issue (1.95 KB, patch)
2023-11-25 21:41 UTC, Jan Kissig
Details | Diff | Splinter Review
Bug 31694: (follow-up) Use values for operations to avoid translation issues (4.22 KB, patch)
2023-11-25 21:41 UTC, Jan Kissig
Details | Diff | Splinter Review
Bug 31694: MARC overlay rules presets don't change anything if presets are translated (5.31 KB, patch)
2023-12-21 14:27 UTC, Julian Maurice
Details | Diff | Splinter Review
Bug 31694: (follow-up) Further improve translatability (6.47 KB, patch)
2023-12-21 14:27 UTC, Julian Maurice
Details | Diff | Splinter Review
Bug 31694: (follow-up) Fix preset display issue (2.01 KB, patch)
2023-12-21 14:28 UTC, Julian Maurice
Details | Diff | Splinter Review
Bug 31694: (follow-up) Use values for operations to avoid translation issues (4.29 KB, patch)
2023-12-21 14:28 UTC, Julian Maurice
Details | Diff | Splinter Review
Bug 31694: Add missing TT filters (3.30 KB, patch)
2023-12-21 14:28 UTC, Julian Maurice
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Caroline Cyr La Rose 2022-10-05 19:30:17 UTC
In MARC overlay rules, if the preset names are not in English, the settings don't change.

Example
1. In staff interface in English, go to Administration > MARC overlay rules
2. In the 'Preset' column, try the different options. Notice the Added, Appended, Removed, Deleted settings change according to the preset you chose
3. Change interface in another language (I tried fr-CA and de-DE)
4. Try the presets again. Note that if the preset name is in English (some in fr-CA are not translated), the settings change, but if the preset name is translated, nothing changes
Comment 1 Caroline Cyr La Rose 2022-10-05 19:32:40 UTC
I'm putting this as 'normal', maybe it should be 'major'... The functionality doesn't work in other languages than English
Comment 2 Caroline Cyr La Rose 2022-10-05 20:04:20 UTC
Created attachment 141401 [details] [review]
Bug 31694: MARC overlay rules presets don't change anything if presets are translated

This patch corrects option value names in MARC overlay rules to prevent
them from being translated.

To test:
1. Install a new language
1.1. In a terminal, run the following commands
gulp po:update
cd misc/translator
./translate install xx-XX
1.2. Go to Administration > Global system preferences
1.3. Search for language
1.4. In the language syspref check the box for the language you just installed
1.5. Save
2. In the staff interface in English, go to Administration > Record
overlay rules
3. In the column 'Preset' try the various options, note that the
'Added', 'Appended', 'Removed', and 'Deleted' settings change depending
on the chosen preset
4. Change the interface language
5. Redo step 3, notice that if the preset name is translated, the other
settings don't change
6. Apply patch
7. Redo step 3, the presets should now change the settings
Comment 3 Caroline Cyr La Rose 2022-10-05 20:07:02 UTC
I provided a patch... I just changed the option names to make them different from their labels. Since they were the same, I think the translator tool translated everything, name and label, and it couldn't recognize it afterwards...
I hope that was the correct correction.
Comment 4 Caroline Cyr La Rose 2022-10-05 20:21:24 UTC
Ok my patch doesn't 100% work. If you save the rule, it's the option name (the ugly one) rather than the label that appears...
Comment 5 Katrin Fischer 2022-10-24 22:09:32 UTC
Maybe we should remove the translations here?

-        overlay_rules_presets[_("Overwrite")] = {
+        overlay_rules_presets[_("overwrite")] = {

So maybe:

-        overlay_rules_presets[_("Overwrite")] = {
+        overlay_rules_presets["Overwrite"] = {
Comment 6 Katrin Fischer 2022-10-24 22:44:28 UTC
Created attachment 142579 [details] [review]
Bug 31694: MARC overlay rules presets don't change anything if presets are translated

This patch corrects option value names in MARC overlay rules to prevent
them from being translated.

To test:
1. Install a new language
1.1. In a terminal, run the following commands
gulp po:update
cd misc/translator
./translate install xx-XX
1.2. Go to Administration > Global system preferences
1.3. Search for language
1.4. In the language syspref check the box for the language you just installed
1.5. Save
2. In the staff interface in English, go to Administration > Record
overlay rules
3. In the column 'Preset' try the various options, note that the
'Added', 'Appended', 'Removed', and 'Deleted' settings change depending
on the chosen preset
4. Change the interface language
5. Redo step 3, notice that if the preset name is translated, the other
settings don't change
6. Apply patch
7. Redo step 3, the presets should now change the settings
Comment 7 Katrin Fischer 2022-10-24 22:44:32 UTC
Created attachment 142580 [details] [review]
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.
Comment 8 Katrin Fischer 2022-10-25 06:07:08 UTC
Created attachment 142598 [details] [review]
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.
Comment 9 Caroline Cyr La Rose 2022-10-25 13:47:20 UTC
I don't think we're quite there yet :/

Without the patch, in English, when we select let's say 'Add and append' and save the rule, the words 'Add and append' still appear in the preset column of the saved rule. With the patch, the preset is saved as 'Custom'

1. Without the patch, go to Administration > MARC overlay rules
2. Enter the following rule
   - Module: Source
   - Filter: Staged MARC import
   - Tag: 6..
   - Preset: Add and append
3. Click 'Add rule'
   --> In the 'Preset' column, the saved rule says 'Add and append'
4. Delete the rule (click 'Delete' and confirm)
5. Apply the patch
6. Redo steps 2-3
   --> In the 'Preset' column, the saved rule says 'Custom'


I also noticed, after I applied the patch and updated my po's (`gulp po:update --lang fr-CA`) that I still had two strings "User category"

#: koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc-overlay-rules.tt:159
#: koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc-overlay-rules.tt:161
#, c-format
msgid "User category"
msgstr "Catégorie d'utilisateurs"
Comment 10 Shi Yao Wang 2022-12-02 19:53:44 UTC
Created attachment 144407 [details] [review]
Bug 31694: MARC overlay rules presets don't change anything if presets are translated

This patch uses the text of option (which is translated) instead of the value (which is not translated) for the process.

Test plan:
1. Install a new language
1.1. In a terminal, run the following commands
gulp po:update
cd misc/translator
./translate install xx-XX
1.2. Go to Administration > Global system preferences
1.3. Search for language
1.4. In the language syspref check the box for the language you just installed
1.5. Save
2. In the staff interface in English, go to Administration > Record
overlay rules
3. In the column 'Preset' try the various options, note that the
'Added', 'Appended', 'Removed', and 'Deleted' settings change depending
on the chosen preset
4. Change the interface language
5. Redo step 3, notice that if the preset name is translated, the other
settings don't change
6. Apply patch
7. Redo step 3, the presets should now change the settings
Comment 11 Katrin Fischer 2022-12-02 20:02:38 UTC
Hm, a little sad to see my patch just thrown out without comment. I think we still need a lot of fixes there for translatability.
Comment 12 Shi Yao Wang 2022-12-02 20:27:44 UTC
Sorry. The patch I added is supposed to fix this bug, but I'll try to add on what is already done.
Comment 13 Shi Yao Wang 2022-12-02 21:11:52 UTC
Created attachment 144408 [details] [review]
Bug 31694: (follow-up) Fix preset display issue

Preset column should now display the right preset.
Comment 14 Shi Yao Wang 2022-12-02 21:25:05 UTC
Created attachment 144409 [details]
wrong preset caused by different fr-CA translation

On a side note, there is a small issue in fr-CA preset display. The word "Remove" is translated into "Retirer" in column "Retiré" ("Removed" in en), but other instances of "Remove" are translated to "Enlever" so it messes up the preset display.
The problem is fixed if instead of "Retirer" it's "Enlever".
Comment 15 Kevin Carnes 2023-04-13 13:34:40 UTC
Created attachment 149601 [details] [review]
Bug 31694: (follow-up) Use values for operations to avoid translation issues

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)
Comment 16 Kevin Carnes 2023-04-13 13:37:27 UTC
Created attachment 149602 [details] [review]
Bug 31694: (follow-up) Use values for operations to avoid translation issues

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)
Comment 17 Shi Yao Wang 2023-09-01 14:37:53 UTC
Created attachment 155123 [details] [review]
Bug 31694: MARC overlay rules presets don't change anything if presets are translated

This patch corrects option value names in MARC overlay rules to prevent
them from being translated.

To test:
1. Install a new language
1.1. In a terminal, run the following commands
gulp po:update
cd misc/translator
./translate install xx-XX
1.2. Go to Administration > Global system preferences
1.3. Search for language
1.4. In the language syspref check the box for the language you just installed
1.5. Save
2. In the staff interface in English, go to Administration > Record
overlay rules
3. In the column 'Preset' try the various options, note that the
'Added', 'Appended', 'Removed', and 'Deleted' settings change depending
on the chosen preset
4. Change the interface language
5. Redo step 3, notice that if the preset name is translated, the other
settings don't change
6. Apply patch
7. Redo step 3, the presets should now change the settings
Comment 18 Shi Yao Wang 2023-09-01 14:37:55 UTC
Created attachment 155124 [details] [review]
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.
Comment 19 Shi Yao Wang 2023-09-01 14:37:57 UTC
Created attachment 155125 [details] [review]
Bug 31694: (follow-up) Fix preset display issue

Preset column should now display the right preset.
Comment 20 Shi Yao Wang 2023-09-01 14:37:59 UTC
Created attachment 155126 [details] [review]
Bug 31694: (follow-up) Use values for operations to avoid translation issues

    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)
Comment 21 Shi Yao Wang 2023-09-01 14:38:11 UTC
rebase
Comment 22 Katrin Fischer 2023-10-29 11:07:45 UTC
Could we get a sign-off here please? It's not only a translations problem, but also a problem with using this form in any other language.
Comment 23 David Nind 2023-11-19 20:52:32 UTC
Created attachment 159121 [details] [review]
Bug 31694: MARC overlay rules presets don't change anything if presets are translated

This patch corrects option value names in MARC overlay rules to prevent
them from being translated.

To test:
1. Install a new language
1.1. In a terminal, run the following commands
gulp po:update
cd misc/translator
./translate install xx-XX
1.2. Go to Administration > Global system preferences
1.3. Search for language
1.4. In the language syspref check the box for the language you just installed
1.5. Save
2. In the staff interface in English, go to Administration > Record
overlay rules
3. In the column 'Preset' try the various options, note that the
'Added', 'Appended', 'Removed', and 'Deleted' settings change depending
on the chosen preset
4. Change the interface language
5. Redo step 3, notice that if the preset name is translated, the other
settings don't change
6. Apply patch
7. Redo step 3, the presets should now change the settings

Signed-off-by: David Nind <david@davidnind.com>
Comment 24 David Nind 2023-11-19 20:52:35 UTC
Created attachment 159122 [details] [review]
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 <david@davidnind.com>
Comment 25 David Nind 2023-11-19 20:52:37 UTC
Created attachment 159123 [details] [review]
Bug 31694: (follow-up) Fix preset display issue

Preset column should now display the right preset.

Signed-off-by: David Nind <david@davidnind.com>
Comment 26 David Nind 2023-11-19 20:52:40 UTC
Created attachment 159124 [details] [review]
Bug 31694: (follow-up) Use values for operations to avoid translation issues

    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>
Comment 27 David Nind 2023-11-19 21:05:08 UTC
I have tested and got things to work as far as I could tell. Since translation is not something all that familiar to me, may be a second sign off would be useful?

Testing notes using koha-testing-docker (KTD):

1. Not related to this bug. With the recent changes to languages in master, the normal commands for updating and installing a language didn't work as expected for me. See [1] for the errors and my work around.

2. After applying the patches, but before step 7 of the main patch, I had to update and install the language again.


[1] Installing and updating translations using KTD
==================================================

Error when using gulp po:update
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I got an error when using the command (maybe need to access using ktd --root --shell ?):

kohadev-koha@kohadevbox:koha(bz31694)$ gulp po:update
[20:04:18] Using gulpfile /kohadevbox/koha/gulpfile.js
[20:04:18] Starting 'po:update'...
[20:04:18] Starting 'po_update_marc_marc21'...
[20:04:18] Starting 'po_update_marc_unimarc'...
[20:04:18] Starting 'po_update_staff'...
[20:04:18] Starting 'po_update_opac'...
[20:04:18] Starting 'po_update_pref'...
[20:04:18] Starting 'po_update_messages'...
[20:04:18] Starting 'po_update_messages_js'...
[20:04:18] Starting 'po_update_installer'...
[20:04:18] Starting 'po_update_installer_marc21'...
[20:04:18] Starting 'po_update_installer_unimarc'...
[20:04:25] Finished 'po_update_installer_unimarc' after 6.41 s
[20:04:29] Finished 'po_update_installer_marc21' after 10 s
[20:04:29] Finished 'po_update_installer' after 10 s
[20:04:29] Finished 'po_update_marc_unimarc' after 10 s
[20:04:29] Finished 'po_update_pref' after 10 s
[20:04:29] Finished 'po_update_marc_marc21' after 10 s
[20:04:32] Finished 'po_update_messages_js' after 14 s
[20:04:32] Finished 'po_update_opac' after 14 s
[20:04:34] 'po_update_messages' errored after 15 s
[20:04:34] Error: Command failed: msgmerge --backup=off --no-wrap --quiet -F --update misc/translator/po/vi-VN-messages.po misc/translator/Koha-messages.pot
misc/translator/Koha-messages.pot:11:35: syntax error
misc/translator/Koha-messages.pot:11: keyword "n" unknown
misc/translator/Koha-messages.pot:12: end-of-line within string
msgmerge: found 3 fatal errors

    at ChildProcess.exithandler (node:child_process:422:12)
    at ChildProcess.emit (node:events:517:28)
    at ChildProcess.emit (node:domain:552:15)
    at maybeClose (node:internal/child_process:1098:16)
    at Socket.<anonymous> (node:internal/child_process:450:11)
    at Socket.emit (node:events:517:28)
    at Socket.emit (node:domain:552:15)
    at Pipe.<anonymous> (node:net:350:12)
    at Pipe.callbackTrampoline (node:internal/async_hooks:130:17)
[20:04:34] 'po:update' errored after 15 s


Permission errors when using misc/translator/translate
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I also got permission errors when using misc/translator/translate:

misc/translator/translate update fr-FR

misc/translator/translate install fr-FR
mkdir /kohadevbox/koha/misc/translator/po/fr_FR: Permission denied at /kohadevbox/koha/misc/translator/LangInstaller.pm line 454.

sudo misc/translator/translate  install fr-FR
Can't locate C4/Context.pm in @INC (you may need to install the C4::Context module) (@INC contains: /kohadevbox/koha/misc/translator /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.32.1 /usr/local/share/perl/5.32.1 /usr/lib/x86_64-linux-gnu/perl5/5.32 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl-base /usr/lib/x86_64-linux-gnu/perl/5.32 /usr/share/perl/5.32 /usr/local/lib/site_perl) at /kohadevbox/koha/misc/translator/LangInstaller.pm line 22.
BEGIN failed--compilation aborted at /kohadevbox/koha/misc/translator/LangInstaller.pm line 22.
Compilation failed in require at ./translate line 28.
BEGIN failed--compilation aborted at ./translate line 28.


Work around
~~~~~~~~~~~

In the end, I accessed KTD using root to update and install languages.

david@david-thinkpad-t14:~/git-koha/koha-testing-docker$ ktd --root --shell
root@kohadevbox:kohadevbox$ cd koha
root@kohadevbox:koha$ misc/translator/translate update fr-FR
root@kohadevbox:koha$ misc/translator/translate install fr-FR
root@kohadevbox:koha$ chown -R kohadev-koha:kohadev-koha misc/translator/po
Comment 28 Jan Kissig 2023-11-22 13:39:33 UTC
Created attachment 159192 [details] [review]
Bug 31694: (follow-up) Use values for operations to avoid translation issues

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>
Signed-off-by: Jan Kissig <jkissig@th-wildau.de>
Comment 29 Jan Kissig 2023-11-22 13:41:59 UTC
In my case (via ktd koha testing docker) to install de-DE I had to:
 
$ ktd --root --shell
root@kohadevbox:~$ cd /kohadevbox/koha
root@kohadevbox:koha(bug_31694)$ git clone https://gitlab.com/koha-community/koha-l10n.git misc/translator/po
root@kohadevbox:koha(bug_31694)$ misc/translator/translate install de-DE
Comment 30 Victor Grousset/tuxayo 2023-11-24 18:53:45 UTC
@Jan: you meant to signoff the 4 patches, right? Not just the last, "Bug 31694: (follow-up) Use values for operations to avoid translation issues"
Comment 31 Jan Kissig 2023-11-25 21:41:19 UTC
Created attachment 159250 [details] [review]
Bug 31694: MARC overlay rules presets don't change anything if presets are translated

This patch corrects option value names in MARC overlay rules to prevent
them from being translated.

To test:
1. Install a new language
1.1. In a terminal, run the following commands
gulp po:update
cd misc/translator
./translate install xx-XX
1.2. Go to Administration > Global system preferences
1.3. Search for language
1.4. In the language syspref check the box for the language you just installed
1.5. Save
2. In the staff interface in English, go to Administration > Record
overlay rules
3. In the column 'Preset' try the various options, note that the
'Added', 'Appended', 'Removed', and 'Deleted' settings change depending
on the chosen preset
4. Change the interface language
5. Redo step 3, notice that if the preset name is translated, the other
settings don't change
6. Apply patch
7. Redo step 3, the presets should now change the settings

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jan Kissig <jkissig@th-wildau.de>
Comment 32 Jan Kissig 2023-11-25 21:41:23 UTC
Created attachment 159251 [details] [review]
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 <david@davidnind.com>
Signed-off-by: Jan Kissig <jkissig@th-wildau.de>
Comment 33 Jan Kissig 2023-11-25 21:41:26 UTC
Created attachment 159252 [details] [review]
Bug 31694: (follow-up) Fix preset display issue

Preset column should now display the right preset.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jan Kissig <jkissig@th-wildau.de>
Comment 34 Jan Kissig 2023-11-25 21:41:29 UTC
Created attachment 159253 [details] [review]
Bug 31694: (follow-up) Use values for operations to avoid translation issues

    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>
Signed-off-by: Jan Kissig <jkissig@th-wildau.de>
Comment 35 Jan Kissig 2023-11-25 21:43:24 UTC
(In reply to Victor Grousset/tuxayo from comment #30)
> @Jan: you meant to signoff the 4 patches, right? Not just the last, "Bug
> 31694: (follow-up) Use values for operations to avoid translation issues"

@Victor, yes I meant to signoff these 4 patches, just getting familiar with git bz and hope that it worked now as expected
Comment 36 Victor Grousset/tuxayo 2023-11-28 21:00:10 UTC
(In reply to Jan Kissig from comment #35)
> @Victor, yes I meant to signoff these 4 patches, just getting familiar with
> git bz and hope that it worked now as expected

All looks good :)
Comment 37 Julian Maurice 2023-12-21 14:27:54 UTC
Created attachment 160194 [details] [review]
Bug 31694: MARC overlay rules presets don't change anything if presets are translated

This patch corrects option value names in MARC overlay rules to prevent
them from being translated.

To test:
1. Install a new language
1.1. In a terminal, run the following commands
gulp po:update
cd misc/translator
./translate install xx-XX
1.2. Go to Administration > Global system preferences
1.3. Search for language
1.4. In the language syspref check the box for the language you just installed
1.5. Save
2. In the staff interface in English, go to Administration > Record
overlay rules
3. In the column 'Preset' try the various options, note that the
'Added', 'Appended', 'Removed', and 'Deleted' settings change depending
on the chosen preset
4. Change the interface language
5. Redo step 3, notice that if the preset name is translated, the other
settings don't change
6. Apply patch
7. Redo step 3, the presets should now change the settings

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jan Kissig <jkissig@th-wildau.de>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Comment 38 Julian Maurice 2023-12-21 14:27:57 UTC
Created attachment 160195 [details] [review]
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 <david@davidnind.com>
Signed-off-by: Jan Kissig <jkissig@th-wildau.de>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Comment 39 Julian Maurice 2023-12-21 14:28:00 UTC
Created attachment 160196 [details] [review]
Bug 31694: (follow-up) Fix preset display issue

Preset column should now display the right preset.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jan Kissig <jkissig@th-wildau.de>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Comment 40 Julian Maurice 2023-12-21 14:28:04 UTC
Created attachment 160197 [details] [review]
Bug 31694: (follow-up) Use values for operations to avoid translation issues

    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>
Signed-off-by: Jan Kissig <jkissig@th-wildau.de>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Comment 41 Julian Maurice 2023-12-21 14:28:07 UTC
Created attachment 160198 [details] [review]
Bug 31694: Add missing TT filters

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Comment 42 Julian Maurice 2023-12-21 14:31:19 UTC
Patch works well, QA script doesn't complain. Passing QA.

One remark: when editing a rule, the "custom" preset is always selected, even if a preset have been used. But this problem exists in master too, so not caused by these patches.
Comment 43 Katrin Fischer 2023-12-28 09:38:57 UTC
(In reply to Julian Maurice from comment #42)
> Patch works well, QA script doesn't complain. Passing QA.
> 
> One remark: when editing a rule, the "custom" preset is always selected,
> even if a preset have been used. But this problem exists in master too, so
> not caused by these patches.

Agreed, thanks for the testing!
Comment 44 Katrin Fischer 2023-12-28 11:17:08 UTC
Pushed for 24.05!

Well done everyone, thank you!
Comment 45 Fridolin Somers 2024-01-03 16:02:59 UTC
Pushed to 23.11.x for 23.11.02
Comment 46 Lucas Gass 2024-01-12 21:56:15 UTC
Backported to 23.05.x for upcoming 23.05.08