Virtuesoft.Framework.TranslateService.Gateaway
6.0.1
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Virtuesoft.Framework.TranslateService.Gateaway --version 6.0.1
NuGet\Install-Package Virtuesoft.Framework.TranslateService.Gateaway -Version 6.0.1
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="Virtuesoft.Framework.TranslateService.Gateaway" Version="6.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Virtuesoft.Framework.TranslateService.Gateaway --version 6.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Virtuesoft.Framework.TranslateService.Gateaway, 6.0.1"
#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 Virtuesoft.Framework.TranslateService.Gateaway as a Cake Addin #addin nuget:?package=Virtuesoft.Framework.TranslateService.Gateaway&version=6.0.1 // Install Virtuesoft.Framework.TranslateService.Gateaway as a Cake Tool #tool nuget:?package=Virtuesoft.Framework.TranslateService.Gateaway&version=6.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Virtuesoft.Framework.TranslateService
集成翻译项目,支持aspnetcore,支持gateaway插件.
同时支持阿里云翻译,腾讯云翻译,google翻译
缓存支持 文件缓存,sql缓存.默认使用ICacheMemery
开箱即用,简单方便!
Aspnetcore 使用
using Virtuesoft.Framework.TranslateService;
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
//builder.Services.AddRazorPages();
builder.Services
.AddTranslateService()
//.AddTencent(option =>
//{
// option.SecretId = "";
// option.SecretKey = "";
// option.Region = "ap-hongkong";
//})
.AddAliyun(option =>
{
option.AccessKey = "";
option.Secret = "";
option.RegionId = "cn-hangzhou";
option.ContentSence = "general";
option.SourceLanguage = "zh";
})
.AddSqlServerCache(option =>
{
option.ConnectionString = "";
})
.AddAspnetcore(option =>
{
option.QueryPrameter = "language";
option.HeaderName = "language";
option.ExcludePaths = new string[] { "/pages/index.html"};
//option.ContentTypeCollections = new string[] { };
})
.BuildServices()
.AddLogging();
var app = builder.Build();
app.UseTranslate();
app.UseStaticFiles();
app.Run((content) => {
//var buffer = Encoding.UTF8.GetBytes("这是一个,一个哈哈哈消息");
return content.Response.WriteAsJsonAsync(new { messge = "这是一个,一个哈哈哈消息,哈哈哈,哈哈哈,哈哈哈.sdfasf 发收到菲拉斯积分爱福窝饿爱今日份老师的课干嘛说经费i哦啊就发给v撒发生的发生那么大,砀山分公司奋斗i感觉我让美女给对方公司DNF共轭碱如果年底发那个科技时代计日工i二极管对方公司等你们" ,type= "这是翻译的文件,<div class='index - module_textWrap_3ygOc '><p><span class='bjh - p'>日前,中共中央政治局召开党史学习教育专题民主生活会,习近平总书记强调,“让正史成为全党全社会的共识,教育广大党员、干部和全体人民特别是广大青年坚定历史自信、筑牢历史记忆,满怀信心地向前进”。</span></p></div>" });
});
//app.MapRazorPages();
app.Run("http://*:5000");
Gateaway 使用
using Virtuesoft.Framework.Gateaway;
using Virtuesoft.Framework.TranslateService;
using Virtuesoft.Framework.TranslateService.Caching.DiskServer;
using Virtuesoft.Framework.TranslateService.Gateaway;
var builder = WebApplication.CreateBuilder(args);
builder
.Services
.AddTranslateService()
.AddAliyun(option => {
option.AccessKey = "";
option.Secret = "";
option.RegionId = "cn-hangzhou";
option.ContentSence = "general";
option.SourceLanguage = "zh";
})
.AddDiskServerCache(option => {
option.Path = "language.result";
})
.BuildServices()
.AddGateaway(option => { })
.AddTranslate(option => {
option.QueryPrameter = "language";
option.HeaderName = "language";
})
.BuildServices();
var app = builder.Build();
app.UseGateaway();
app.Run("http://*:5000");
Product | Versions 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
- Virtuesoft.Framework.Gateaway.Abstractions (>= 7.0.2)
- Virtuesoft.Framework.TranslateService.Abstractions (>= 6.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.