YKT.GoogleTranslation 2.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package YKT.GoogleTranslation --version 2.0.0                
NuGet\Install-Package YKT.GoogleTranslation -Version 2.0.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="YKT.GoogleTranslation" Version="2.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add YKT.GoogleTranslation --version 2.0.0                
#r "nuget: YKT.GoogleTranslation, 2.0.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install YKT.GoogleTranslation as a Cake Addin
#addin nuget:?package=YKT.GoogleTranslation&version=2.0.0

// Install YKT.GoogleTranslation as a Cake Tool
#tool nuget:?package=YKT.GoogleTranslation&version=2.0.0                

谷歌在线翻译插件

​ 谷歌在线翻译插件由易酷天团队提供技术支持,提供了两种对接模式资源包引用和接口对接,翻译结果均直接与谷歌翻译引擎对接,目前在V1.0版本中实现了单文本对接,后期将会实现数据结构和附件翻译功能。如有其他个性化定制需要可以随时咨询,官网地址为:http://yikutian.com

1、Nuget包引用对接

1)在Nuget管理端查询YKT.GoogleTranslation,引用添加即可

2、静态方法直接调用

提供了四个参数,分别为AppKey、翻译的内容、源语种(可用EnumTranslation枚举直接调用)、目标语种(可用EnumTranslation枚举直接调用),具体如下

GoogleTranslation.GoogleTranslate(

"AppKey",

“翻译的内容",

EnumTranslation.中文,

EnumTranslation.英文

)

调用方法及入参示例:
GoogleTranslation.GoogleTranslate("82EEE258-2F02-0A98-ADAA-D8D4243BFA0F", "你好", EnumTranslation.中文,EnumTranslation.英文)

翻译结果示例:
{"data":"Hello","success":true,"message":"翻译成功"}
data为翻译结果

为了更好的服务用户提供了AppKey,在调用时可以使用以下AppKey调用,每个仅使用一次

46C94C48-0A8E-C63A-D34F-D289033F0F29 34990850-2A47-D5D5-5224-4DB004696AD0 FFCF14FC-7E79-D6CB-1D04-56792EB5E38D 94AB21E8-7B43-FE66-1783-2EE9CE817976 DD274F81-91B0-C479-8360-A7F719416BF8 652A58B3-9D84-0091-B10A-6689DA90FC15 D47EDD89-6D6C-435F-8F6C-9839C8ACAFCC AE1AE088-F928-63A7-36ED-3BA15CA9EE06 C9502E2B-266C-1ABD-ED91-4F7A4999B562 3872D297-472A-CBAE-DF10-B5B8923C5297 F7F197BB-58BA-5F56-37C5-BF258D33B013 4BCE50AD-5684-879B-B932-88DE2422414C 33310506-61B1-F7AC-1031-833ECB8425B1 1264C91C-8B5C-ED0B-F8D3-5F0FA79493EA E24D76C7-B3DF-1537-9103-437066552A76 F65E8E64-1A1D-11BC-9F9F-C6A801D321E3 EE65ED18-B587-A7EA-86E0-E65590D615F7 72D0B9EF-5C67-EE65-DDA2-E0947825B17B 41DFBFBB-AEA1-269D-5908-C39D0F6F6E29 82EEE258-2F02-0A98-ADAA-D8D4243BFA0

2、接口对接

支持http Post和Get请求协议,具体如下

1)单个翻译

请求地址:http://yikutian.com/api/translation?AppKey=XX&TimeSpan=XXXOriginLang=XXX&TransLang=Source=待翻译结果

1)AppKey可以使用以下数据,如果已被使用可以登录官网免费申请 http://yikutian.com

46C94C48-0A8E-C63A-D34F-D289033F0F29 34990850-2A47-D5D5-5224-4DB004696AD0 FFCF14FC-7E79-D6CB-1D04-56792EB5E38D 94AB21E8-7B43-FE66-1783-2EE9CE817976 DD274F81-91B0-C479-8360-A7F719416BF8 652A58B3-9D84-0091-B10A-6689DA90FC15 D47EDD89-6D6C-435F-8F6C-9839C8ACAFCC AE1AE088-F928-63A7-36ED-3BA15CA9EE06 C9502E2B-266C-1ABD-ED91-4F7A4999B562 3872D297-472A-CBAE-DF10-B5B8923C5297 F7F197BB-58BA-5F56-37C5-BF258D33B013 4BCE50AD-5684-879B-B932-88DE2422414C 33310506-61B1-F7AC-1031-833ECB8425B1 1264C91C-8B5C-ED0B-F8D3-5F0FA79493EA E24D76C7-B3DF-1537-9103-437066552A76 F65E8E64-1A1D-11BC-9F9F-C6A801D321E3 EE65ED18-B587-A7EA-86E0-E65590D615F7 72D0B9EF-5C67-EE65-DDA2-E0947825B17B 41DFBFBB-AEA1-269D-5908-C39D0F6F6E29 82EEE258-2F02-0A98-ADAA-D8D4243BFA0

2)TimeSpan:时间戳,当前时间即可(格式yyyyMMddHHmmss)

3)OriginLang:分别为zh-CN、en、ja

4)TransLang:分别为zh-CN、en、ja

5)Data:带翻译的内容,如 你好

2)批量翻译

请求地址:http://yikutian.com/api/batchtranslation?AppKey=XX&TimeSpan=XXXOriginLang=XXX&TransLang=translationSource=[{"Key":"1","Source":"测试1"},{"Key":"2","Source":"测试2"}]

返回结果:

{"Data":"[{"Key":"1","Target":"test 1"},{"Key":"2","Target":"test 2"}]","Success":true,"Message":"批量翻译成功!"}

3)谷歌翻译语种码

语言 Language ISO-639-1 Code
南非荷兰语 Afrikaans af
阿尔巴尼亚语 Albanian sq
阿姆哈拉语 Amharic am
阿拉伯语 Arabic ar
亚美尼亚语 Armenian hy
阿泽尔拜贾尼 Azeerbaijani az
巴士克语 Basque eu
比利时语 Belarusian be
孟加拉语 Bengali bn
波斯尼亚语 Bosnian bs
保加利亚语 Bulgarian bg
加泰隆语 Catalan ca
宿务 Cebuano ceb (ISO-639-2)
中文(简体) Chinese (Simplified) zh-CN (BCP-47)
中文(繁体) Chinese (Traditional) zh-TW (BCP-47)
科西嘉岛 Corsican co
克罗地亚语 Croatian hr
捷克语 Czech cs
丹麦语 Danish da
荷兰语 Dutch nl
英语 English en
世界语 Esperanto eo
爱沙尼亚语 Estonian et
芬兰语 Finnish fi
法语 French fr
弗里斯兰语 Frisian fy
加利西亚语 Galician gl
乔治亚语 Georgian ka
德语 German de
希腊语 Greek el
古吉拉特语 Gujarati gu
海地克里奥尔语 Haitian Creole ht
豪撒语 Hausa ha
夏威夷人 Hawaiian haw (ISO-639-2)
希伯来语 Hebrew iw
Hindi hi
苗族 Hmong hmn (ISO-639-2)
匈牙利语 Hungarian hu
冰岛语 Icelandic is
伊博语 Igbo ig
印度尼西亚语 Indonesian id
爱尔兰语 Irish ga
意大利语 Italian it
日语 Japanese ja
爪哇语 Javanese jw
卡纳拉语 Kannada kn
哈萨克语 Kazakh kk
高棉语 Khmer km
朝鲜语 Korean ko
库尔德语 Kurdish ku
吉尔吉斯语 Kyrgyz ky
Lao lo
拉丁语 Latin la
拉脱维亚语 Latvian lv
立陶宛语 Lithuanian lt
卢森堡语 Luxembourgish lb
马其顿语 Macedonian mk
马达加斯加语 Malagasy mg
马来语 Malay ms
马拉雅拉姆语 Malayalam ml
马耳他语 Maltese mt
毛利语 Maori mi
马拉地语 Marathi mr
蒙古语 Mongolian mn
缅甸(缅甸语) Myanmar (Burmese) my
尼泊尔语 Nepali ne
挪威语 Norwegian no
尼扬贾(奇切瓦) Nyanja (Chichewa) ny
普什图语 Pashto ps
波斯语 Persian fa
波兰语 Polish pl
葡萄牙语(葡萄牙、巴西) Portuguese (Portugal, Brazil) pt
旁遮普语 Punjabi pa
罗马尼亚 Romanian ro
俄语 Russian ru
萨摩亚语 Samoan sm
苏格兰盖尔语 Scots Gaelic gd
塞尔维亚语 Serbian sr
塞索托语 Sesotho st
绍纳语 Shona sn
信德语 Sindhi sd
僧伽罗语(僧伽罗语) Sinhala (Sinhalese) si
斯洛伐克语 Slovak sk
斯洛文尼亚语 Slovenian sl
索马里语 Somali so
西班牙语 Spanish es
巽他语 Sundanese su
斯瓦希里语 Swahili sw
瑞典语 Swedish sv
他加禄语(菲律宾语) Tagalog (Filipino) tl
塔吉克斯坦 Tajik tg
泰米尔语 Tamil ta
泰卢固语 Telugu te
泰语 Thai th
土耳其语 Turkish tr
乌克兰语 Ukrainian uk
乌都语 Urdu ur
乌兹别克语 Uzbek uz
越南语 Vietnamese vi
威尔士语 Welsh cy
班图语 Xhosa xh
意第绪语 Yiddish yi
约鲁巴语 Yoruba yo
祖鲁语 Zulu zu
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net6.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.1.0 201 6/15/2023
2.0.0 157 6/15/2023
1.0.3 445 10/13/2022
1.0.2 410 10/13/2022
1.0.1 397 10/12/2022
1.0.0 400 10/11/2022