Bug 24365 - Using strict from TmplTokenizer.pm broke the translator script
Summary: Using strict from TmplTokenizer.pm broke the translator script
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: I18N/L10N (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low major (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on: 24217
Blocks: 25305
  Show dependency treegraph
 
Reported: 2020-01-07 14:50 UTC by Jonathan Druart
Modified: 2020-04-28 18:13 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:
20.05.00


Attachments
Bug 24365: (bug 24217 follow-up) Fix encoding issue for translator script (1.56 KB, patch)
2020-01-07 14:54 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2020-01-07 14:50:36 UTC
I am not sure what happened here, but adding strict for TmplTokenizer.pm breaks a test for translation:

kohadev-koha@5dbfd5c26b19:/kohadevbox/koha$ prove xt/author/translatable-templates.t
xt/author/translatable-templates.t .. 1/? 
#   Failed test 'opac_bootstrap templates are translatable'
#   at xt/author/translatable-templates.t line 91.
# /tmp/nUR3OD9D9y:19466:8: invalid multibyte sequence
#
# msgmerge: found 1 fatal error
#
xt/author/translatable-templates.t .. 2/? 
#   Failed test 'staff_prog templates are translatable'
#   at xt/author/translatable-templates.t line 91.
# /tmp/DdbDRQTBzl:6111:13: invalid multibyte sequence
#
# /tmp/DdbDRQTBzl:6122:13: invalid multibyte sequence
#
# /tmp/DdbDRQTBzl:10911:14: invalid multibyte sequence
#
# /tmp/DdbDRQTBzl:11301:14: invalid multibyte sequence
#
# /tmp/DdbDRQTBzl:49459:66: invalid multibyte sequence
#
# /tmp/DdbDRQTBzl:65223:27: invalid multibyte sequence
#
# /tmp/DdbDRQTBzl:88587:10: invalid multibyte sequence
#
# /tmp/DdbDRQTBzl:94544:43: invalid multibyte sequence
#
# /tmp/DdbDRQTBzl:94544:71: invalid multibyte sequence
#
# /tmp/DdbDRQTBzl:94549:8: invalid multibyte sequence
#
# msgmerge: found 10 fatal errors
#
# Looks like you failed 2 tests of 2.
xt/author/translatable-templates.t .. Dubious, test returned 2 (wstat 512, 0x200)
Failed 2/2 subtests 

Test Summary Report
-------------------
xt/author/translatable-templates.t (Wstat: 512 Tests: 2 Failed: 2)
  Failed tests:  1-2
  Non-zero exit status: 2
Files=1, Tests=2,  8 wallclock secs ( 0.02 usr  0.01 sys +  8.55 cusr  0.08 csys =  8.66 CPU)
Result: FAIL
Comment 1 Jonathan Druart 2020-01-07 14:54:15 UTC
Created attachment 96896 [details] [review]
Bug 24365: (bug 24217 follow-up) Fix encoding issue for translator script

I am not sure what happened here, but adding strict for TmplTokenizer.pm
breaks a test for translation.

It has been caught by a failing test:
 % prove xt/author/translatable-templates.t
will display lines "invalid multibyte sequence"

I did a diff between the generated files and found:
< msgid "Ã rbok"
---
> msgid "Årbok"

Which made me think of an encoding issue.
Specifying the encoding when write open the file fixes the problem.

Test plan:
 % prove xt/author/translatable-templates.t
must return green
Comment 2 Martin Renvoize 2020-01-07 15:07:02 UTC
Trivial fix, PQA and Pushing
Comment 3 Martin Renvoize 2020-01-07 15:07:51 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 4 Joy Nelson 2020-01-14 01:05:06 UTC
not backported to 19.11.x