Bug 24068

Summary: Koha::Template::Plugin::I18N->tnpx should call Koha::I18->__npx
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: I18N/L10NAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: f.demians, martin.renvoize
Version: unspecified   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
19.11.00
Bug Depends on: 15395    
Bug Blocks: 23591    
Attachments: Bug 24068: Fix I18 plugin - tnpx must call __npx
Bug 24068: Fix I18 plugin - tnpx must call __npx
Bug 24068: (RM follow-up) Enhance the POD
Bug 24068: (RM follow-up) Enhance the POD

Description Jonathan Druart 2019-11-19 16:25:16 UTC
It calls __np
Comment 1 Jonathan Druart 2019-11-19 16:31:20 UTC
Created attachment 95578 [details] [review]
Bug 24068: Fix I18 plugin - tnpx must call __npx

Test plan:
Use the following code to test this change
    [% PROCESS 'i18n.inc' %]
    [% SET nb_stuffs = 1 %]
    [% tnpx('context', 'There is one stuff.', 'There are {count} stuffs.', nb_stuffs, { count = nb_stuffs }) | $raw  %]
    [% SET nb_stuffs = 42 %]
    [% tnpx('context', 'There is one stuff.', 'There are {count} stuffs.', nb_stuffs, { count = nb_stuffs }) | $raw  %]

Compare with and without the patch
Comment 2 Martin Renvoize 2019-11-22 14:48:24 UTC
Created attachment 95729 [details] [review]
Bug 24068: Fix I18 plugin - tnpx must call __npx

Test plan:
Use the following code to test this change
    [% PROCESS 'i18n.inc' %]
    [% SET nb_stuffs = 1 %]
    [% tnpx('context', 'There is one stuff.', 'There are {count} stuffs.', nb_stuffs, { count = nb_stuffs }) | $raw  %]
    [% SET nb_stuffs = 42 %]
    [% tnpx('context', 'There is one stuff.', 'There are {count} stuffs.', nb_stuffs, { count = nb_stuffs }) | $raw  %]

Compare with and without the patch

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 3 Martin Renvoize 2019-11-22 14:48:27 UTC
Created attachment 95730 [details] [review]
Bug 24068: (RM follow-up) Enhance the POD
Comment 4 Martin Renvoize 2019-11-22 14:49:57 UTC
Works well and is an obvious correction to a typo.. Signing off and Passing QA in one hit...  I've also enhanced the documentation for the module a bit.
Comment 5 Martin Renvoize 2019-11-22 14:51:14 UTC
Created attachment 95731 [details] [review]
Bug 24068: (RM follow-up) Enhance the POD
Comment 6 Martin Renvoize 2019-11-22 14:58:34 UTC
Nice work!

Pushed to master for 19.11.00