Skip to content
This repository has been archived by the owner on Aug 13, 2020. It is now read-only.

Commit

Permalink
add: check trans-ja sheet
Browse files Browse the repository at this point in the history
  • Loading branch information
atoring committed Jun 22, 2018
1 parent 04a4bbf commit d6c9f93
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions frostpunk_mod/language.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand All @@ -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", "</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:
Expand Down

0 comments on commit d6c9f93

Please sign in to comment.