Bug 18901 - Sysprefs translation: translate only *.pref files (not *.pref*)
Summary: Sysprefs translation: translate only *.pref files (not *.pref*)
Status: Pushed to Stable
Alias: None
Product: Koha
Classification: Unclassified
Component: I18N/L10N (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Julian Maurice
QA Contact: Marcel de Rooy
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-07-06 12:52 UTC by Julian Maurice
Modified: 2017-07-31 12:15 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Bug 18901: Sysprefs translation: translate only *.pref files (not *.pref*) (1.39 KB, patch)
2017-07-06 12:54 UTC, Julian Maurice
Details | Diff | Splinter Review
Bug 18901: Sysprefs translation: translate only *.pref files (not *.pref*) (1.53 KB, patch)
2017-07-08 08:02 UTC, Frédéric Demians
Details | Diff | Splinter Review
Bug 18901: Sysprefs translation: translate only *.pref files (not *.pref*) (1.62 KB, patch)
2017-07-12 11:47 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 18901: [QA Follow-up] Do not translate zzpref either (1.02 KB, patch)
2017-07-12 11:47 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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