Bug 32931 - ERM - (is perpetual) Yes / No options untranslatable
Summary: ERM - (is perpetual) Yes / No options untranslatable
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: I18N/L10N (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low minor (vote)
Assignee: Katrin Fischer
QA Contact: Testopia
URL:
Keywords:
Depends on: 32030
Blocks: 33355
  Show dependency treegraph
 
Reported: 2023-02-09 15:55 UTC by Caroline Cyr La Rose
Modified: 2023-06-13 16:15 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.05.00,22.11.06


Attachments
Bug 32931: Fix translatability issues on 'new agreement' form (2.53 KB, patch)
2023-04-16 11:33 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 32931: Fix translatability issues on 'new agreement' form (2.53 KB, patch)
2023-04-19 07:06 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 32931: Fix translatability issues on 'show agreement' view (1.29 KB, patch)
2023-04-19 07:06 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 32931: Fix translatability issues on 'new agreement' form (2.58 KB, patch)
2023-04-23 22:13 UTC, David Nind
Details | Diff | Splinter Review
Bug 32931: Fix translatability issues on 'show agreement' view (1.33 KB, patch)
2023-04-23 22:13 UTC, David Nind
Details | Diff | Splinter Review
Bug 32931: Fix translatability issues on 'new agreement' form (2.65 KB, patch)
2023-04-25 14:13 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 32931: Fix translatability issues on 'show agreement' view (1.41 KB, patch)
2023-04-25 14:13 UTC, Jonathan Druart
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 2023-02-09 15:55:46 UTC
The Yes and No radio button options for the "Is perpetual" field when adding an agreement are not translatable (at least, I didn't find the correct strings)

To get to the options:
1. Enable the ERMModule system preference
2. Go to E-resource management
3. Click "Agreements"
4. Click "New agreement"
   --> Field "Is perpetual", options are Yes and No

The only "Yes" that I found in fr-CA-messages-js.po is in holds.

#: koha-tmpl/intranet-tmpl/prog/js/holds.js:241
msgid "Yes"
msgstr "Oui"

An option would be to change this to a checkbox, since the options are 0 or 1...
Comment 1 Caroline Cyr La Rose 2023-02-09 17:40:19 UTC
Not sure if it is managed in the same place, but the Yes/No in the agreement table, once the agreement is created, is also untranslatable, as well as the filtering drop-down in the table header.

https://snipboard.io/QyfStJ.jpg
Comment 2 Katrin Fischer 2023-04-16 11:33:15 UTC
Created attachment 149727 [details] [review]
Bug 32931: Fix translatability issues on 'new agreement' form

This fixes the "Yes" and "No" options and "License info" placeholder.

To get to the options:
1. Enable the ERMModule system preference
2. Go to E-resource management
3. Click "Agreements"
4. Click "New agreement"
   --> Field "Is perpetual", options are Yes and No
   --> At the bottom of the form "License info" with "License info"
       within the input field
5. Install (complete) language, verify those are not translated
6. Apply patch
7. Update po files
8. Verify strings exist for this file, translate if necessary
9. Re-install language
10. Verify strings are now translated
Comment 3 Katrin Fischer 2023-04-16 11:34:29 UTC
I believe I found a fix for the form... but I couldn't see where the other Yes/No (from comment 1) might go wrong. Adding Jonathan and attaching my patch.

Caroline, maybe you want to test if that fixes the form for you too?

The form/label layout is also a bit broken, but I see the same on master without my change. 

You might need to do a yarn build after applying the patch.
Comment 4 Jonathan Druart 2023-04-17 11:29:23 UTC
koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsShow.vue:                        <span v-if="agreement.is_perpetual">Yes</span>

This one is missing as well.
Comment 5 Caroline Cyr La Rose 2023-04-17 14:12:48 UTC
I'm having a bit of unrelated trouble with the form. However, I'm wondering if a checkbox wouldn't be better in this case (rather that yes/no radio buttons). Similar to open baskets in acquisitions (when creating a new a basket, we can check a box is the orders are standing).
Comment 6 Caroline Cyr La Rose 2023-04-17 14:37:26 UTC
I applied the patch and updated/installed translations. I see the line in fr-CA-messages-js.po

#: koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsFormAdd.vue:108
#: koha-tmpl/intranet-tmpl/prog/js/holds.js:241
msgid "Yes"
msgstr "Oui"

But it's still showing up as Yes in the form. I wonder if my unrelated problem is not related after all. The options are displayed before the question https://snipboard.io/R8i9th.jpg 

Not sure why, but it's the same in the ByWater sandbox, so it's not something in my installation or something I'm doing/not doing...

Also, do we really want it to say "Noes"? XD I thought I was not seeing this correctly, but it's in the diff
Comment 7 Caroline Cyr La Rose 2023-04-17 15:19:58 UTC
Matt pointed me to bug 33355 for my form problems. This one doesn't apply on top of that. So I can't check if it solves my problem.

I retested and Yes/No are still in english. (It's not even Yes/Noes, so I have no idea what I'm doing wrong)
Comment 8 Katrin Fischer 2023-04-18 20:38:45 UTC
(In reply to Caroline Cyr La Rose from comment #7)
> Matt pointed me to bug 33355 for my form problems. This one doesn't apply on
> top of that. So I can't check if it solves my problem.
> 
> I retested and Yes/No are still in english. (It's not even Yes/Noes, so I
> have no idea what I'm doing wrong)

I guess it was a little too late again that day - I had changed it to noes to verify I was changing things in the right spot - forgot to change back or to commit the changed file...

I won't be able to come back to this maybe for a while, if someone else wants to continue/fix this here please do.

(I have no idea how to change to a checkbox either with vue)
Comment 9 Katrin Fischer 2023-04-18 20:39:14 UTC
You always need to build the vue files (yarn build) with every change I think.
Comment 10 Jonathan Druart 2023-04-19 07:06:56 UTC
Created attachment 149834 [details] [review]
Bug 32931: Fix translatability issues on 'new agreement' form

This fixes the "Yes" and "No" options and "License info" placeholder.

To get to the options:
1. Enable the ERMModule system preference
2. Go to E-resource management
3. Click "Agreements"
4. Click "New agreement"
   --> Field "Is perpetual", options are Yes and No
   --> At the bottom of the form "License info" with "License info"
       within the input field
5. Install (complete) language, verify those are not translated
6. Apply patch
7. Update po files
8. Verify strings exist for this file, translate if necessary
9. Re-install language
10. Verify strings are now translated
Comment 11 Jonathan Druart 2023-04-19 07:06:59 UTC
Created attachment 149835 [details] [review]
Bug 32931: Fix translatability issues on 'show agreement' view
Comment 12 Jonathan Druart 2023-04-19 07:08:26 UTC
I've fixed Katrin's patch.
With this second patch it will work.

Test plan:
translate update LANG
edit po/LANG-messages-js.po
translate install LANG
restart_all (JS strings are cached!!)
Try now the UI
Comment 13 Jonathan Druart 2023-04-19 07:28:59 UTC
(In reply to Jonathan Druart from comment #12)
> I've fixed Katrin's patch.
> With this second patch it will work.
> 
> Test plan:
> translate update LANG
> edit po/LANG-messages-js.po
> translate install LANG
> restart_all (JS strings are cached!!)
> Try now the UI

and ofc `yarn js:build` that is mandatory when you modify vue files.
Comment 14 David Nind 2023-04-23 22:13:21 UTC
Created attachment 150142 [details] [review]
Bug 32931: Fix translatability issues on 'new agreement' form

This fixes the "Yes" and "No" options and "License info" placeholder.

To get to the options:
1. Enable the ERMModule system preference
2. Go to E-resource management
3. Click "Agreements"
4. Click "New agreement"
   --> Field "Is perpetual", options are Yes and No
   --> At the bottom of the form "License info" with "License info"
       within the input field
5. Install (complete) language, verify those are not translated
6. Apply patch
7. Update po files
8. Verify strings exist for this file, translate if necessary
9. Re-install language
10. Verify strings are now translated

Signed-off-by: David Nind <david@davidnind.com>
Comment 15 David Nind 2023-04-23 22:13:24 UTC
Created attachment 150143 [details] [review]
Bug 32931: Fix translatability issues on 'show agreement' view

Signed-off-by: David Nind <david@davidnind.com>
Comment 16 Katrin Fischer 2023-04-23 22:15:02 UTC
(In reply to Jonathan Druart from comment #12)
> I've fixed Katrin's patch.
> With this second patch it will work.

Thank you - I was just doing it by trial and error mostly :)
Comment 17 David Nind 2023-04-23 22:50:03 UTC
Testing notes (using KTD):

1. Install a language:
   - cd misc/translator
   - ./translate install fr-CA

2. After applying the patch:
   - yarn js:build
   - flush_memcached and restart_all

3. Update the po files:
   - cd misc/translator
   - ./translate update fr-CA
   - vi po/fr-CA-messages-js.po
   - search for Yes, No and License info
   - should now be entries for ...AgreementsFormAdd.vue and ....AgreementsShow.vue files
   - reinstall the language: ./translate install fr-CA

4. When installing fr-CA (before and after the patch is applied) I get this message - does this need to be fixed?

   In file "admin.pref", "Options d'authentification" is a translation for sections "Google OpenID Connect", "Login options" at /kohadevbox/koha/misc/translator/LangInstaller.pm line 184.
Comment 18 Caroline Cyr La Rose 2023-04-24 13:42:29 UTC
(In reply to David Nind from comment #17)
> 4. When installing fr-CA (before and after the patch is applied) I get this
> message - does this need to be fixed?
> 
>    In file "admin.pref", "Options d'authentification" is a translation for
> sections "Google OpenID Connect", "Login options" at
> /kohadevbox/koha/misc/translator/LangInstaller.pm line 184.

It's already fixed in Pootle. However, I don't know how to make it so that the commited files are also corrected.
Comment 19 Jonathan Druart 2023-04-25 14:13:28 UTC
Created attachment 150205 [details] [review]
Bug 32931: Fix translatability issues on 'new agreement' form

This fixes the "Yes" and "No" options and "License info" placeholder.

To get to the options:
1. Enable the ERMModule system preference
2. Go to E-resource management
3. Click "Agreements"
4. Click "New agreement"
   --> Field "Is perpetual", options are Yes and No
   --> At the bottom of the form "License info" with "License info"
       within the input field
5. Install (complete) language, verify those are not translated
6. Apply patch
7. Update po files
8. Verify strings exist for this file, translate if necessary
9. Re-install language
10. Verify strings are now translated

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 20 Jonathan Druart 2023-04-25 14:13:31 UTC
Created attachment 150206 [details] [review]
Bug 32931: Fix translatability issues on 'show agreement' view

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 21 Tomás Cohen Arazi 2023-05-05 12:17:15 UTC
Pushed to master for 23.05.

Nice work everyone, thanks!
Comment 22 Martin Renvoize 2023-05-12 15:17:28 UTC
Many hands makes light work, thankyou everyone!

Pushed to 22.11.x for the next release