Bug 18776

Summary: Translatability: Get rid of exposed tt directives in opac-advsearch.tt
Product: Koha Reporter: Marc Véron <veron>
Component: I18N/L10NAssignee: Marc Véron <veron>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: trivial    
Priority: P5 - low CC: f.demians, fridolin.somers, katrin.fischer, mtj, mtompset
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on:    
Bug Blocks: 28462    
Attachments: Bug 18776: Translatability: Get rid of exposed tt directives in opac-advsearch.tt
[SIGNED-OFF] Bug 18776: Translatability: Get rid of exposed tt directives in opac-advsearch.tt
Bug 18776: Translatability: Get rid of exposed tt directives in opac-advsearch.tt

Description Marc Véron 2017-06-11 14:32:11 UTC
The file opac-advsearch.tt exposes template directives to translation where translators should not be confronted with.
Example in po file:
"[%% IF ( ( OpacAdvSearchOptions and OpacAdvSearchOptions.grep('itemtype')."
"size > 0 and not expanded_options ) or ( OpacAdvSearchMoreOptions and "
"OpacAdvSearchMoreOptions.grep('itemtype').size > 0 and expanded_options ) ) "
"%%] "
Comment 1 Marc Véron 2017-06-11 14:59:15 UTC
Created attachment 64181 [details] [review]
Bug 18776: Translatability: Get rid of exposed tt directives in opac-advsearch.tt

The file opac-advsearch.tt exposes template directives to translation where translators should not be confronted with.
Example in po file:
"[%% IF ( ( OpacAdvSearchOptions and OpacAdvSearchOptions.grep('itemtype')."
"size > 0 and not expanded_options ) or ( OpacAdvSearchMoreOptions and "
"OpacAdvSearchMoreOptions.grep('itemtype').size > 0 and expanded_options ) ) "
"%%] "

To test:
- Apply patch
- Verify that advanced search in OPAC behaves as before
- Create a new translation for a 'language' aa-AA (perl translate create aa-AA)
- Verify that template directives ar no longer exposed in aa-AA-opac-bootstrap.po
Comment 2 Mark Tompsett 2017-06-30 00:08:33 UTC
Created attachment 64734 [details] [review]
[SIGNED-OFF] Bug 18776: Translatability: Get rid of exposed tt directives in opac-advsearch.tt

The file opac-advsearch.tt exposes template directives to translation where translators should not be confronted with.
Example in po file:
"[%% IF ( ( OpacAdvSearchOptions and OpacAdvSearchOptions.grep('itemtype')."
"size > 0 and not expanded_options ) or ( OpacAdvSearchMoreOptions and "
"OpacAdvSearchMoreOptions.grep('itemtype').size > 0 and expanded_options ) ) "
"%%] "

To test:
- Apply patch
- Verify that advanced search in OPAC behaves as before
- Create a new translation for a 'language' aa-AA (perl translate create aa-AA)
- Verify that template directives ar no longer exposed in aa-AA-opac-bootstrap.po

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Comment 3 Mark Tompsett 2017-06-30 00:08:53 UTC
TEST PLAN ON KOHADEVBOX
-----------------------
sudo koha-shell -c bash kohadev
echo $PERL5LIB
-- notice that misc/translator is missing
export PERL5LIB=$PERL5LIB:/home/vagrant/kohaclone/misc/translator
cd /home/vagrant/kohaclone/misc/translator
perl translate create aa-AA
exit
git bz apply 18776
sudo koha-shell -c bash kohadev
export PERL5LIB=$PERL5LIB:/home/vagrant/kohaclone/misc/translator
cd /home/vagrant/kohaclone/misc/translator
perl translate create aa-AB
diff po/aa-AA-opac-bootstrap.po po/aa-AB-opac-bootstrap.po
-- notice that only AA has differences, except for a generation date.
-- be confused that 3 weren't in AA in the first place, even though
   they have the same line breaks, and formatting.
qa -v 2 -c 1
cd po
rm -f aa-A*
exit
-- sign off
Comment 4 Jonathan Druart 2017-08-30 19:40:49 UTC
Created attachment 66647 [details] [review]
Bug 18776: Translatability: Get rid of exposed tt directives in opac-advsearch.tt

The file opac-advsearch.tt exposes template directives to translation where translators should not be confronted with.
Example in po file:
"[%% IF ( ( OpacAdvSearchOptions and OpacAdvSearchOptions.grep('itemtype')."
"size > 0 and not expanded_options ) or ( OpacAdvSearchMoreOptions and "
"OpacAdvSearchMoreOptions.grep('itemtype').size > 0 and expanded_options ) ) "
"%%] "

To test:
- Apply patch
- Verify that advanced search in OPAC behaves as before
- Create a new translation for a 'language' aa-AA (perl translate create aa-AA)
- Verify that template directives ar no longer exposed in aa-AA-opac-bootstrap.po

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 5 Jonathan Druart 2017-08-30 19:59:51 UTC
Pushed to master for 17.11, thanks to everybody involved!
Comment 6 Fridolin Somers 2017-09-29 13:46:46 UTC
Pushed to 17.05.x, will be in 17.05.05.
Comment 7 Katrin Fischer 2017-10-01 22:28:41 UTC
This patch has been pushed to 16.11.x and will be in 16.11.13.
Comment 8 Mason James 2017-11-23 22:10:49 UTC
Pushed to 16.05.x, for 16.05.18 release