最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

輻射4 自動翻譯MOD

2023-07-22 07:07 作者:白紙貓又w  | 我要投稿
  1. 打開xTranslator,Ctrl+Alt+A勾選全部,右鍵標記為已翻譯,導(dǎo)出為XML文件。

  2. 修改python里的路徑,按下運行腳本按鈕,等待運行結(jié)束。

  3. xTranslator選擇導(dǎo)入xml,保存為翻譯文件。

import xml.etree.ElementTree as ET

import json

from shutil import copyfile

from tencentcloud.common import credential

from tencentcloud.common.profile.client_profile import ClientProfile

from tencentcloud.common.profile.http_profile import HttpProfile

from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException

from tencentcloud.tmt.v20180321 import tmt_client, models

token = credential.Credential(

? ? "這里輸入你的騰訊翻譯tk")

def transl(array):

? ? httpProfile = HttpProfile()

? ? httpProfile.endpoint = "tmt.tencentcloudapi.com"

? ? clientProfile = ClientProfile()

? ? clientProfile.httpProfile = httpProfile

? ? client = tmt_client.TmtClient(token, "ap-guangzhou", clientProfile)

? ? req = models.TextTranslateBatchRequest()

? ? params = {

? ? ? ? "Source": "auto",

? ? ? ? "Target": "zh",

? ? ? ? "ProjectId": 0,

? ? ? ? "SourceTextList": array

? ? }

? ? req.from_json_string(json.dumps(params))

? ? resp = client.TextTranslateBatch(req)

? ? return resp.TargetTextList

tree = ET.parse(r"你的xml路徑")

root = tree.getroot()

value_node = root.findall('./Content/')

for string_node in value_node:

? ? value = string_node.find('Dest').text

? ? if not "\n" in value:

? ? ? ? try:

? ? ? ? ? ? tl = transl([value])[0]

? ? ? ? except:

? ? ? ? ? ? tl = '[翻譯出錯]'+value

? ? ? ? string_node.find('Dest').text =tl

? ? ? ? print(value, tl)

tree.write(r"你的xml路徑", encoding='utf-8')


輻射4 自動翻譯MOD的評論 (共 條)

分享到微博請遵守國家法律
嵊州市| 荥经县| 二连浩特市| 葵青区| 凤冈县| 彭泽县| 龙州县| 昌江| 鹤岗市| 涞源县| 武冈市| 藁城市| 磐石市| 邵武市| 固安县| 沂水县| 阜平县| 行唐县| 巍山| 策勒县| 云和县| 兰州市| 烟台市| 宁陵县| 社会| 万山特区| 山丹县| 长岛县| 穆棱市| 临江市| 东台市| 广昌县| 临澧县| 余姚市| 湟中县| 恭城| 肃北| 女性| 卓资县| 镇巴县| 辉县市|