Skip to content

Robustify the detecting of locale files

Jerome Flesch requested to merge spaetz:robustify_findlocales into unstable

Created by: spaetz

  1. Rather than hardcoding lots of files manually, let gettext.find() search for required .mo files itself.
  2. Robustify the function, so it does not bomb out if an invalid value is in LC_ALL. Try before and after the patch with LC_ALL="Foo" ./paperwork.py to see the effect, for instance.
  3. Also log if the .mo file exists but we had no read permission.

I tested this qute extensively with a lot of valid and invalid values and it seems to work great.

Merge request reports