@@ -31,7 +31,7 @@ def __init__(self, game: str):
31
31
self .lang : Optional [Dict [str , str ]] = None
32
32
self .config : Optional [Config ] = None
33
33
34
- def load_json (self , filename : str ) -> Dict [ str , str ] :
34
+ def load_json (self , filename : str ) -> Any :
35
35
script_dir = get_script_path ()
36
36
json_file = script_dir / 'data' / self .game / f'{ filename } .json'
37
37
with open (json_file , 'r' ) as file :
@@ -42,8 +42,8 @@ def load_textdata(self, scriptname: str) -> Dict[str, str]:
42
42
lang_file = script_dir / 'out' / 'raw' / f'{ scriptname } .gml'
43
43
ret = {}
44
44
textdata_regex = re .compile (
45
- r" ds_map_add\(global\.text_data_[a-z]+, "
46
- + r"\" ([a-zA-Z0-9_]+)\ ", ([\" '])(.*)\2\)"
45
+ r' ds_map_add\(global\.text_data_[a-z]+, '
46
+ + r'" ([a-zA-Z0-9_]+)", (["\ '])(.*)\2\)'
47
47
)
48
48
with open (lang_file , 'r' ) as file :
49
49
for line in file .readlines ():
@@ -111,7 +111,8 @@ def classify_junk(self, filename: Path) -> Optional[str]:
111
111
def get_localized_string_ch1 (self , key : str ) -> str :
112
112
if self .lang is None :
113
113
self .lang = self .load_lang ()
114
- if key not in self .lang : # Fail safe
114
+ # Fail safe
115
+ if key not in self .lang :
115
116
return key
116
117
return self .lang [key ]
117
118
0 commit comments