mirror of
https://github.com/inventree/InvenTree.git
synced 2026-07-05 06:32:55 +00:00
build(docker): compile backend translations during image build (#12203)
* build(docker): compile backend trasnlations during image build * test(docker): verify compiled backend translations exist in image Add checks to the "Test Docker Image" step that assert the compiled django.mo files are present for a few representative languages (de, fr, ru, zh_Hans). This guards the newly added backend translation compilation step in the production Dockerfile, ensuring the multilingual artifacts are produced at the expected locale paths. * test(docker): verify compiled frontend translations exist in image
This commit is contained in:
@@ -906,6 +906,23 @@ def backend_trans(c, verbose: bool = False):
|
||||
success('Backend translations compiled successfully')
|
||||
|
||||
|
||||
@task(help={'verbose': 'Print verbose output'})
|
||||
@state_logger('backend_compilemessages')
|
||||
def backend_compilemessages(c, verbose: bool = False):
|
||||
"""Compile backend Django translation files without loading InvenTree settings."""
|
||||
info('Compiling backend translations...')
|
||||
|
||||
cmd = 'python3 -m django compilemessages'
|
||||
|
||||
if verbose:
|
||||
cmd += ' -v 1'
|
||||
else:
|
||||
cmd += ' -v 0'
|
||||
|
||||
run(c, cmd, manage_py_dir())
|
||||
success('Backend translations compiled successfully')
|
||||
|
||||
|
||||
@task(
|
||||
help={
|
||||
'clean': 'Clean up old backup files',
|
||||
@@ -2490,6 +2507,7 @@ internal = Collection(
|
||||
clear_generated,
|
||||
export_settings_definitions,
|
||||
export_definitions,
|
||||
backend_compilemessages,
|
||||
frontend_build,
|
||||
frontend_check,
|
||||
frontend_compile,
|
||||
|
||||
Reference in New Issue
Block a user