Skip to content

Commit 3afd789

Browse files
committed
Update generate_translations.py
1 parent 491a9c6 commit 3afd789

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

scripts/translations/generate_translations.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@
3838

3939

4040
PARENT_PATH = Path(__file__).resolve().parent
41-
HASHMAP_PATH = PARENT_PATH / "hashmap.json"
41+
LUA_PATH = PARENT_PATH.parent.parent / "SSV2/includes/lib/translations"
42+
HASHMAP_PATH = LUA_PATH / "__hashmap.json"
4243
MAX_WORKERS = min(16, (os.cpu_count() or 2) * 4)
4344
TRANSLATOR_LOCK = threading.Lock()
4445
TRANSLATORS: Dict[str, GoogleTranslator] = {}
@@ -180,11 +181,10 @@ def write_hashmap():
180181

181182

182183
def generate_translations(dry_run: bool = False, diff_only: bool = False):
183-
base_path = PARENT_PATH.parent.parent / "SSV2/includes/lib/translations"
184-
en_keys_path = base_path / "en-US.lua"
185-
locales_path = base_path / "__locales.lua"
184+
en_keys_path = LUA_PATH / "en-US.lua"
185+
locales_path = LUA_PATH / "__locales.lua"
186186

187-
if not os.path.exists(base_path):
187+
if not os.path.exists(LUA_PATH):
188188
raise RuntimeError("Base translations directory not found!")
189189

190190
if not os.path.exists(en_keys_path):
@@ -274,7 +274,7 @@ def generate_translations(dry_run: bool = False, diff_only: bool = False):
274274

275275
with alive_bar(len(translations), title="Writing locale files", force_tty=True) as bar2:
276276
for fname, content in translations.items():
277-
write_lua_table(os.path.join(base_path, fname), content)
277+
write_lua_table(os.path.join(LUA_PATH, fname), content)
278278
bar2()
279279

280280
write_hashmap()

0 commit comments

Comments
 (0)