Bug 37397 - Vue - Strings pass to attribute are untranslatable
Summary: Vue - Strings pass to attribute are untranslatable
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: I18N/L10N (show other bugs)
Version: Main
Hardware: All All
: P5 - low major
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-07-17 18:42 UTC by Caroline Cyr La Rose
Modified: 2024-09-24 09:39 UTC (History)
7 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.