1
1
#!/usr/bin/python3
2
2
'''
3
- python _utils/_translation_utils/postprocess_htmlproofer.py <LANG> < OUTPUT_FROM_HTMLPROOFER> <TRANSLATED_DIRECTORY>
3
+ python _utils/_translation_utils/postprocess_htmlproofer.py <OUTPUT_FROM_HTMLPROOFER> <TRANSLATED_DIRECTORY>
4
4
invoke: python _utils/_translation_utils/postprocess_htmlproofer.py de /tmp/html.output _translated/de/
5
- <LANG>[de]: translation language
6
5
<OUTPUT_FROM_HTMLPROOFER>[/tmp/html.output]: output from htmlproofer
7
6
<TRANSLATED_DIRECTORY>[_translated/de/]: the directory with the downloaded translated files from transifex
8
7
'''
@@ -123,12 +122,11 @@ def process_markdown(translated_file, internal_links):
123
122
124
123
125
124
126
- def get_all_translated_permalinks_and_redirects_to_file_mapping (translated_dir , lang ):
125
+ def get_all_translated_permalinks_and_redirects_to_file_mapping (translated_dir ):
127
126
"""
128
- traverse the already updated (via tx pull) root directory with all the translated files for a specific language
129
- and get their permalinks and redirects without the specific language
130
- translated_dir: root directory with all the translated files for a specific language
131
- lang: the specific language
127
+ traverse the already updated (via tx pull) root directory with all the translated files
128
+ and get their permalinks and redirects
129
+ translated_dir: root directory with all the translated files
132
130
return: set holding the translated permalinks and redirects
133
131
"""
134
132
mapping = {}
@@ -246,8 +244,6 @@ def process_yml(translated, errorlinks):
246
244
if __name__ == '__main__' :
247
245
# python _utils/_translation_utils/postprocess_htmlproofer.py de /tmp/html.output _translated/de/
248
246
parser = ArgumentParser ()
249
- # for which language should we do this
250
- parser .add_argument ("language" )
251
247
# the file containing the output of htmlproofer
252
248
parser .add_argument ("htmlproofer_output" )
253
249
# the directory containing the translated (downloaded via tx pull) files
@@ -262,11 +258,6 @@ def process_yml(translated, errorlinks):
262
258
logger .error ("please check your translated directory" )
263
259
exit (1 )
264
260
265
- if not args .language in TRANSLATED_LANGS :
266
- print ("language not in the expected translation languages" )
267
- logger .error ("please check your translation language" )
268
- exit (1 )
269
-
270
261
if not isfile (args .htmlproofer_output ):
271
262
print ("please check your html proofer output file" )
272
263
logger .error ("please check your html proofer output file" )
@@ -293,7 +284,7 @@ def process_yml(translated, errorlinks):
293
284
logger .debug ("------------------------------------------------" )
294
285
logger .debug ("------------------------------------------------" )
295
286
296
- mapping , yml_files = get_all_translated_permalinks_and_redirects_to_file_mapping (args .translated_dir , args . language )
287
+ mapping , yml_files = get_all_translated_permalinks_and_redirects_to_file_mapping (args .translated_dir )
297
288
298
289
299
290
log_debug ('mapping ' , mapping )
0 commit comments