Bug 36845 - Exclude meta tag from the translations
Summary: Exclude meta tag from the translations
Status: Pushed to oldstable
Alias: None
Product: Koha
Classification: Unclassified
Component: I18N/L10N (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Jonathan Druart
QA Contact: Marcel de Rooy
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-05-13 17:06 UTC by Caroline Cyr La Rose
Modified: 2024-05-31 13:17 UTC (History)
6 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:
24.05.00,23.11.06,23.05.12


Attachments
Bug 36845: Exclude meta tag from the translations (1.78 KB, patch)
2024-05-14 07:31 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 36845: Exclude meta tag from the translations (1.85 KB, patch)
2024-05-14 20:24 UTC, Caroline Cyr La Rose
Details | Diff | Splinter Review
Bug 36845: Do not loop over the content attribute (1.72 KB, patch)
2024-05-20 11:35 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 36845: Exclude meta tag from the translations (1.94 KB, patch)
2024-05-21 14:55 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 36845: Do not loop over the content attribute (1.81 KB, patch)
2024-05-21 14:55 UTC, Marcel de Rooy
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 2024-05-13 17:06:11 UTC
While translating, I found the string "noindex". I think this should not be translated, as robots will probably no understand the command otherwise.

The string was found in these pages

- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-authorities-home.tt:8
- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-browse.tt:9
- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt:28

I added a general comment in weblate, but it should probably not be picked up by the translating tool.
Comment 1 Jonathan Druart 2024-05-14 07:31:34 UTC
Created attachment 166674 [details] [review]
Bug 36845: Exclude meta tag from the translations

This bug originaly wants to get rid of "noindex" coming from this meta
tag:
  <meta name="robots" content="noindex">

But actually we have other strings from the meta tags that should not be
translated.

Test plan:
0. Do not apply this patch
1. cd misc/translator/po && gulp po:update --lang es-ES (or any other
   lang)
2. git commit -a -m"wip"
3. Apply this patch
4. Repeat 1 and git diff to show the diff
Notice that strings that should not be translated are removed from the
po files (actually commented)
Comment 2 Caroline Cyr La Rose 2024-05-14 20:24:36 UTC
Created attachment 166737 [details] [review]
Bug 36845: Exclude meta tag from the translations

This bug originaly wants to get rid of "noindex" coming from this meta
tag:
  <meta name="robots" content="noindex">

But actually we have other strings from the meta tags that should not be
translated.

Test plan:
0. Do not apply this patch
1. cd misc/translator/po && gulp po:update --lang es-ES (or any other
   lang)
2. git commit -a -m"wip"
3. Apply this patch
4. Repeat 1 and git diff to show the diff
Notice that strings that should not be translated are removed from the
po files (actually commented)

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Comment 3 Caroline Cyr La Rose 2024-05-14 20:25:28 UTC
Thank you Jonathan!

I was very confused by the additions in the diff until I saw "(actually commented)" in step 4. Phew!
Comment 4 Marcel de Rooy 2024-05-17 10:01:25 UTC
            for my $a ('alt', 'content', 'title', 'value', 'label', 'placeholder', 'aria-label') {
                if ($attr->{$a}) {
                    next if $a eq 'label' && $tag ne 'optgroup';
                    next if $a eq 'content';

Why do we loop over content?
Comment 5 Owen Leonard 2024-05-17 14:08:29 UTC
(In reply to Marcel de Rooy from comment #4)

> Why do we loop over content?

I wondered the same thing. I don't see any instances of a content attribute being used for something which needs to be translated. MDN says <meta> is the only element the attribute can be used with.

Theoretically the 'meta description' might have translatable content but we have that populated by a system preference so the content can't be translated anyway.
Comment 6 Jonathan Druart 2024-05-20 11:35:43 UTC
Created attachment 166936 [details] [review]
Bug 36845: Do not loop over the content attribute

We skip it.
Comment 7 Marcel de Rooy 2024-05-21 14:55:35 UTC
Created attachment 166980 [details] [review]
Bug 36845: Exclude meta tag from the translations

This bug originaly wants to get rid of "noindex" coming from this meta
tag:
  <meta name="robots" content="noindex">

But actually we have other strings from the meta tags that should not be
translated.

Test plan:
0. Do not apply this patch
1. cd misc/translator/po && gulp po:update --lang es-ES (or any other
   lang)
2. git commit -a -m"wip"
3. Apply this patch
4. Repeat 1 and git diff to show the diff
Notice that strings that should not be translated are removed from the
po files (actually commented)

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 8 Marcel de Rooy 2024-05-21 14:55:37 UTC
Created attachment 166981 [details] [review]
Bug 36845: Do not loop over the content attribute

We skip it.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 9 Katrin Fischer 2024-05-22 13:46:48 UTC
This is a string change so to speak, but I think removing strings doesn't really count.
Comment 10 Katrin Fischer 2024-05-22 14:20:10 UTC
Pushed for 24.05!

Well done everyone, thank you!
Comment 11 Fridolin Somers 2024-05-29 13:57:14 UTC
Pushed to 23.11.x for 23.11.06
Comment 12 Lucas Gass 2024-05-31 13:17:01 UTC
Backported to 23.05.x for upcoming 23.05.12