Bug 11497 - i18n toolchain fails to pick up TT code in the format 'SomeVariable or "Some Text"' for translation
Summary: i18n toolchain fails to pick up TT code in the format 'SomeVariable or "Some ...
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: I18N/L10N (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low minor (vote)
Assignee: Bernardo Gonzalez Kriegel
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-08 11:51 UTC by paxed
Modified: 2014-12-07 20:07 UTC (History)
4 users (show)

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


Attachments
Bug 11497 - i18n toolchain fails to pick up TT code in the format 'SomeVariable or "Some Text"' for translation (10.67 KB, patch)
2014-04-03 19:21 UTC, Bernardo Gonzalez Kriegel
Details | Diff | Splinter Review
Bug 11497 - i18n toolchain fails to pick up TT code in the format 'SomeVariable or "Some Text"' for translation (10.89 KB, patch)
2014-04-24 15:49 UTC, Chris Cormack
Details | Diff | Splinter Review
[PASSED QA] Bug 11497 - i18n toolchain fails to pick up TT code in the format 'SomeVariable or "Some Text"' for translation (11.01 KB, patch)
2014-04-26 16:57 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description paxed 2014-01-08 11:51:38 UTC
Some templates use the following or similar code:

[% LibraryNameTitle or "Koha online" %]

The translation toolchain fails to pick up the hard-coded string for translation:

# grep -E '^#. %[0-9]+\$s: +.* or \"[^"]+".*$' po/de-DE-*.po
po/de-DE-i-opac-t-prog-v-3006000.po:#. %4$s:  LibraryNameTitle or "Koha online" 
po/de-DE-i-opac-t-prog-v-3006000.po:#. %3$s:  LibraryNameTitle or "Koha online" 
po/de-DE-i-opac-t-prog-v-3006000.po:#. %3$s:  LibraryNameTitle or "Koha online" 
po/de-DE-i-opac-t-prog-v-3006000.po:#. %2$s:  LibraryNameTitle or "Koha online" 
po/de-DE-i-opac-t-prog-v-3006000.po:#. %2$s:  LibraryNameTitle or "Koha online" 
po/de-DE-i-staff-t-prog-v-3006000.po:#. %1$s:  frameworkcode or "Default" 
po/de-DE-i-staff-t-prog-v-3006000.po:#. %1$s:  update.old_branch or "?" 
po/de-DE-i-staff-t-prog-v-3006000.po:#. %2$s:  update.LoginBranchcode or "?" 
po/de-DE-opac-bootstrap.po:#. %4$s:  LibraryNameTitle or "Koha online"
po/de-DE-opac-bootstrap.po:#. %3$s:  LibraryNameTitle or "Koha online"
po/de-DE-opac-bootstrap.po:#. %3$s:  LibraryNameTitle or "Koha online"
po/de-DE-opac-bootstrap.po:#. %3$s:  LibraryNameTitle or "Koha online"
po/de-DE-opac-bootstrap.po:#. %2$s:  LibraryNameTitle or "Koha online"
Comment 1 Bernardo Gonzalez Kriegel 2014-04-03 19:21:32 UTC Comment hidden (obsolete)
Comment 2 Chris Cormack 2014-04-24 15:49:49 UTC Comment hidden (obsolete)
Comment 3 Katrin Fischer 2014-04-26 16:57:13 UTC
Created attachment 27663 [details] [review]
[PASSED QA] Bug 11497 - i18n toolchain fails to pick up TT code in the format 'SomeVariable or "Some Text"' for translation

i18n toolchain fails to pick text defined inside [% ... %]

This patch fixes all the cases I could find

To test:
1. Update your preferred language
(cd misc/translator; perl translate update fi-FI)

2. Count headers for example
egrep "^msgid.*Koha online" misc/translator/po/fi-FI-* | wc -l

3. Apply the patch

4. Repeat 1 and 2, now there are more lines
Or translate to some lang and visit every touched page and look the title

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described. Template changes only.
Comment 4 Katrin Fischer 2014-04-26 16:57:53 UTC
Maybe we should add this to the coding guidelines?
Comment 5 Galen Charlton 2014-04-27 22:04:10 UTC
Pushed to master.  Thanks, Bernardo!
Comment 6 Galen Charlton 2014-04-27 22:04:50 UTC
(In reply to Katrin Fischer from comment #4)
> Maybe we should add this to the coding guidelines?

Although I pushed the patch, the construct that it replaces seems useful on the face of it, and it's certainly less verbose.  I'd rather see the translation code be taught how to deal with it.