Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/NetCoreStack/Localization
🌏 Database Resource Localization for .NET Core with Entity Framework and In Memory Cache
https://github.com/NetCoreStack/Localization
entity-framework entity-framework-core globalization-and-localization localization localization-management net netcore
Last synced: about 2 months ago
JSON representation
🌏 Database Resource Localization for .NET Core with Entity Framework and In Memory Cache
- Host: GitHub
- URL: https://github.com/NetCoreStack/Localization
- Owner: NetCoreStack
- License: mit
- Created: 2018-05-10T07:38:12.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-01-06T23:52:18.000Z (almost 6 years ago)
- Last Synced: 2024-04-26T22:33:15.591Z (8 months ago)
- Topics: entity-framework, entity-framework-core, globalization-and-localization, localization, localization-management, net, netcore
- Language: C#
- Homepage: https://netcorestack.github.io/Localization/
- Size: 1010 KB
- Stars: 86
- Watchers: 14
- Forks: 13
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-dotnet-core - NetCoreStack.Localization - Database Resource Localization for .NET Core with Entity Framework and In Memory Cache (Frameworks, Libraries and Tools / Internationalization)
- awesome-dotnet-core - NetCoreStack.Localization - 具带有实体框架和内存缓存中的.NET Core的数据库资源本地化库。 (框架, 库和工具 / 国际化)
- fucking-awesome-dotnet-core - NetCoreStack.Localization - Database Resource Localization for .NET Core with Entity Framework and In Memory Cache (Frameworks, Libraries and Tools / Internationalization)
- awesome-dotnet-core - NetCoreStack.Localization - Database Resource Localization for .NET Core with Entity Framework and In Memory Cache (Frameworks, Libraries and Tools / Internationalization)
README
# NetCoreStack Localization v1.0.6
## Database Resource Localization for .NET Core with Entity Framework and In Memory Cache
[![NuGet](https://img.shields.io/nuget/v/NetCoreStack.Localization.svg?longCache=true&style=flat-square)](https://www.nuget.org/packages/NetCoreStack.Localization)
[![NuGet](https://img.shields.io/nuget/dt/NetCoreStack.Localization.svg?longCache=true&style=flat-square)](https://www.nuget.org/packages/NetCoreStack.Localization)## Links
* **Online Demo Page:** [http://netcorestack-localization-test.herokuapp.com/](http://netcorestack-localization-test.herokuapp.com/)* **Docs:** [https://netcorestack.github.io/Localization/](https://netcorestack.github.io/Localization/)
* **Latest release on Nuget:** [https://www.nuget.org/packages/NetCoreStack.Localization](https://www.nuget.org/packages/NetCoreStack.Localization)
* **Docker Image:** [https://hub.docker.com/r/tahaipek/netcorestack-localization-test-hosting](https://hub.docker.com/r/tahaipek/netcorestack-localization-test-hosting)
## Docker File
```
PM> docker pull tahaipek/netcorestack-localization-test-hosting
PM> docker run -d -p 5003:80 netcorestack-localization-test-hosting
```## Requirements:
* .NET Core 2.1 or later
* SQLite or MsSQL Server### Install for .NET Core
```
PM> Install-Package NetCoreStack.Localization
```## Features
* .NET Core Resources in MsSql Server
* Injectable .NET Core StringLocalizers
* Serve Resources to JavaScript as JSON
* Directly access and manage Languages/Resources with api and code## Installation
### **AppSettings Configuration**
Configuration settings in `AppSettings.json`:
```json
{
"DbSettings": {
"SqlConnectionString": "Server=.;Database=LocalizationTest;Trusted_Connection=True;MultipleActiveResultSets=true"
},
"LocalizationSettings": {
"UseDefaultLanguageWhenValueIsNull": true
}
}
```
### **Enable NetCoreStack.Localization in ASP.NET Core**
```csharp
public void ConfigureServices(IServiceCollection services)
{
services.AddNetCoreStackMvc(options => { options.AppName = "NetCoreStack Localization"; });
services.AddNetCoreStackLocalization(Configuration);
}
``````csharp
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
app.UseNetCoreStackMvc();
app.UseNetCoreStackLocalization();
}
```### **Client-side localization in \*.cshtml file**
```html
@Localizer["Logo_Description"]```
### **Back-end Localization in \*.cs file**
```csharp
public class HomeController : Controller
{
private readonly IStringLocalizer _stringLocalizer;
public HomeController(IStringLocalizer stringLocalizer)
{
_stringLocalizer = stringLocalizer;
}public IActionResult About()
{
ViewData["Message"] = _stringLocalizer["AboutPageDescription"];
return View();
}
}
```### **Test Project Preview**
| How To Use | Forms & Validations|
| ------------- | ------------- |
| | || Component Api | Client-Side Localization|
| ------------- | ------------- |
| | || Exception Localization | AjaxException Localization |
| ------------- | ------------- |
| | |---------
#### .Net Core Localization
#### .Net Core Localization with Entity Framework
#### .Net Core Database Localization