summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Trigaux <mat@odoo.com>2020-11-17 05:55:13 +0000
committerMartin Trigaux <mat@odoo.com>2020-11-17 12:42:17 +0000
commitf1d403723d59b8e53b00cf2d26bd9d3d54437803 (patch)
tree73202dee806619d4061532df615ff2967821d3df
parent587ed5df5b542c6c6b3f13d1e348dd28d0da1f2c (diff)
[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
-rw-r--r--odoo/tools/translate.py8
1 files 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