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
49
votes
3 answers

ASP.NET Core Localization with help of SharedResources

Hi I have a question about the SharedResources file. It is glanced over in the tutorial here: https://docs.microsoft.com/en-us/aspnet/core/fundamentals/localization, and I'm not sure if I get it correctly. I am supposed to create a…
31
votes
2 answers

ASP.NET Core Model Binding Error Messages Localization

I'm using ASP.NET Core, and trying to localize the application. I managed to use new asp .net core resources to localize controllers and views, and old resources to localize error messages for model validation. However, when the error message is…
Marko
  • 1,108
  • 3
  • 17
  • 33
15
votes
8 answers

ASP.Net Core localization

ASP.Net core features new support for localization. In my project I need only one language. For most of the text and annotations I can specify things in my language, but for text coming from ASP.Net Core itself the language is…
14
votes
3 answers

How to Localize validation message (DataAnnotationsValidator) in blazor server side

I am using blazor 3.1 in latest version of VS 2019. So far, I am able to localize page labels (title, table fields etc.). On the ListEmployee.razor page, I am able to localize table heading etc. On the AddEmplyeeValidation.razor page, I am able to…
Learning
  • 17,618
  • 35
  • 153
  • 314
14
votes
2 answers

How to convert C# Resource File Strings into methods and not just properties?

Example, the EntityFramework Microsoft.EntityFrameworkCore.Relational project has the following text in the resource files: ... The required column '{column}' was not present in the…
peter
  • 11,751
  • 6
  • 52
  • 89
14
votes
1 answer

Understanding Resource files in MVC6 RC1

I've been trying to wrap my head around on how best to implement resource files for multiple languages in MVC6 but due to the changes with every release has me a bit confused on how to actually implement them properly. What is required and what are…
13
votes
5 answers

ASP.NET Core DisplayAttribute Localization

According to the documentation: The runtime doesn’t look up localized strings for non-validation attributes. In the code above, “Email” (from [Display(Name = "Email")]) will not be localized. I'm looking for a way to localize text in…
10
votes
3 answers

How to get resource strings in strongly typed way in asp.net core?

In the following program, in order to get resource strings i am using _localizer["About Title"] where "About Title" is a magic string. How to avoid using strings like this? Is there any strongly typed way? using Microsoft.AspNetCore.Mvc; using…
Vikram Babu Nagineni
  • 2,953
  • 3
  • 21
  • 32
8
votes
1 answer

How to setup a fallback resource file for Views

Using IViewLocalizer I would like to implement view localization with a default or fallback resource file for words and phrases that appear on multiple pages like for example edit, add, delete... I don't want to add these repetitive phrases in the…
7
votes
3 answers

ASP .NET Core 1.0 RTM Localization not working

I've been trying to implement localization for my asp .NET Core 1.0 RTM web app following microsofts documentation and I just can not get it to work. The problem I'm having is that it's always displaying strings from the english resource file no…
7
votes
3 answers

Localization in separate project Asp.net Core MVC

I just upgraded to Rc2 and what used to work no longer does. I have a couple of resx files in a separate project and I use a custom class to access the data. Now I get the following error when running it: MissingManifestResourceException: Could not…
6
votes
1 answer

Get ASP.NET Core model errors in a specific language other than english

I use DataAnnotation for validating models in ASP.NET Core. But when I have a required field, I got the error message in english when its missing like in this example: class MyModel { [Required] [Display(Name = "Seitentitel")] public…
Lion
  • 11,498
  • 13
  • 55
  • 113
5
votes
1 answer

How to localize the error message if unauthorized

It's an asp.net core webapi project, and I simply put the [Authorize] attribute to protect those apis. If user is not authorized, the api will return "401 unauthorized". My question is how can I localize the "401 unauthorized" message if…
Charlie
  • 1,520
  • 1
  • 12
  • 25
5
votes
2 answers

How to use localization in Razor Class Library in Asp.Net Core

I have tried to create the Razor Class Library with Asp.Net Core in following project structure: I have used in my web application these settings for localization in Startup class: …
Jenan
  • 2,956
  • 10
  • 52
  • 99
5
votes
2 answers

ASP.NET Core IViewLocalizer Not pulling my dictionary look-up values

Super frustrated with this one because I can get it working on a "Hello World" application but not my real application. Here's how I'm configured: ConfigureServices: services.AddLocalization(options => options.ResourcesPath =…
smurtagh
  • 490
  • 4
  • 16
1
2 3
8 9