[FIX] transifex: still support old .tx/config format

If one of the theme was not migrated to the new tx api, still support
the previous notation.
Happened on the design-theme repository

closes odoo/odoo#113571

X-original-commit: a8355ba3dddb5f3c8a8e8e777aff85d558410971
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
This commit is contained in:
Martin Trigaux
2023-02-24 11:11:40 +01:00
parent 723c0c24f6
commit cd10bee519
@@ -33,9 +33,13 @@ class TransifexTranslation(models.AbstractModel):
):
if isfile(tx_path):
tx_config_file.read(tx_path)
# tx_config_file.sections(): ['main', 'o:odoo:p:odoo-16:r:base', ...]
for sec in tx_config_file.sections()[1:]:
_, _, _, tx_project, _, tx_mod = sec.split(':')
if len(sec.split(":")) != 6:
# old format ['main', 'odoo-16.base', ...]
tx_project, tx_mod = sec.split(".")
else:
# tx_config_file.sections(): ['main', 'o:odoo:p:odoo-16:r:base', ...]
_, _, _, tx_project, _, tx_mod = sec.split(':')
projects[tx_mod] = tx_project
return projects