From bf81596aa7b36a9a08b9701a9fcdab3e30902349 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Fri, 8 Sep 2023 11:22:33 +0200 Subject: [PATCH] [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) --- odoo/tools/translate.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/odoo/tools/translate.py b/odoo/tools/translate.py index 29fad6eab2c..268b446c641 100644 --- a/odoo/tools/translate.py +++ b/odoo/tools/translate.py @@ -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