Created
January 15, 2020 02:01
-
-
Save perpouh/894e20ccba5c9988e38af5c93f2ce517 to your computer and use it in GitHub Desktop.
CSVを読みながらi18nファイルを吐き出す
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv | |
header = ''' | |
export default { | |
ja: { | |
''' | |
footer = ''' | |
} | |
} | |
''' | |
of = open('./TranslationsJa.js', 'w') | |
of.write(header) | |
with open('message.csv') as inf: | |
reader = csv.reader(inf) | |
for row in reader: | |
of.write(f"'{row[2]}': '{row[1]}',\n") | |
of.write(footer) | |
of.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
コマンドライン引数でどうこうとかはしていない