2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-02 03:30:54 +00:00

Fix for invoke dev.translate task (#9900)

- This task is used for syncing translations with crowdin
- However, it has been broken for some time, and does not *extract* translations
- Thus, no *new* translations have been uploaded to crowdin recently
This commit is contained in:
Oliver
2025-06-29 22:06:52 +10:00
committed by GitHub
parent 741efd78af
commit ae653e5649

View File

@ -640,7 +640,7 @@ def translate(c, ignore_static=False, no_frontend=False):
manage(c, 'compilemessages') manage(c, 'compilemessages')
if not no_frontend and node_available(): if not no_frontend and node_available():
frontend_compile(c) frontend_compile(c, extract=True)
# Update static files # Update static files
if not ignore_static: if not ignore_static:
@ -1525,17 +1525,18 @@ def frontend_check(c):
print(node_available()) print(node_available())
@task @task(help={'extract': 'Extract translation strings. Default: False'})
@state_logger('TASK06') @state_logger('TASK06')
def frontend_compile(c): def frontend_compile(c, extract: bool = False):
"""Generate react frontend. """Generate react frontend.
Args: Arguments:
c: Context variable c: Context variable
extract (bool): Whether to extract translations from source code. Defaults to False.
""" """
info('Compiling frontend code...') info('Compiling frontend code...')
frontend_install(c) frontend_install(c)
frontend_trans(c, extract=False) frontend_trans(c, extract=extract)
frontend_build(c) frontend_build(c)
success('Frontend compilation complete') success('Frontend compilation complete')