Auto translator

This commit is contained in:
2022-12-23 22:20:58 -03:00
parent e59ecf694a
commit 3bcd319d78
9 changed files with 216 additions and 1 deletions

18
Auto Trans/Parser.py Normal file
View File

@ -0,0 +1,18 @@
#Expects Renpy's dialogue.txt, spits out a original.csv file
import csv
# Open the text file for reading
with open('dialogue.txt', 'r', encoding='utf8') as input_file:
# Open the csv file for writing, using utf8 encoding
with open('original.csv', 'w', newline='', encoding='utf8') as output_file:
# Create a csv writer object
writer = csv.writer(output_file)
# Iterate over the lines in the text file
for line in input_file:
# Strip the newline characters from the line
stripped_line = line.strip()
# Write the original string and an empty string to the csv file
writer.writerow([stripped_line, ''])