|
38 | 38 |
|
39 | 39 |
|
40 | 40 | 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" |
42 | 43 | MAX_WORKERS = min(16, (os.cpu_count() or 2) * 4) |
43 | 44 | TRANSLATOR_LOCK = threading.Lock() |
44 | 45 | TRANSLATORS: Dict[str, GoogleTranslator] = {} |
@@ -180,11 +181,10 @@ def write_hashmap(): |
180 | 181 |
|
181 | 182 |
|
182 | 183 | 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" |
186 | 186 |
|
187 | | - if not os.path.exists(base_path): |
| 187 | + if not os.path.exists(LUA_PATH): |
188 | 188 | raise RuntimeError("Base translations directory not found!") |
189 | 189 |
|
190 | 190 | if not os.path.exists(en_keys_path): |
@@ -274,7 +274,7 @@ def generate_translations(dry_run: bool = False, diff_only: bool = False): |
274 | 274 |
|
275 | 275 | with alive_bar(len(translations), title="Writing locale files", force_tty=True) as bar2: |
276 | 276 | 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) |
278 | 278 | bar2() |
279 | 279 |
|
280 | 280 | write_hashmap() |
|
0 commit comments