Radanweb.Extensions.Translations
1.2.0
dotnet add package Radanweb.Extensions.Translations --version 1.2.0
NuGet\Install-Package Radanweb.Extensions.Translations -Version 1.2.0
<PackageReference Include="Radanweb.Extensions.Translations" Version="1.2.0" />
paket add Radanweb.Extensions.Translations --version 1.2.0
#r "nuget: Radanweb.Extensions.Translations, 1.2.0"
// Install Radanweb.Extensions.Translations as a Cake Addin
#addin nuget:?package=Radanweb.Extensions.Translations&version=1.2.0
// Install Radanweb.Extensions.Translations as a Cake Tool
#tool nuget:?package=Radanweb.Extensions.Translations&version=1.2.0
Amir Shadi: Amir.Shadi.Pc@Gmail.Com
Add This Code Into Program.cs File
builder.Services.AddRadanwebParrotTranslator(c ⇒ { c.ConnectionString = "Server=.; Initial Catalog=YourDatabaseName; User Id=User; Password=Password"; c.AutoCreateSqlTable = true; c.SchemaName = "dbo"; c.TableName = "ParrotTranslations"; // Table Name c.ReloadDataIntervalInMinuts = 1; c.DefaultTranslations = new DefaultTranslationOption[] { new() { Key = "TITLE", Value = "عنوان", Culture = "fa-IR" }, new() { Key = "TITLE", Value = "عنوان", Culture = "ar-SA" }, new() { Key = "TITLE", Value = "Title", Culture = "en-US" }, }; });
Add Controller And Copy This Codes In It(Example)
[Route("api/[controller]")] [ApiController] public class ParrotController : ControllerBase { private readonly ITranslator _translator;
public ParrotController(ITranslator translator)
{
_translator = translator;
}
[HttpGet(Name = "GetTranslation")]
public IActionResult Get(string key)
{
return Ok(_translator.GetString(key));
}
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net7.0 is compatible. 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. |
-
net7.0
- Dapper (>= 2.0.123)
- Microsoft.Extensions.Logging.Abstractions (>= 7.0.0)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 7.0.0)
- System.Data.SqlClient (>= 4.8.5)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.