[FIX] res.lang: filter out unsupported format options in default locale info

This commit is contained in:
Olivier Dony 2015-01-05 19:36:30 +01:00
parent 1d99784a0a
commit d9e52f793b
1 changed files with 4 additions and 0 deletions

View File

@ -94,6 +94,10 @@ class lang(osv.osv):
be 100% cross-platform we map to the directives required by
the C standard (1989 version), always available on platforms
with a C standard implementation."""
# For some locales, nl_langinfo returns a D_FMT/T_FMT that contains
# unsupported '%-' patterns, e.g. for cs_CZ
format = format.replace('%-', '%')
for pattern, replacement in tools.DATETIME_FORMATS_MAP.iteritems():
format = format.replace(pattern, replacement)
return str(format)