Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/maliming/Owl.Abp.CultureMap
https://github.com/maliming/Owl.Abp.CultureMap
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/maliming/Owl.Abp.CultureMap
- Owner: maliming
- License: lgpl-3.0
- Created: 2020-03-05T07:26:34.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-07T02:18:38.000Z (about 2 years ago)
- Last Synced: 2024-10-28T11:29:47.776Z (3 months ago)
- Language: C#
- Size: 5.82 MB
- Stars: 32
- Watchers: 3
- Forks: 7
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-abp - Owl.Abp.CultureMap - - help you map the language code to the specified language (Modules / Community)
README
# Owl.Abp.CultureMap
it can help you map the language code to the specified language.
[![Nuget](https://img.shields.io/nuget/v/Owl.Abp.CultureMap?style=plastic)](https://www.nuget.org/packages/Owl.Abp.CultureMap)
## Install
```ps
dotnet add package Owl.Abp.CultureMap
```## Getting Started
```c#
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure(options =>
{
options.Languages.Add(new LanguageInfo("en", "en", "English"));
options.Languages.Add(new LanguageInfo("zh-Hans", "zh-Hans", "简体中文"));
options.Languages.Add(new LanguageInfo("tr", "tr", "Türkçe"));
});Configure(options =>
{
var zhHansCultureMapInfo = new CultureMapInfo
{
TargetCulture = "zh-Hans",
SourceCultures = new List
{
"zh", "zh-CN"
}
};options.CulturesMaps.Add(zhHansCultureMapInfo);
options.UiCulturesMaps.Add(zhHansCultureMapInfo);
});
}public override void OnApplicationInitialization(ApplicationInitializationContext context)
{
var app = context.GetApplicationBuilder();//...
app.UseOwlRequestLocalization();
//...
}
```## Example
[BookStore](https://github.com/maliming/Owl.Abp.CultureMap/tree/master/example/BookStore)