From 003c81aaa0fe8f4ee0a21f9ee4406c77cc18f436 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Tue, 17 Nov 2020 05:55:13 +0000 Subject: [PATCH] [FIX] tools: extract translations in static/src/ directory Since 14.0, the javascript code of snippets is moved inside a /static/src/snippets directory. With owl, the components are defined in static/src/components Some other modules were using more exotic path and ended up with no translations. opw-2381030 X-original-commit: f1d403723d59b8e53b00cf2d26bd9d3d54437803 --- odoo/tools/translate.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/odoo/tools/translate.py b/odoo/tools/translate.py index eed29f7f784..0fb19676056 100644 --- a/odoo/tools/translate.py +++ b/odoo/tools/translate.py @@ -1146,17 +1146,17 @@ class TranslationModuleReader: for fname in fnmatch.filter(files, '*.py'): self._babel_extract_terms(fname, path, root, extract_keywords={'_': None, '_lt': None}) - # Javascript source files in the static/src/js directory, rest is ignored (libs) - if fnmatch.fnmatch(root, '*/static/src/js*'): + if fnmatch.fnmatch(root, '*/static/src*'): + # Javascript source files for fname in fnmatch.filter(files, '*.js'): self._babel_extract_terms(fname, path, root, 'javascript', extra_comments=[WEB_TRANSLATION_COMMENT], extract_keywords={'_t': None, '_lt': None}) - # QWeb template files - if fnmatch.fnmatch(root, '*/static/src/xml*'): + # QWeb template files for fname in fnmatch.filter(files, '*.xml'): self._babel_extract_terms(fname, path, root, 'odoo.tools.translate:babel_extract_qweb', extra_comments=[WEB_TRANSLATION_COMMENT]) + if not recursive: # due to topdown, first iteration is in first level break