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
5
votes
1 answer

ASP.NET Core 1.1 Localization Generic Service

I'm making a ASP.NET Core 1.1 app and trying to setup localization. When I make on my ValuesController the implementation of IStringLocalizer it works fine and localize my resource file. public ValuesController(IStringLocalizer
Lucas Freitas
  • 866
  • 4
  • 15
  • 33
5
votes
2 answers

ASP.NET Core ValidationAttribute message language

How can I globally overload error messages getting ,for example, from [Required] attribute? Probably, I should change CultureInfo, but I can't find any tutorials. Language still English as default. Thank you!
5
votes
1 answer

Cannot set default and only culture in ASP.Net Core app

I'm working on Polish operating system: In my Statup.csclass I have following code // Configure the localization options var supportedCultures = new[] { new CultureInfo("en-GB") }; …
Marcin
  • 3,088
  • 3
  • 28
  • 47
5
votes
0 answers

Model Validation Error Localization

I am working on an ASP.Net Core web application and need to localize all the static strings we use in the app. I have the Controller and the View strings localized by implementing the IStringLocalizerFactory and adding it as a service in the…
4
votes
1 answer

ASP.NET Core 5.0 RouteDataRequestCultureProvider remove default culture in url

I tried to add multi language feature to my asp.net-core project but there are some changes between .net 3.1 and 5.0 in RequestLocalization and i couldn't get what i want. I added Resource files for each language and I used Resource in my razor…
4
votes
1 answer

Blazor Server-Size with Localized Resource in another project

I’m trying to use the localization feature of ASP.Net Core in my Blazor app. I want to use IStringLocalizer so that I automatically detect the browser language to adapt to the user’s language. My solution consists of several projects and for…
4
votes
2 answers

asp mvc core url localization

I am trying to localize my app's URLs. Unfortunately, most of the pages show me examples of app localization Like : http://localhost/en-US/Home/Index This is not what I want. I would to localize the URLs like…
Dams
  • 115
  • 6
4
votes
0 answers

Asp.net core Localization not pickup others culture except English

I'm building an application Asp.net core 1.1 with localization by URL. I uploaded the solution to https://github.com/hoangnguyenxuan/Spouse/tree/master/VoiConShop Everything is running without any errors. However, It's just English culture running…
4
votes
2 answers

The Language does not change in the ASP.NET Core Web application

I follow the Globalization and localization and Building simple multilingual ASP.NET Core website tutorials to add a language switch for my application. So, I created a partial view @using Microsoft.AspNetCore.Builder @using…
serge
  • 9,891
  • 17
  • 84
  • 142
4
votes
2 answers

IStringLocalizer with third party DI

I'm trying to setup localization following this documentation https://docs.microsoft.com/en-us/aspnet/core/fundamentals/localization I assume that if you use the built in DI it just works however I'm using Simple Injector instead of the build in DI…
Michael Esteves
  • 1,249
  • 3
  • 16
  • 36
4
votes
3 answers

.Net Core Localization View: IViewLocalizer inside Linq expression

i'm writing mvc app in .net core, i have problem with localization, i don't know how to add IViewLocalizer to my grid view. Here is my code: @using NonFactors.Mvc.Grid; @using Microsoft.AspNetCore.Mvc.Localization @inject IViewLocalizer…
4
votes
1 answer

ASP.NET CORE (.NET Framework) and Localization

people. All right? Can someone help me? ASP.NET Core with .Net Framework Subject: Localization I made all the settings according to the documentation. When I use: IStringLocalizer works perfectly…
4
votes
1 answer

Using NumberFormat property in ASP.NET Core

The localization system has changed quite a bit in ASP.NET Core. The CurrentCulture is no longer available in the current thread. I'm trying to set NumberFormat property of CurrentCulture as explained here, in order to customize the format for…
Vahid Amiri
  • 10,522
  • 12
  • 59
  • 102
3
votes
1 answer

ASP.Net Core CookieRequestCultureProvider not working

I have an ASP.Net Core 3.1 app with the following startup.cs (I have tried various combinations of the below configuration based on web searches): public void ConfigureServices(IServiceCollection services) { ... …
Shawn de Wet
  • 5,258
  • 5
  • 45
  • 74
3
votes
2 answers

How to localize standard error messages of validation attributes in ASP.NET Core

How to localize standard error messages of validation attributes in ASP.NET Core (v2.2)? For Example, [Required] attribute has this error message "The xxx field is required."; [EmailAddress] has "The xxx field is not a valid e-mail address.";…
1
2
3
8 9