Skip to content

Commit

Permalink
Revert "Updated final version of czech translation"
Browse files Browse the repository at this point in the history
This reverts commit 0261c85.
  • Loading branch information
milanmajchrak committed Jul 26, 2023
1 parent 9bf2614 commit 644cfaa
Show file tree
Hide file tree
Showing 2 changed files with 502 additions and 557 deletions.
92 changes: 19 additions & 73 deletions scripts/language-translation-helper.py
Expand Up @@ -19,60 +19,27 @@
# line3 = ' \"' + name.strip() + '\"' + ' : ' + "\"" + cs.strip() + "\"" + ","
# txt_file_lines.append(line1 + line2 + line3)
# txt_file_lines.append('}')
#
# with open("preklady-preložené-komplet.csv", encoding="utf8") as csvfile:
# csvreader = csv.reader(csvfile, delimiter=";")
#
# for name, en, cs in csvreader:
# if name == 'id':
# continue
# txt_file_lines.append(name)

en_name = []
en_value = []
with open('en.json5', encoding="utf8") as f:
json_p = json5.load(f)
# print(json_p)
for name in json_p:
# txt_file_lines.append(name)
en_value.append(json_p[name])
en_name.append(name)
with open("preklady-preložené-komplet.csv", encoding="utf8") as csvfile:
csvreader = csv.reader(csvfile, delimiter=";")

for name, en, cs in csvreader:
if name == 'id':
continue
txt_file_lines.append(name)

cs_prelozena_values = []
cs_prelozena_names = []
with open('cs.cast_prelozena.json5', encoding="utf8") as f:
with open('cs.json5', encoding="utf8") as f:
json_p = json5.load(f)
# print(json_p)
for name in json_p:
# txt_file_lines.append(name)
cs_prelozena_values.append(json_p[name])
cs_prelozena_names.append(name)
txt_file_lines.append(name)

cs_7_5_values = []
cs_7_5_names = []
# json_file_values = []
with open('cs.json5', encoding="utf8") as f:
with open('en.json5', encoding="utf8") as f:
json_p = json5.load(f)
for name in json_p:
# json_file_lines.append(name)
json_file_lines.append(name)
# json_file_values.append(json_p[name])
cs_7_5_values.append(json_p[name])
cs_7_5_names.append(name)

test_names = []
with open('test.json5', encoding="utf8") as f:
json_p = json5.load(f)
for name in json_p:
# json_file_lines.append(name)
# json_file_values.append(json_p[name])
test_names.append(name)

print('test.json: ' + str(len(test_names)))

for name in cs_7_5_names:
if name not in test_names:
print('missing: ' + name)


# with open('cs.json5', encoding="utf8") as f:
# json_p = json5.load(f)
Expand All @@ -87,31 +54,14 @@
# txt_file_lines.append('}')


print('cs7.5: ' + str(len(cs_7_5_names)))
print('cs tul: ' + str(len(cs_7_5_values)))

cs_new_values = []
cs_new_names = []
# for name in cs_7_5_names:
# cs_new_names.append(name)
# value_to_add = cs_7_5_values[cs_7_5_names.index(name)]
# if name in cs_prelozena_names:
# value_to_add = cs_prelozena_values[cs_prelozena_names.index(name)]
# cs_new_values.append(value_to_add)

print('cs_new_values: ' + str(len(cs_new_values)))

txt_file_lines = ['{']

for name in cs_new_names:
line1 = '\n'
line2 = ' //'
if name in en_name:
line2 += ' \"' + str(name).strip() + '\"' + ' : ' + "\"" + str(en_value[en_name.index(name)]).strip() + "\"" + "\n"
line3 = ' \"' + str(name).strip() + '\"' + ' : ' + "\"" + str(cs_new_values[cs_new_names.index(name)]).strip() + "\"" + ","
txt_file_lines.append(line1 + line2 + line3)

txt_file_lines.append('}')
print('en7.5: ' + str(len(json_file_lines)))
print('cs7.5: ' + str(len(txt_file_lines)))
#
for name in json_file_lines:
if name not in txt_file_lines:
print('Are not in the en: ' + name)
# missing.append(name)
#

# create json with translation which must be added into czech translation\
# translate = ['{']
Expand All @@ -138,7 +88,3 @@
#
# with open('cs_7.5._to_translate_json.txt', 'w', encoding='utf-8') as f:
# f.write('\n'.join(translate))

# with open('translated_tul_cl_json.txt', 'w', encoding='utf-8') as f:
# f.write('\n'.join(txt_file_lines))

0 comments on commit 644cfaa

Please sign in to comment.