Documentation: https://damienbod.com/2016/05/26/released-sql-localization-nuget-package-for-asp-net-core-dotnet/
Release History
Version 1.0.1
- Added Unique constraint for key, culture
- Fixed type full name cache bug
Version 1.0.0
- Initial release
- Runtime localization updates
- Cache support, reset cache
- ASP.NET DI support
- Supports any Entity Framework Core database
Basic Usage ASP.NET Core
Add the NuGet package to the project.json file
"dependencies": {
"Localization.SqlLocalizer": "1.0.0.0",
Add the DbContext and use the AddSqlLocalization extension method to add the SQL Localization package.
public void ConfigureServices(IServiceCollection services)
{
// init database for localization
var sqlConnectionString = Configuration["DbStringLocalizer:ConnectionString"];
services.AddDbContext<LocalizationModelContext>(options =>
options.UseSqlite(
sqlConnectionString,
b => b.MigrationsAssembly("Angular2LocalizationAspNetCore")
)
);
// Requires that LocalizationModelContext is defined
services.AddSqlLocalization(options => options.UseTypeFullNames = true);
Create your database
dotnet ef migrations add Localization --context localizationModelContext
dotnet ef database update Localization --context localizationModelContext
========================