Skip to content

Commit

Permalink
update trans.py
Browse files Browse the repository at this point in the history
  • Loading branch information
naya1503 committed Mar 2, 2024
1 parent fbf84af commit c8f8a14
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions trans.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ async def translate_yaml(input_file, output_file):
index = 0
for key, value in data.items():
if isinstance(value, str):
translated_data[key] = str(translated_texts[index]) # Convert translation result to string
translated_data[key] = translated_texts[index]
index += 1
else:
translated_data[key] = value

with open(output_file, 'w', encoding='utf-8') as file:
yaml.safe_dump(translated_data, file, allow_unicode=True)
yaml.dump(translated_data, file, allow_unicode=True)

asyncio.run(translate_yaml('langs/strings/id.yml', 'langs/strings/en.yml'))

0 comments on commit c8f8a14

Please sign in to comment.