Summary: | Exclude meta tag from the translations | ||
---|---|---|---|
Product: | Koha | Reporter: | Caroline Cyr La Rose <caroline.cyr-la-rose> |
Component: | I18N/L10N | Assignee: | Jonathan Druart <jonathan.druart> |
Status: | Pushed to oldstable --- | QA Contact: | Marcel de Rooy <m.de.rooy> |
Severity: | normal | ||
Priority: | P5 - low | CC: | f.demians, fridolin.somers, jonathan.druart, lucas, m.de.rooy |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
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
|
|
Circulation function: | |||
Attachments: |
Bug 36845: Exclude meta tag from the translations
Bug 36845: Exclude meta tag from the translations Bug 36845: Do not loop over the content attribute Bug 36845: Exclude meta tag from the translations Bug 36845: Do not loop over the content attribute |
Description
Caroline Cyr La Rose
2024-05-13 17:06:11 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) 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> Thank you Jonathan! I was very confused by the additions in the diff until I saw "(actually commented)" in step 4. Phew! 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? (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. Created attachment 166936 [details] [review] Bug 36845: Do not loop over the content attribute We skip it. 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> 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> This is a string change so to speak, but I think removing strings doesn't really count. Pushed for 24.05! Well done everyone, thank you! Pushed to 23.11.x for 23.11.06 Backported to 23.05.x for upcoming 23.05.12 |