Skip to content

ericbrunner/AspNetCoreLocalizationWithMSSQL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Localization.SqlLocalizer
.net core Build status NuGet Status

========================

Documentation: http://localizationsqllocalizer.readthedocs.io/en/latest/

NuGet | Issues | Code

Basic Usage ASP.NET Core

Add the NuGet package to the project.json file

"dependencies": {
        "Localization.SqlLocalizer": "1.0.9",

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

========================

ASP.NET Core MVC Localization Example

About

Forked from https://github.com/damienbod/AspNet5Localization/ and added AZURE MS SQL Server EF support

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages