Bug 18901

Summary: Sysprefs translation: translate only *.pref files (not *.pref*)
Product: Koha Reporter: Julian Maurice <julian.maurice>
Component: I18N/L10NAssignee: Julian Maurice <julian.maurice>
Status: CLOSED FIXED QA Contact: Marcel de Rooy <m.de.rooy>
Severity: normal    
Priority: P5 - low CC: f.demians, fridolin.somers, katrin.fischer, m.de.rooy, mtj
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Bug 18901: Sysprefs translation: translate only *.pref files (not *.pref*)
Bug 18901: Sysprefs translation: translate only *.pref files (not *.pref*)
Bug 18901: Sysprefs translation: translate only *.pref files (not *.pref*)
Bug 18901: [QA Follow-up] Do not translate zzpref either

Description Julian Maurice 2017-07-06 12:52:28 UTC
Text editors can create temporary files in this folder and this can confuse the translator.
For instance, vim can create a file named '.opac.pref.swp' which will make the translator dies with the following error message:

Can't use string ("b0VIM 8.0") as a HASH ref while "strict refs" in use at LangInstaller.pm line 248.
Comment 1 Julian Maurice 2017-07-06 12:54:16 UTC
Created attachment 64846 [details] [review]
Bug 18901: Sysprefs translation: translate only *.pref files (not *.pref*)

Text editors can create temporary files in this folder and this can
confuse the translator.
For instance, vim can create a file named '.opac.pref.swp' which will
make the translator dies with the following error message:

Can't use string ("b0VIM 8.0") as a HASH ref while "strict refs" in use
at LangInstaller.pm line 248.

Test plan:
1. echo 'Oops' > .../en/modules/admin/preferences/whatever.pref.whatever
2. cd misc/translator && ./translate update fr-FR
3. Verify that you have the error message mentioned above
4. Apply patch
5. cd misc/translator && ./translate update fr-FR
6. No more errors!
Comment 2 Frédéric Demians 2017-07-08 08:02:16 UTC
Created attachment 64932 [details] [review]
Bug 18901: Sysprefs translation: translate only *.pref files (not *.pref*)

Text editors can create temporary files in this folder and this can
confuse the translator.
For instance, vim can create a file named '.opac.pref.swp' which will
make the translator dies with the following error message:

Can't use string ("b0VIM 8.0") as a HASH ref while "strict refs" in use
at LangInstaller.pm line 248.

Test plan:
1. echo 'Oops' > .../en/modules/admin/preferences/whatever.pref.whatever
2. cd misc/translator && ./translate update fr-FR
3. Verify that you have the error message mentioned above
4. Apply patch
5. cd misc/translator && ./translate update fr-FR
6. No more errors!

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
Comment 3 Marcel de Rooy 2017-07-12 11:47:00 UTC
Created attachment 65005 [details] [review]
Bug 18901: Sysprefs translation: translate only *.pref files (not *.pref*)

Text editors can create temporary files in this folder and this can
confuse the translator.
For instance, vim can create a file named '.opac.pref.swp' which will
make the translator dies with the following error message:

Can't use string ("b0VIM 8.0") as a HASH ref while "strict refs" in use
at LangInstaller.pm line 248.

Test plan:
1. echo 'Oops' > .../en/modules/admin/preferences/whatever.pref.whatever
2. cd misc/translator && ./translate update fr-FR
3. Verify that you have the error message mentioned above
4. Apply patch
5. cd misc/translator && ./translate update fr-FR
6. No more errors!

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 4 Marcel de Rooy 2017-07-12 11:47:04 UTC
Created attachment 65006 [details] [review]
Bug 18901: [QA Follow-up] Do not translate zzpref either

Adding one backslash makes a difference :)
We need to escape the dot in the regex to exclude a file like zzpref
from translation too. Perfect_regexes++

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 5 Jonathan Druart 2017-07-14 15:33:43 UTC
Pushed to master for 17.11, thanks to everybody involved!
Comment 6 Fridolin Somers 2017-07-18 14:48:48 UTC
Pushed to 17.05.x, will be in 17.05.02
Comment 7 Katrin Fischer 2017-07-19 21:27:29 UTC
This patch has been pushed to 16.11.x and will be in 16.11.10.
Comment 8 Mason James 2017-07-31 12:15:29 UTC
Pushed to 16.05.x, for 16.05.15 release