feat: Added Tencent Translate

This commit is contained in:
2025-12-05 15:50:30 +08:00
parent 4515e1f177
commit 5f07ec1a8e

View File

@@ -7,9 +7,14 @@
sougou: `https://fanyi.sogou.com`,
baidu: `https://fanyi.baidu.com`,
bing: `https://cn.bing.com/translator`,
tencent: `https://fanyi.qq.com`,
caiyun: `https://fanyi.caiyunapp.com`,
youdao: `https://fanyi.youdao.com`,
});
// ❌ Google Translate
// ❌ DeepL
// ❌ Yandex
// ❌ Reverso
onMount(() => {
console.log("onMount");
@@ -31,8 +36,9 @@
urlMaps.sougou = `https://fanyi.sogou.com/text?keyword=${encodeURIComponent(text)}&transfrom=auto&transto=zh-CHS&model=general`;
urlMaps.baidu = `https://fanyi.baidu.com/mtpe-individual/transText?query=${encodeURIComponent(text)}&lang=auto2zh`;
urlMaps.bing = `https://cn.bing.com/translator?text=${encodeURIComponent(text)}&mkt=zh-CN`;
urlMaps.tencent = `https://fanyi.qq.com`;
urlMaps.caiyun = `https://fanyi.caiyunapp.com`;
// 有道翻译不支持通过URL参数自动填入文本因此只能打开翻译页面
urlMaps.youdao = `https://fanyi.youdao.com/#/TextTranslate`;
});
</script>
@@ -121,6 +127,33 @@
></iframe>
</div>
<label class="tab">
<input type="radio" name="my_tabs_4" />
<svg
class="icon"
viewBox="0 0 1024 1024"
version="1.1"
xmlns="http://www.w3.org/2000/svg"
width="20"
height="20"
><path
d="M308.329026 707.111385C152.549744 707.111385 26.25641 581.146256 26.25641 425.760821S152.549744 144.410256 308.329026 144.410256c155.79241 0 282.072615 125.965128 282.072615 281.350565s-126.293333 281.350564-282.072615 281.350564z m-95.100718-372.972308l-22.698667 153.074872h53.484308l19.876102-144.489026a7.561846 7.561846 0 0 0-7.496205-8.585846h-43.165538z m52.959179-11.867898l9.859282 48.64h23.722667l-11.250872-48.64h-22.331077z m-4.909949 57.133949l8.283898 51.2h23.748923l-10.436923-51.2h-21.595898z m2.599385 70.787282a721.841231 721.841231 0 0 1-17.394872 37.415385c-4.949333 9.728-12.563692 23.893333-22.856205 42.509128h27.897436c6.997333-13.640205 12.813128-25.416205 17.460513-35.328 4.647385-9.911795 11.198359-24.641641 19.666051-44.17641l-24.772923-0.420103z m124.192821-4.686769h11.027692l1.837949-19.74482h-9.360411l7.194257-40.500513a8.638359 8.638359 0 0 0-8.507077-10.161231H322.428718a129.417846 129.417846 0 0 0 13.390769-16.213333h74.318769l3.111385-19.626667h-67.347692c1.627897-3.334564 2.888205-6.065231 3.741538-8.192 0.866462-2.126769 2.008615-5.356308 3.465846-9.701744h-23.683282c-0.433231 0-0.997744 8.625231-10.121846 23.000616a98.724103 98.724103 0 0 1-16.948513 20.007384l-5.185641 30.72a94.011077 94.011077 0 0 0 22.134154-16.804102l0.525128-0.525128-12.340512 47.996718h-13.180718l-2.192411 19.74482h10.292513L288.820513 498.32041h67.347692l-2.139897 11.526564h-27.621744l5.395692 20.453744h41.222565l5.671384-31.980308h17.211077l3.360821-18.655179H382.030769l6.052103-34.15959z m-156.409436-91.976205h9.767384l-15.307487 114.267897h-10.699487l16.23959-114.267897z m134.275282 91.976205l-6.327795 34.146462h-43.401846l8.651487-34.146462h41.091282-0.013128z m3.649641-19.74482h-39.739077l7.837538-30.930052h37.625436l-5.723897 30.930052z m-44.386462 23.709538l8.664616 24.956718h24.155897l-10.817641-24.94359h-22.002872v-0.013128z m11.749744-50.674872l7.719384 21.438359h23.171282l-8.795897-21.425231h-22.094769z"
fill="#8B07FA"
></path><path
d="M530.79959 630.363897a300.333949 300.333949 0 0 0 80.147692-204.603076 300.320821 300.320821 0 0 0-80.147692-204.603077A281.534359 281.534359 0 0 1 724.427487 144.410256c155.779282 0 282.072615 125.965128 282.072616 281.350565s-126.293333 281.350564-282.085744 281.350564a281.468718 281.468718 0 0 1-193.601641-76.747488z m180.919795-233.984l8.467692-49.309538h-25.862564L664.379077 516.201026h26.781538l16.856616-98.212103h35.997538a8.638359 8.638359 0 0 1 8.507077 10.161231l-15.740718 88.050872h26.781539l16.134564-94.562462a21.609026 21.609026 0 0 0-21.307077-25.258667h-46.670769z m104.684307-0.94523l-21.740307 120.779487h26.781538l21.097026-120.779487h-26.138257z m8.008205-46.211282l-5.382564 27.201641h27.87118l4.122256-27.188513h-26.610872z"
fill="#000000"
></path><path
d="M778.568205 700.862359C737.450667 805.494154 635.313231 879.589744 515.833436 879.589744c-119.558564 0-221.761641-74.200615-262.813539-178.963693a286.588718 286.588718 0 0 0 78.769231 4.46359 212.913231 212.913231 0 0 0 184.057436 105.511385A212.913231 212.913231 0 0 0 699.917128 704.984615c26.269538 2.258051 52.736 0.866462 78.637949-4.122256z"
fill="#000000"
></path></svg
>
<span class="ml-2"> 腾讯翻译君 </span>
</label>
<div class="tab-content bg-base-100 border-base-300">
<iframe title="腾讯翻译君" class="w-full h-full" src={urlMaps["tencent"]}
></iframe>
</div>
<label class="tab">
<input type="radio" name="my_tabs_4" />
<svg