mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-28 03:26:45 +00:00
do not compile on normal translation/compilation to not change the source code (#8912)
This commit is contained in:
parent
b1c9fcb0a7
commit
0e4478c35a
11
tasks.py
11
tasks.py
@ -419,7 +419,7 @@ def remove_mfa(c, mail=''):
|
||||
def static(c, frontend=False, clear=True, skip_plugins=False):
|
||||
"""Copies required static files to the STATIC_ROOT directory, as per Django requirements."""
|
||||
if frontend and node_available():
|
||||
frontend_trans(c)
|
||||
frontend_trans(c, extract=False)
|
||||
frontend_build(c)
|
||||
|
||||
info('Collecting static files...')
|
||||
@ -1228,7 +1228,7 @@ def frontend_compile(c):
|
||||
"""
|
||||
info('Compiling frontend code...')
|
||||
frontend_install(c)
|
||||
frontend_trans(c)
|
||||
frontend_trans(c, extract=False)
|
||||
frontend_build(c)
|
||||
success('Frontend compilation complete')
|
||||
|
||||
@ -1244,15 +1244,16 @@ def frontend_install(c):
|
||||
yarn(c, 'yarn install')
|
||||
|
||||
|
||||
@task
|
||||
def frontend_trans(c):
|
||||
@task(help={'extract': 'Extract translations (changes sourcecode), default: True'})
|
||||
def frontend_trans(c, extract: bool = True):
|
||||
"""Compile frontend translations.
|
||||
|
||||
Args:
|
||||
c: Context variable
|
||||
"""
|
||||
info('Compiling frontend translations')
|
||||
yarn(c, 'yarn run extract')
|
||||
if extract:
|
||||
yarn(c, 'yarn run extract')
|
||||
yarn(c, 'yarn run compile')
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user