Skip to content

Commit b00dbc4

Browse files
committed
Do not show progress while converting files #454
1 parent 3839cc9 commit b00dbc4

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

src/builder/convertfiles.py

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ def _convert_ts_files_to_po(self):
8585
fileName, fileExtension = os.path.splitext(tsfile)
8686
logging.info("convert ts file: {0}".format(tsfile))
8787
cmd = self._add_conversor_setup_to_cmd(
88-
"ts2po {0} -o {1}.po".format(tsfile, fileName), ConversorID.Ts
88+
"ts2po --progress=none {0} -o {1}.po".format(tsfile, fileName),
89+
ConversorID.Ts,
8990
)
9091
os.system(cmd)
9192

@@ -96,7 +97,7 @@ def _convert_strings_files_to_po(self):
9697
filename = "{0}/strings-ca.po".format(dirName)
9798
# Allow process files with duplicated entries
9899
cmd = (
99-
"prop2po -t {0}/en.strings {0}/ca.strings "
100+
"prop2po --progress=none -t {0}/en.strings {0}/ca.strings "
100101
"--personality strings --duplicates merge -o {1}"
101102
)
102103
cmd = self._add_conversor_setup_to_cmd(
@@ -122,7 +123,7 @@ def _convert_csv_files_to_po(self):
122123
for csvfile in self.findFiles.find_recursive(self.convert_dir, "ca.csv"):
123124
dirName = os.path.dirname(csvfile)
124125
pofile = dirName + "/ca.po"
125-
cmd = "csv2po -i {0} -o {1}".format(csvfile, pofile)
126+
cmd = "csv2po --progress=none -i {0} -o {1}".format(csvfile, pofile)
126127
cmd = self._add_conversor_setup_to_cmd(cmd, ConversorID.Csv)
127128
os.system(cmd)
128129
logging.info("convert csv file: {0}".format(csvfile))
@@ -147,7 +148,7 @@ def _convert_properties_files_to_po(self):
147148
po_filename = "{0}/properties-ca.po".format(dirName)
148149
# Allow process files with duplicated entries
149150
cmd = (
150-
f"prop2po -t {dirName}/{en_file} {dirName}/{prop_filename} "
151+
f"prop2po --progress=none -t {dirName}/{en_file} {dirName}/{prop_filename} "
151152
f"--personality java --duplicates merge -o {po_filename}"
152153
)
153154

@@ -187,15 +188,15 @@ def _convert_php_resources_files_to_po(self):
187188
logging.info("convert php directory: {0}".format(self.convert_dir))
188189
# Name arbitrary choosen (not sepecific to an expected dir structure)
189190
OUT_DIRNAME = "po-files"
190-
cmd = "cd {0} && php2po -t en -i ca " "-o {1}".format(
191+
cmd = "cd {0} && php2po --progress=none -t en -i ca " "-o {1}".format(
191192
self.convert_dir, OUT_DIRNAME
192193
)
193194
cmd = self._add_conversor_setup_to_cmd(cmd, ConversorID.Php)
194195
os.system(cmd)
195196

196197
def _convert_android_file(self, src_file, tgt_file, dir):
197198
output_file = os.path.join(dir, "ca.po")
198-
cmd = f"android2po -t {src_file} -i {tgt_file} -o {output_file}"
199+
cmd = f"android2po --progress=none -t {src_file} -i {tgt_file} -o {output_file}"
199200
cmd = self._add_conversor_setup_to_cmd(cmd, ConversorID.Android)
200201
os.system(cmd)
201202

@@ -257,7 +258,7 @@ def _convert_json_file_to_po(self, jsonfile, source, target):
257258
return
258259

259260
logging.info("convert json file: {0}".format(dirName))
260-
cmd = f"json2po -t {source} -i {target} -o {filename}"
261+
cmd = f"json2po --progress=none -t {source} -i {target} -o {filename}"
261262
cmd = self._add_conversor_setup_to_cmd(cmd, ConversorID.Json)
262263
os.system(cmd)
263264

@@ -305,7 +306,7 @@ def _convert_yml_files_to_po(self):
305306
pofile = os.path.join(dirName, "yml-ca.po")
306307

307308
logging.info("convert yml file: {0}".format(trgfile))
308-
cmd = "yaml2po --personality=ruby -t {0} -i {1} -o {2}".format(
309+
cmd = "yaml2po --progress=none --personality=ruby -t {0} -i {1} -o {2}".format(
309310
srcfile, trgfile, pofile
310311
)
311312
os.system(cmd)
@@ -314,13 +315,13 @@ def _convert_xliff_file_to_po(self):
314315
for xlfile in self.findFiles.find_recursive(self.convert_dir, "*.xliff"):
315316
fileName, fileExtension = os.path.splitext(xlfile)
316317
pofile = xlfile.replace(".xliff", ".po")
317-
cmd = f'xliff2po -i "{xlfile}" -o "{pofile}" --duplicates=merge'
318+
cmd = f'xliff2po --progress=none -i "{xlfile}" -o "{pofile}" --duplicates=merge'
318319
cmd = self._add_conversor_setup_to_cmd(cmd)
319320
os.system(cmd)
320321

321322
def _convert_apple_file(self, src_file, tgt_file, directory):
322323
output_file = os.path.join(directory, "ca-apple.po")
323-
cmd = f"prop2po -t {src_file} -i {tgt_file} -o {output_file} --personality strings --duplicates merge"
324+
cmd = f"prop2po --progress=none -t {src_file} -i {tgt_file} -o {output_file} --personality strings --duplicates merge"
324325
cmd = self._add_conversor_setup_to_cmd(cmd, ConversorID.Apple)
325326
if "--encoding" not in cmd:
326327
cmd += " --encoding utf-8"
@@ -369,7 +370,7 @@ def _convert_fluent_file_to_po(self, src_file, tgt_file):
369370
if os.path.exists(output_file):
370371
return
371372
logging.info("convert fluent file: {0}".format(tgt_file))
372-
cmd = f"fluent2po -t {src_file} -i {tgt_file} -o {output_file}"
373+
cmd = f"fluent2po --progress=none -t {src_file} -i {tgt_file} -o {output_file}"
373374
cmd = self._add_conversor_setup_to_cmd(cmd, ConversorID.Fluent)
374375
os.system(cmd)
375376

@@ -416,7 +417,7 @@ def _convert_arb_file_to_po(self, src_file, tgt_file, directory):
416417
if os.path.exists(output_file):
417418
return
418419
logging.info("convert arb file: {0}".format(tgt_file))
419-
cmd = f"arb2po -t {src_file} -i {tgt_file} -o {output_file}"
420+
cmd = f"arb2po --progress=none -t {src_file} -i {tgt_file} -o {output_file}"
420421
cmd = self._add_conversor_setup_to_cmd(cmd, ConversorID.Arb)
421422
os.system(cmd)
422423

0 commit comments

Comments
 (0)