Bug 37397

Summary: Vue - Strings pass to attribute are untranslatable
Product: Koha Reporter: Caroline Cyr La Rose <caroline.cyr-la-rose>
Component: I18N/L10NAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: major    
Priority: P5 - low CC: f.demians, jonathan.druart, martin.renvoize, matt.blenkinsop, paul.derscheid, pedro.amorim, tomascohen
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:

Description Caroline Cyr La Rose 2024-07-17 18:42:09 UTC
When adding items to the waiting list in the preservation module, the "Barcodes" hint in the text box is not translatable.

To get there:

1. Install another language

e.g.

./misc/translator/translate update fr-CA

./misc/translator/translate install fr-CA

Enable the language in the language syspref

2. Enable PreservationModule syspref

3. Add a not for loan status in the PreservationNotForLoanWaitingListIn syspref

4. Change the language of the interface

5. Go to Preservation > Waiting list

6. Click Add to waiting list

--> The "Barcodes" hint inside the text box is not translated

7. Optionally, search the .po files for the string

git grep "Barcodes" fr-CA*

--> Nothing for preservation; everything else is translated
Comment 1 Caroline Cyr La Rose 2024-07-17 19:18:34 UTC
Same thing with "Enter item barcodes" when adding items to a train from the train list.

To get there :

1. Install another language

e.g.

./misc/translator/translate update fr-CA

./misc/translator/translate install fr-CA

Enable the language in the language syspref

2. Enable PreservationModule syspref

3. Add a not for loan status in the PreservationNotForLoanWaitingListIn syspref

4. Change the language of the interface

5. Go to Preservation > Waiting list

6. Click Add to waiting list

7. Enter a barcode in the box and click "Submit"

8. Go to Trains > New train and create a train

9. Click "Add items" from the trains list

--> The "Enter item barcode" hint is not translated

Optionally, search the .po files for the string

git grep "Enter item barcode" fr-CA*

--> Nothing for preservation; everything else is translated
Comment 2 Jonathan Druart 2024-09-24 09:34:38 UTC
It's way more than that, it's all the strings contain in vue files that are in the attributes

I think the following command will return an exhaustive list of the *possible* occurrences:
  git grep '="$__(' **/*.vue

The problem may be hidden if the string exists somewhere else.

For instance "New agreement" appears twice, once outside an attribute and once inside: appears in the po file and will be translated for both occurrences.

However "Enter item barcode" only appears once and so is not picked from gettext to appear in the po file.
Comment 3 Jonathan Druart 2024-09-24 09:37:04 UTC
Tried with gettext 0.22.5 and it's still a problem (D12 has 0.21-12).
Comment 4 Jonathan Druart 2024-09-24 09:38:55 UTC
There is a workaround there https://stackoverflow.com/questions/60867252/using-xgettext-to-extract-translatable-strings-from-vuejs-file
But it's not really nice and add yet one more way/exception for translation.
Comment 5 Jonathan Druart 2024-09-24 09:39:51 UTC
CCing some people so they are aware of the bug.