chore: Add build tools for translations

Signed-off-by: Wolfgang Walther <walther@technowledgy.de>
This commit is contained in:
Wolfgang Walther
2024-02-16 22:04:07 +01:00
committed by Wolfgang Walther
parent 18d105f8c2
commit 3664343989
7 changed files with 82 additions and 13 deletions
+14 -6
View File
@@ -1,10 +1,18 @@
#!/usr/bin/env python
import sys
from livereload import Server, shell
from subprocess import call
## Build docs at startup
call(['sphinx-build', '-b', 'html', '-a', '-n', 'docs', '_build'])
if len(sys.argv) == 1:
locale = 'default'
build = './build.sh'
else:
locale = sys.argv[1]
build = f'./build.sh {locale}'
call(build, shell=True)
server = Server()
server.watch('docs/**/*.rst', shell('sphinx-build -b html -a -n docs _build'))
# For custom port and host
# server.serve(root='_build/', host='192.168.1.2')
server.serve(root='_build/')
server.watch('docs/**/*.rst', shell(build))
server.watch(f'locales/{locale}/LC_MESSAGES/*.po', shell(build))
server.serve(root=f'_build/html/{locale}')