[IMP] base: use es_419 and not es_MX as reference

And load only two languages, not three.
Faster to load and avoids ambiguity when a Mexican sees es_ES content

closes odoo/odoo#134785

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
This commit is contained in:
Martin Trigaux
2023-09-18 22:17:02 +00:00
parent 007d2bde2a
commit bf81596aa7
+10 -5
View File
@@ -1472,13 +1472,18 @@ def load_language(cr, lang):
installer.lang_install()
def get_po_paths(module_name: str, lang: str):
lang_base = lang.split('_')[0]
langs = [lang_base, lang] # the latter will overwrite the former
if lang_base == "es" and lang != "es_MX":
# force es_MX as fallback language for the different spanish
# es_MX is more actively translated and closer to many languages
langs = [lang_base, "es_MX", lang]
if lang_base == 'es' and lang != 'es_ES':
# force es_419 as fallback language for the spanish variations
if lang == 'es_419':
langs = ['es_419']
else:
langs = ['es_419', lang]
else:
langs = [lang_base, lang]
return [
path
for lang_ in langs