Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/maliming/Owl.Abp.CultureMap


https://github.com/maliming/Owl.Abp.CultureMap

Last synced: 3 months ago
JSON representation

Awesome Lists containing this project

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)