mirror of
https://github.com/HaodongMo/ARC-9.git
synced 2025-03-04 03:02:58 -05:00
Forgot to enable recursion on autolocalize.py
🤦♀️
This commit is contained in:
parent
c89b97f2ba
commit
6b41a7834a
@ -5,26 +5,23 @@ Exclude = input("Exclude: ")
|
|||||||
import glob
|
import glob
|
||||||
import os
|
import os
|
||||||
|
|
||||||
def makeTemplate():
|
Dictionary = {}
|
||||||
with open(BaseFile, "r", encoding='utf-8') as f:
|
|
||||||
Template = f.readlines()
|
with open(BaseFile, "r", encoding='utf-8') as f:
|
||||||
Dictionary = {}
|
Template = f.readlines()
|
||||||
for i in range(len(Template)):
|
for i in range(len(Template)):
|
||||||
split = Template[i].split(" = ")
|
split = Template[i].split(" = ")
|
||||||
if Template[i][:2] == "L[":
|
if Template[i][:2] == "L[":
|
||||||
Dictionary[split[1].rstrip()] = (split[0])[2:-1]
|
Dictionary[split[1].rstrip()] = (split[0])[2:-1]
|
||||||
return Dictionary
|
|
||||||
|
|
||||||
# print(makeTemplate())
|
for path in glob.iglob(Directory+'/**/*.lua',recursive = True): # process
|
||||||
|
if len(Exclude) > 0 and Exclude in path:
|
||||||
for path in glob.glob(Directory+'*.lua'): # process
|
|
||||||
Template = makeTemplate()
|
|
||||||
if Exclude in path:
|
|
||||||
print(f"Excluded file {path}.")
|
print(f"Excluded file {path}.")
|
||||||
continue
|
continue
|
||||||
|
print(path)
|
||||||
with open(path, 'r+') as lua:
|
with open(path, 'r+') as lua:
|
||||||
content = lua.read()
|
content = lua.read()
|
||||||
for key in Template:
|
for key in Dictionary:
|
||||||
content = content.replace(key,f"ARC9:GetPhrase({Template[key]})")
|
content = content.replace(key,f"ARC9:GetPhrase({Template[key]})")
|
||||||
lua.seek(0)
|
lua.seek(0)
|
||||||
lua.write(content)
|
lua.write(content)
|
||||||
|
Loading…
Reference in New Issue
Block a user