Virtuesoft.Framework.TranslateService.Aspnetcore 6.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Virtuesoft.Framework.TranslateService.Aspnetcore --version 6.0.0                
NuGet\Install-Package Virtuesoft.Framework.TranslateService.Aspnetcore -Version 6.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="Virtuesoft.Framework.TranslateService.Aspnetcore" Version="6.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Virtuesoft.Framework.TranslateService.Aspnetcore --version 6.0.0                
#r "nuget: Virtuesoft.Framework.TranslateService.Aspnetcore, 6.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 Virtuesoft.Framework.TranslateService.Aspnetcore as a Cake Addin
#addin nuget:?package=Virtuesoft.Framework.TranslateService.Aspnetcore&version=6.0.0

// Install Virtuesoft.Framework.TranslateService.Aspnetcore as a Cake Tool
#tool nuget:?package=Virtuesoft.Framework.TranslateService.Aspnetcore&version=6.0.0                

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 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.

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
6.0.1 455 8/8/2022
6.0.0 450 1/18/2022
1.1.4 280 12/25/2021
1.1.3 270 12/25/2021
1.1.2 343 12/14/2021
1.1.1 306 12/14/2021
1.1.0 339 12/14/2021
1.0.9 302 12/14/2021
1.0.8 335 12/14/2021
1.0.7 286 12/14/2021
1.0.6 423 10/6/2021
1.0.4 361 10/5/2021
1.0.3 296 10/5/2021
1.0.2 320 10/5/2021
1.0.1 289 10/5/2021
1.0.0 296 10/4/2021

翻译服务aspnetcore扩展