https://github.com/angelodotnet/multilanguageapicustomextensions
https://github.com/angelodotnet/multilanguageapicustomextensions
custom extension hacktoberfest hacktoberfest-accepted library multilanguage net6
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/angelodotnet/multilanguageapicustomextensions
- Owner: AngeloDotNet
- Created: 2023-03-15T19:04:14.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-03-16T19:24:02.000Z (over 3 years ago)
- Last Synced: 2025-03-15T08:55:48.112Z (over 1 year ago)
- Topics: custom, extension, hacktoberfest, hacktoberfest-accepted, library, multilanguage, net6
- Language: C#
- Homepage:
- Size: 12.7 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Multi Language Api Custom Extensions
If you like this repository, please drop a :star: on Github!
## Installation
The library is available on [NuGet](https://www.nuget.org/packages/MultiLanguageApiCustomExtensions) or run the following command in the .NET CLI:
```bash
dotnet add package MultiLanguageApiCustomExtensions
```
## Registering services at Startup
```csharp
public Startup(IConfiguration configuration)
{
Configuration = configuration;
}
public IConfiguration Configuration { get; }
public void ConfigureServices(IServiceCollection services)
{
var supportedCultures = new[] { "en", "it" };
services.AddSupportedCultures(supportedCultures);
}
//OMISSIS
public void Configure(WebApplication app)
{
app.UseLocalizationConfiguration();
}
```
Note: The supportedCultures values can be changed to suit your needs.
But remember to create the resx files of the supported languages in the resources folder, setting the access modifier to Public.