2
0
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:
Matthias Mair 2025-01-20 01:10:58 +01:00 committed by GitHub
parent b1c9fcb0a7
commit 0e4478c35a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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,14 +1244,15 @@ 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')
if extract:
yarn(c, 'yarn run extract')
yarn(c, 'yarn run compile')