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
I'm putting this as 'normal', maybe it should be 'major'... The functionality doesn't work in other languages than English
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
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.
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...
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"] = {
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
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.
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.
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"
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
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.
Sorry. The patch I added is supposed to fix this bug, but I'll try to add on what is already done.
Created attachment 144408 [details] [review] Bug 31694: (follow-up) Fix preset display issue Preset column should now display the right preset.
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".
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)
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)
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
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.
Created attachment 155125 [details] [review] Bug 31694: (follow-up) Fix preset display issue Preset column should now display the right preset.
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)
rebase
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.
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>
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>
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>
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>
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
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>
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
@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"
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>
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>
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>
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>
(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
(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 :)
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>
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>
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>
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>
Created attachment 160198 [details] [review] Bug 31694: Add missing TT filters Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
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.
(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!
Pushed for 24.05! Well done everyone, thank you!
Pushed to 23.11.x for 23.11.02
Backported to 23.05.x for upcoming 23.05.08