Bug 18901: Sysprefs translation: translate only *.pref files (not *.pref*)
authorJulian Maurice <julian.maurice@biblibre.com>
Thu, 6 Jul 2017 12:39:20 +0000 (14:39 +0200)
committerMason James <mtj@kohaaloha.com>
Sun, 30 Jul 2017 13:02:09 +0000 (01:02 +1200)
commit05ce1e522bf037731b71be6f454b37b635bb2340
treef66f3568c8c4744f84b80ac471629fea41d0479a
parentfc5d008dd51860f75a8b4c9fe2ef863054e18a9f
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>
Signed-off-by: Mason James <mtj@kohaaloha.com>
misc/translator/LangInstaller.pm