1
- #!/usr/bin/env python
1
+ #!/usr/bin/env python3
2
2
import sys , argparse , logging , os , csv
3
3
4
4
PLATFORM = None
@@ -18,9 +18,9 @@ def main(args, loglevel):
18
18
# check DELIMITER
19
19
if args .delimiter == None : DELIMITER = ','
20
20
21
- print '\n '
21
+ print ( '\n ' )
22
22
logging .info ("Start Localizing .... " )
23
- print '\n '
23
+ print ( '\n ' )
24
24
logging .info ("------------------------------------" )
25
25
26
26
# check source path
@@ -68,7 +68,7 @@ def main(args, loglevel):
68
68
69
69
logging .info ("Generated output directory: %s" % OUTPUT_DIR )
70
70
generate_keys (IN_PATH , OUTPUT_DIR , PLATFORM , DELIMITER )
71
- print '\n '
71
+ print ( '\n ' )
72
72
logging .info ("DONE LOCALIZING.\n " )
73
73
74
74
def generate_keys (source_path , output , platform , delimiter ):
@@ -84,7 +84,7 @@ def generate_keys(source_path, output, platform, delimiter):
84
84
85
85
fullpath = os .path .join (dirname , f )
86
86
87
- with open (fullpath , 'rb ' ) as csvfile :
87
+ with open (fullpath , 'r ' ) as csvfile :
88
88
reader = csv .reader (csvfile , delimiter = delimiter )
89
89
# create language key
90
90
for i , line in enumerate (reader ):
@@ -140,7 +140,7 @@ def start_localize_ios(source_path, all_writes, lang_keys, delimiter):
140
140
fullpath = os .path .join (dirname , f )
141
141
logging .info ("Localizing: %s to iOS" , filename )
142
142
143
- with open (fullpath , 'rb ' ) as csvfile :
143
+ with open (fullpath , 'r ' ) as csvfile :
144
144
[fwrite .write ('\n /* {0} */\n ' .format (filename )) for fwrite in allwrites ]
145
145
146
146
reader = csv .reader (csvfile , delimiter = delimiter )
@@ -181,7 +181,7 @@ def start_localize_android(source_path, all_writes, lang_keys, delimiter):
181
181
fullpath = os .path .join (dirname , f )
182
182
logging .info ("Localizing: %s to Android" , filename )
183
183
184
- with open (fullpath , 'rb ' ) as csvfile :
184
+ with open (fullpath , 'r ' ) as csvfile :
185
185
[fwrite .write ('\n <!-- {0} -->\n ' .format (filename )) for fwrite in allwrites ]
186
186
187
187
reader = csv .reader (csvfile , delimiter = delimiter )
@@ -223,7 +223,7 @@ def start_localize_json(source_path, all_writes, lang_keys, delimiter):
223
223
224
224
current_row = 0
225
225
226
- with open (fullpath , 'rb ' ) as csvfile :
226
+ with open (fullpath , 'r ' ) as csvfile :
227
227
[fwrite .write ('\n ' ) for fwrite in allwrites ]
228
228
229
229
reader = csv .reader (csvfile , delimiter = delimiter )
0 commit comments