forked from TandoorRecipes/recipes
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmake_compile_messages.py
More file actions
32 lines (22 loc) · 860 Bytes
/
make_compile_messages.py
File metadata and controls
32 lines (22 loc) · 860 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import os
def detect_languages(folder_path):
languages = []
for root, dirs, files in os.walk(folder_path):
for dir in dirs:
languages.append(dir)
return languages
def call_makemessages(languages):
command = "python manage.py makemessages -i venv -i staticfiles -i static -i vue -i vue3 "
for lang in languages:
command += f"-l {lang} "
os.system(command)
def call_compilemessages():
os.system('python manage.py compilemessages -i venv -i staticfiles -i static -i vue -i vue3')
if __name__ == "__main__":
# Specify the path to the folder containing language directories
folder_path = "cookbook/locale"
# Detect languages in the folder
languages = detect_languages(folder_path)
# Call makemessages for each language
call_makemessages(languages)
call_compilemessages()