|
16 | 16 | QUESTS_DIR1 = Path('./kubejs/assets/kubejs/lang') |
17 | 17 | QUESTS_DIR2 = Path('./kubejs/assets/ftbquests/lang') |
18 | 18 | QUESTS_DIR3 = Path('./config/ftbquests/quests/chapters') |
19 | | -DEEPL_API_URL = 'https://api.deepl.com/v2/translate' |
20 | | -UPLOAD_URL = "https://api.deepl.com/v2/document" |
21 | | -CHECK_STATUS_URL_TEMPLATE = "https://api.deepl.com/v2/document/{}" |
22 | | -DOWNLOAD_URL_TEMPLATE = "https://api.deepl.com/v2/document/{}/result" |
23 | 19 |
|
24 | 20 | def extract_specific_file(zip_filepath, file_name, dest_dir): |
25 | 21 | with zipfile.ZipFile(zip_filepath, 'r') as zip_ref: |
@@ -445,6 +441,7 @@ def setup_logging(directory): |
445 | 441 | [sg.Combo(select_options, default_value=select_options[2], key='target', size=(20, 1))], |
446 | 442 | [sg.Text("DEEPL API KEY")], |
447 | 443 | [sg.InputText(key='DEEPL_API_KEY')], |
| 444 | + [sg.Checkbox('Use Free API', default=True, key='free')], |
448 | 445 | [sg.Button("Translate", key='translate')] |
449 | 446 | ] |
450 | 447 |
|
@@ -477,6 +474,12 @@ def setup_logging(directory): |
477 | 474 | # 入力された値を取得 |
478 | 475 | target = values['target'] |
479 | 476 | API_KEY = values['DEEPL_API_KEY'] |
| 477 | + suffix = "-free" if values['free'] else "" |
| 478 | + |
| 479 | + DEEPL_API_URL = f'https://api.deepl.com/v2{suffix}/translate' |
| 480 | + UPLOAD_URL = f"https://api.deepl.com/v2{suffix}/document" |
| 481 | + CHECK_STATUS_URL_TEMPLATE = f"https://api.deepl.com/v2{suffix}/document/{{}}" |
| 482 | + DOWNLOAD_URL_TEMPLATE = f"https://api.deepl.com/v2{suffix}/document/{{}}/result" |
480 | 483 |
|
481 | 484 | try: |
482 | 485 | if target == select_options[0]: |
|
0 commit comments