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
1
vote
1 answer

ASP Net core - How to implement background services localization?

In posted here a question asking about best implementation of deleting inactive users in ASP NET core app. Ian Kemp suggested background service for that and I really liked this. Now I'm wondering how to implement localizer into background service…
1
vote
2 answers

Localized DisplayAttribute of Enum in ASP.Net Core 2.2

I have an ASP.Net Core 2.2 MVC application and I'm looking for some help with a specific case. I have setup localization with resource files for 8 languages and this is working fine, both server and client side including the translation of Enum…
RJD
  • 101
  • 1
  • 9
1
vote
2 answers

How to localize text in asp.net.core Model?

I can't find any examples on how to localize text within a C# asp.net.core application. I would appreciate any help. I'm assuming that I need to use StringLocalizaer somehow. Thanks using System.Collections.Generic; using…
Jason V
  • 705
  • 6
  • 15
1
vote
1 answer

Asp.net core web api Localization DataAnnotation custom attribute

I'm trying to use localization with resource files, but it's not working, just for custom required attribute public class RequiredIntAttribute : RequiredAttribute { public override bool IsValid(object value) { bool isValid =…
1
vote
0 answers

Asp.net Core MVC View Localization IsResourceNotFound = true in other than default locale

I want to add localization in my ASP.NET CORE MVC app with ar-SA as default localization. i configured every thing as per bellow links. my default locale is ar-SA and work good. but when i change locale to en-US IsResourceNotFound is always true…
1
vote
0 answers

Allowing routes with and without {culture} (.net core 2.2)

UPDATE: I got it working - added the following to the routes: [Route("{culture}/[action]")] [Route("/[action]")] Problem is now when I am on /da/about it won't add the /da/ to the links generated on the AnchorTagHelper. Trying to allow culture in…
1
vote
4 answers

Localization in Blazor WebAssembly

I am trying to implement localization for a Blazor WebAssembly app. I followed the example referred in the Documentation. I created the .resx files as per the example but my Blazor WebAssembly app does only show the string for the default .resx file…
donquijote
  • 1,482
  • 4
  • 16
  • 36
1
vote
0 answers

Asp.NET Core unpredictable localization result

I have implemented localization in my ASP.Net Core 3.0 Web API project following this documentation: docs. I did everything pretty much the same way as the examples show, but for the sake of completeness I will post the relevant pieces of my code…
Eutherpy
  • 4,001
  • 3
  • 26
  • 53
1
vote
1 answer

Request-based Localization of Razor pages in Asp.Net Core

My application is hosted by a server located in the US. I live in the UK. When I open the page locally I can see the proper format of the date dd/mm/yyyy based on the place I live, however, when I deploy the app to Azure US app service, and open it…
1
vote
1 answer

ASP.Net Core: set default culture from controller

I am trying to set up localization in my ASP.Net Core Web API project. I did some research and understand that there is a localization middleware with predefined request culture providers (which in my case are not acceptable), so I need to write a…
Eutherpy
  • 4,001
  • 3
  • 26
  • 53
1
vote
1 answer

Can not get url with query string when changing culture

Culture info is not get query string when I change a language from English to German. Startup.cs services.Configure(options => { var supportedCultures = new[] { …
1
vote
0 answers

ASP.Net MVC Core refuses to set current culture correctly for views

Please help me because I'm losing my mind here :-( I'm trying to figure out how ASP.Net MVC Core Localization works. I worked according to MS's tutorial but to no avail. Long story short: I'm configuring RequestLocalizationOptions to default to…
user884248
  • 1,873
  • 2
  • 27
  • 49
1
vote
2 answers

How to define a global resource .resx file per language?

I doing a Localization for one site. but I found that I need to define a new ".resx" per View or Controller. is there are a way to set up a global file per each language instead of creating a file per (number of Localization) * views? Thanks in…
Abdulrhman
  • 25
  • 6
1
vote
2 answers

ASP.NET Core custom validation error message not localized

I want to implement localization in a custom attribute to check if the property is a valid IP address or hostname. The validation is working fine so far, but my problem is that I only get the default english error message though my local is switched…
1
vote
0 answers

Problem localizing Display(Name=."..") data annotation attribute using Portable Objects (Orchard Core .po) in Asp.Net Core

Screenshot: I am using Portable Object (PO) files in an ASP.NET Core(2.1.1) application with the Orchard Core framework. I followed the instructions in…
1 2 3
8 9