Questions tagged [asp.net-core-localization]

ASP.NET Core Localization is the set of abstractions and implementations that allow developers to adapt their ASP.NET Core applications to a particular language, culture, and desired local "look and feel".

See Also

130 questions
3
votes
6 answers

How can I maintain Language between 3 websites?

I have three websites setup. Lets call them User Portal, Admin Portal, Login Portal. Both Admin and User Portal will use Login Portal to authenticate, however the two will serve different content. My problem is this. If I am on User Portal and I…
Bagzli
  • 5,388
  • 14
  • 58
  • 124
3
votes
1 answer

Localization is not working building the application in Release mode with docker-compose (Docker for Linux) in VS2017

I am developing an application in Asp.net core that uses some translations depending on the language of the user. In my controller, I am trying to load the error message from a .resx file. I have multiple ones depending on the language: …
3
votes
0 answers

Localization asp .net core email templates

I have used localization globalization throughout my site (following the instructions in https://docs.microsoft.com/en-us/aspnet/core/fundamentals/localization?view=aspnetcore-2.1). The site is an asp.net core 2.0 MVC web application. The resources…
Harry_C
  • 155
  • 1
  • 1
  • 10
3
votes
3 answers

Localization with SharedResources not working in .NET Core 2.1

I've been fighting with this problem for hours... and I can't find what it is... I'm just trying to localize the _Layout.cshtml file. Both the IStringLocalizer and the IHtmlLocalizer do not seem to find the Resource files. I've followed and searched…
Jose A
  • 7,443
  • 8
  • 49
  • 77
3
votes
1 answer

ASP.NET Core 2.0 Translations always in English

I'm currently developing a multilanguage ASP.NET Core 2.0-website. I read the official documantion and investigated the example provided on GitHub. Below is the folder structure of the project: Grabbed code from my Startup.cs: public void…
user2810895
  • 1,084
  • 2
  • 14
  • 29
3
votes
3 answers

ASP.NET Core Model Binding Error Messages Localization in ASP.NET CORE 2.0

In ASP.NET CORE 1.1 it was possible to localize model binding error messages using a resource file and configure its options to set message accessors for ModelBindingMessageProvider in the Startup.cs like services.AddMvc(options => { var F =…
3
votes
0 answers

Localization not working after changing .NET core project target framework from .NetCoreApp 1.0 to 1.1

Localization in my not .NET core project stopped working after changing target framework from .NetCoreApp 1.0 to 1.1 (nothing else was modified), here is the application startup code. I use a custom culture provider, so I verified that it returns…
Marko
  • 1,108
  • 3
  • 17
  • 33
3
votes
0 answers

Change default Culture/Decimal localization

I´m having a problem when trying to use a view Model that as a decimal property. Because my decimal region/culture format uses "," and not "." as decimal separator. When I try to post that model, I get the following error: The value xxx is not…
2
votes
0 answers

Best approach to localise reference data in ASP.NET Core / EF Core

I'm working on an ASP.NET Core 3.1 (w/EF Core 3.1) application that contains entities such as Country and State, whose field Description needs to be localized. The app will be available in several countries, and of course in each language the…
2
votes
1 answer

Localization in ASP.NET Core 3.0

I'm trying to make my project Localized, using .resx files. For me it does not work, for my colleague, who is working on the project too it works. Some details about the code: Startup.cs file public void ConfigureServices(IServiceCollection…
Lukas
  • 61
  • 7
2
votes
0 answers

C# QueryStringRequestCultureProvider localization doesn't work

I have setup localization in my ASP.Net Core Web API project following this documentation: docs. When I change the default request culture in my Startup.cs: services.Configure(options => { …
Eutherpy
  • 4,001
  • 3
  • 26
  • 53
2
votes
1 answer

Asp.net core localization Is there any way to allow all cultures?

I want to allow all cultures in my application. As you can see below, I'm allowing few cultures. And I'm having a custom provider that will get the user's culture. If his culture isn't in the SupportedCultures that means I can't handle his culture…
2
votes
1 answer

How to override Json.Net model binding exception messages for localization purposes?

I've overridden all model binding messages with translations using ModelBindingMessageProvider.SetValueIsInvalidAccessor and other ModelBindingMessageProvider values to return my custom resource strings. And then I discovered the sad truth. If my…
JustAMartin
  • 11,620
  • 18
  • 85
  • 156
2
votes
2 answers

Time format based on locale in asp.net core

Is it possible to change the time format based on the locale? Let's take below scenarios Norway - 24hr time format is vastly used Sweden - 24hr time format is vastly used Switzerland German region - 12hr format is vastly used Germany - 24hr…
2
votes
1 answer

.NET Core 2.0 IViewLocalizer write the key instead of the text

I'm currently trying to build in a localizer into my application. After reading the Microsoft Documentation I added all the necessary parts, so it should work in theory. But on the first startup and reloading the page I only can see the keys instead…
Yannik
  • 393
  • 2
  • 4
  • 17
1 2
3
8 9