mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-28 11:36:44 +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):
|
def static(c, frontend=False, clear=True, skip_plugins=False):
|
||||||
"""Copies required static files to the STATIC_ROOT directory, as per Django requirements."""
|
"""Copies required static files to the STATIC_ROOT directory, as per Django requirements."""
|
||||||
if frontend and node_available():
|
if frontend and node_available():
|
||||||
frontend_trans(c)
|
frontend_trans(c, extract=False)
|
||||||
frontend_build(c)
|
frontend_build(c)
|
||||||
|
|
||||||
info('Collecting static files...')
|
info('Collecting static files...')
|
||||||
@ -1228,7 +1228,7 @@ def frontend_compile(c):
|
|||||||
"""
|
"""
|
||||||
info('Compiling frontend code...')
|
info('Compiling frontend code...')
|
||||||
frontend_install(c)
|
frontend_install(c)
|
||||||
frontend_trans(c)
|
frontend_trans(c, extract=False)
|
||||||
frontend_build(c)
|
frontend_build(c)
|
||||||
success('Frontend compilation complete')
|
success('Frontend compilation complete')
|
||||||
|
|
||||||
@ -1244,15 +1244,16 @@ def frontend_install(c):
|
|||||||
yarn(c, 'yarn install')
|
yarn(c, 'yarn install')
|
||||||
|
|
||||||
|
|
||||||
@task
|
@task(help={'extract': 'Extract translations (changes sourcecode), default: True'})
|
||||||
def frontend_trans(c):
|
def frontend_trans(c, extract: bool = True):
|
||||||
"""Compile frontend translations.
|
"""Compile frontend translations.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
c: Context variable
|
c: Context variable
|
||||||
"""
|
"""
|
||||||
info('Compiling frontend translations')
|
info('Compiling frontend translations')
|
||||||
yarn(c, 'yarn run extract')
|
if extract:
|
||||||
|
yarn(c, 'yarn run extract')
|
||||||
yarn(c, 'yarn run compile')
|
yarn(c, 'yarn run compile')
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user