diff --git a/frostpunk_mod/language.py b/frostpunk_mod/language.py index 77db104..48f029e 100644 --- a/frostpunk_mod/language.py +++ b/frostpunk_mod/language.py @@ -153,6 +153,7 @@ def read_csv(self, path, fix_func=_null_func, lang_idx=japanese_idx, idx_column= # read csv cl = {} +# cl_en = {} try: with codecs.open(path, "r", "utf-8-sig") as f: r = csv.reader(f, delimiter=",", doublequote=True, lineterminator="\r\n", quotechar='"', skipinitialspace=True) @@ -162,6 +163,7 @@ def read_csv(self, path, fix_func=_null_func, lang_idx=japanese_idx, idx_column= idx = data[idx_column] text = data[text_column] cl[idx] = text +# cl_en[idx] = data[0] except IOError: log("error", "read csv file", path) return False @@ -177,6 +179,19 @@ def read_csv(self, path, fix_func=_null_func, lang_idx=japanese_idx, idx_column= # if flag: # return False + # check + if False: + for idx, text in self.__text_list.items(): + en = text.get_text(english_idx) + if en is not None: + en = en.replace("\n", "") + en_ = cl_en[idx] + if en != en_: + print(idx) + print(en) + print(en_) + return False + # replacement for idx in self.__text_list.keys(): if idx in cl: