Bug 16559 - [%% ... %%] should not be picked for translation
Summary: [%% ... %%] should not be picked for translation
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: I18N/L10N (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords: Academy
Depends on:
Blocks:
 
Reported: 2016-05-21 06:15 UTC by Marc Véron
Modified: 2023-09-09 20:28 UTC (History)
5 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marc Véron 2016-05-21 06:15:33 UTC
Examples in Koha 16.05:

%s [%% INCLUDE "openlibrary-readapi.inc" bib = { normalized_isbn => normalized_isbn, lccn => lccn, normalized_oclc => normalized_oclc } %%] 

%s [%% UNLESS hidden.defined('phone') && hidden.defined('phonepro') && hidden.defined('mobile') && hidden.defined('email') && hidden.defined('emailpro') && hidden.defined('fax') %%] 

In Pootle, a search for [%% has 40 results
Comment 1 Jonathan Druart 2016-05-22 11:52:36 UTC
It happens when TT directive are on several lines.
I tried to fix C4::TTParser::text but failed.
I don't know how to fix this one correctly.
Comment 2 Marc Véron 2016-06-21 12:03:29 UTC
(In reply to Jonathan Druart from comment #1)
> It happens when TT directive are on several lines.
> I tried to fix C4::TTParser::text but failed.
> I don't know how to fix this one correctly.

Hi Jonathan,

C4/TTParser.pm, line 78 has following regex:
\[%.*?%]
. (dot) is (any character exept newline.

I evaluated some possipilities with http://regexr.com/

It seems that the following could work:
\[%[\s\S]*?%]

What do you think about?
Comment 3 Jonathan Druart 2016-06-26 07:52:45 UTC
No idea, did you try it?
Comment 4 Marc Véron 2016-07-07 13:47:35 UTC
(In reply to Jonathan Druart from comment #3)
> No idea, did you try it?

I did try now - and no way, to much side effects.

I think we have to fix the line splitted TT directives.
Comment 5 Jonathan Druart 2016-07-07 15:29:19 UTC
(In reply to Marc Véron from comment #4)
> (In reply to Jonathan Druart from comment #3)
> > No idea, did you try it?
> 
> I did try now - and no way, to much side effects.
> 
> I think we have to fix the line splitted TT directives.

Yes but there are lot of them and not so easy to fix IIRC :)
Comment 6 Marc Véron 2016-07-07 16:20:27 UTC
(In reply to Jonathan Druart from comment #5)
> (In reply to Marc Véron from comment #4)
> > (In reply to Jonathan Druart from comment #3)
> > > No idea, did you try it?
> > 
> > I did try now - and no way, to much side effects.
> > 
> > I think we have to fix the line splitted TT directives.
> 
> Yes but there are lot of them and not so easy to fix IIRC :)

I mistaked in my first comment, if I do a search for [%% with exact match in koha translate I get 24 occurences.
Examine them reveals some other translation issues anyway, see Bug 16871
Comment 7 Katrin Fischer 2020-01-11 13:12:31 UTC
We still have some strange constructions in the po files, although it's not that many. If you search for [%% you get 76 hits over all current translation files:

", "dt_sortby": %s"Verfasser"%s"Jahr"%s"Signatur"%s"Titel"%s, "dt_created_on": "%s", "dt_modification_time": "%s", "dt_action": "%s" }%s,%s %s ] } %s %s %s %s [%%~ action_block = '

[%% SET countries = [ "Afghanistan", "Albanien", "Algerien", "Andorra", "Angola", "Antigua & Barbuda", "Argentinien", "Armenien", "Australien", "Österreich", "Aserbaidschan", "Bahamas", "Bahrain", "Bangladesch", "Barbados", "Weißrussland", "Belgien", "Belize", "Benin", "Bhutan", "Bolivien", "Bosnien Herzegowina", "Botswana", "Brasilien", "Brunei", "Bulgarien", "Burkina", "Burundi", "Kambodscha", "Kamerun", "Kanada", "Cap Verde", "Zentralafrikanische Republik", "Tschad", "Chile", "China", "Kolumbien", "Komoren", "Kongo", "Costa Rica", "Kroatien", "Kuba", "Zypern", "Tschechische Republik", "Dänemark", "Dschibuti", "Dominica", "Dominikanische Republik", "Osttimor", "Ecuador", "Ägypten", "El Salvador", "Äquatorialguinea", "Eritrea", "Estland", "Äthiopien", "Fidschi", "Finnland", "Frankreich", "Gabun", "Gambia", "Georgien", "Deutschland", "Ghana", "Griechenland", "Grenada", "Guatemala", "Guinea", "Guinea-Bissau", "Guyana", "Haiti", "Honduras", "Ungarn", "Island", "Indien", "Indonesien", "Iran", "Irak", "Irland", "Israel", "Italien", "Elfenbeinküste", "Jamaika", "Japan", "Jordanien", "Kasachstan", "Kenia", "Kiribati", "Nordkorea", "Südkorea", "Kosovo", "Kuwait", "Kirgisistan", "Laos", "Lettland", "Libanon", "Lesotho", "Liberia", "Libyen", "Liechtenstein", "Litauen", "Luxemburg", "Mazedonien", "Madagaskar", "Malawi", "Malaysia", "Malediven", "Mali", "Malta", "Marshallinseln", "Mauretanien", "Mauritius", "Mexiko", "Mikronesien", "Moldavien", "Monaco", "Mongolei", "Montenegro", "Morokko", "Mosambik", "Myanmar", "Namibia", "Nauru", "Nepal", "Niederlande", "Neuseeland", "Nicaragua", "Niger", "Nigeria", "Norwegen", "Oman", "Pakistan", "Palau", "Panama", "Papua Neuguinea", "Paraguay", "Peru", "Philippinen", "Polen", "Portugal", "Qatar", "Rumänien", "Russische Föderation", "Ruanda", "St Kitts & Nevis", "St. Lucia", "St. Vincent", "Samoa", "San Marino", "São Tomé", "Saudiarabien", "Senegal", "Serbien", "Seychellen", "Sierra Leone", "Singapur", "Slowakei", "Slowenien", "Solomoninseln", "Somalia", "Südafrika", "Spanien", "Sri Lanka", "Sudan", "Surinam", "Swasiland", "Schweden", "Schweiz", "Syrien", "Taiwan", "Tadschikistan", "Tansania", "Thailand", "Togo", "Tonga", "Trinidad & Tobago", "Tunesien", "Türkei", "Turkmenistan", "Tuvalu", "Uganda", "Ukraine", "Vereinigte Arabische Emirate", "Vereinigtes Königreich", "Vereinigte Staaten von Amerika", "Uruguay", "Usbekistan", "Vanuatu", "Vatikan", "Venezuela", "Vietnam", "Jemen", "Sambia", "Simbabwe", ] %%]
Comment 8 Caroline Cyr La Rose 2022-10-25 13:23:35 UTC
Still valid. I just came across one in marc-overlay-rules.tt

#. %1$s:  END 
#. %2$s:  UNLESS Koha.Preference( 'MARCOverlayRules' ) 
#: koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc-overlay-rules.tt:58
#, c-format
msgid "%s %s [%% SET pref_MARCOverlayRules_link = '"
msgstr "%s %s [%% SET pref_MARCOverlayRules_link = '"
Comment 9 Katrin Fischer 2023-09-09 20:28:20 UTC
We still have 17 occurrences of [%% in the po files for 23.05.

The solution we started to implement is to not use multi-line comments. We start and end the comment on the same line. 

See: bug 33332