Virtuesoft.Framework.TranslateService.Abstractions 6.0.1

dotnet add package Virtuesoft.Framework.TranslateService.Abstractions --version 6.0.1                
NuGet\Install-Package Virtuesoft.Framework.TranslateService.Abstractions -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.Abstractions" 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.Abstractions --version 6.0.1                
#r "nuget: Virtuesoft.Framework.TranslateService.Abstractions, 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.Abstractions as a Cake Addin
#addin nuget:?package=Virtuesoft.Framework.TranslateService.Abstractions&version=6.0.1

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

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 (6)

Showing the top 5 NuGet packages that depend on Virtuesoft.Framework.TranslateService.Abstractions:

Package Downloads
Virtuesoft.Framework.TranslateService.Aspnetcore

翻译服务aspnetcore扩展 新增文件夹配置服务 更新到.NET6

Virtuesoft.Framework.TranslateService.Aliyun

aliyun 翻译服务,字符长度限制5000,QPS限制50

Virtuesoft.Framework.TranslateService.Gateaway

针对接口的翻译插件

Virtuesoft.Framework.TranslateService.Caching.SqlServer

翻译服务sqlserver缓存

Virtuesoft.Framework.TranslateService.Tencent

腾讯云 翻译服务,单接口每秒不超过5次

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
6.0.1 1,119 8/8/2022
6.0.0 1,467 1/18/2022
1.0.0 2,676 10/4/2021

翻译服务中间件基类