Skip to content

Commit edebd42

Browse files
committed
Send file extension and enable whole project translate
1 parent d0e86b0 commit edebd42

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎client/polycode.py‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,10 @@ def translate_file(config, target_file, SOURCE_LANG, DEST_LANG):
6262

6363
# result = lib_inst.davidgu.polycode['@dev'](source, config, map)
6464

65+
fextension = os.path.splitext(target_file)[1]
66+
6567
payload = {'doc': source, 'from': SOURCE_LANG,
66-
'to': DEST_LANG, 'map': json.dumps(map)}
68+
'to': DEST_LANG, 'map': json.dumps(map), 'ext':fextension}
6769
# print(payload)
6870
req = requests.get(SERVER_URL, params=payload)
6971
# print(req.url)
@@ -130,7 +132,7 @@ def translate_all(config, DEST_LANG, additional_ignores=[]):
130132

131133
for file in target_files:
132134
if os.path.splitext(file)[-1] in TARGET_FILE_EXTENSIONS:
133-
# translate_file(config, file, SOURCE_LANG, DEST_LANG)
135+
translate_file(config, file, SOURCE_LANG, DEST_LANG)
134136
print(file)
135137

136138
with open(TRANSLATE_TEMP_FILENAME, 'r+') as f:

0 commit comments

Comments
 (0)