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

Asynchronous localization with custom resource storage in asp.net core

I'm using custom storage for IStringLocalizer in .net core which has async method to get resources. I'd like to have it async all the way long. Here's snippet: public class CustomStringLocalizer : IStringLocalizer { public…
0
votes
0 answers

Resources for class in different project

I have two project in my solution. DataAccess - with core models to be shared in other components such as services etc. Web - net core web app I need to use localization for data anotions -…
Jaroslav Langer
  • 121
  • 1
  • 11
0
votes
1 answer

Asp.Net Core - Access IStringLocalizer instance form static class

Is there better way to inject IStringLocalizer object into static class so that I would not use method injection and pass localizer instance from view to the extension method each time? Here's my view code @using…
0
votes
1 answer

Netcore 2.2 Localized Routing - Route values for default culture always ignored

Successfully using the project laid out at Localized routing using ASP.NET Core MVC 2. The project is developed to display the Default language using just the controller/Action and Localized Routes for the alternate languages. My…
0
votes
1 answer

Netcore 2.2 Localized Routing - How to always redirect to default route

Successfully using the project laid out at Localized routing using ASP.NET Core MVC 2 however there are a few modifications I'd like to make and I'm not clear on how to go about. Currently my start.cs looks like the below, this works fine however…
0
votes
1 answer

How to add or remove SharedResource.xx.resx file records in admin panel

I'm using ASP.NET Core IStringLocalizer interface to implement localization and localize strings in my web application. Currently, I add or remove resx file records in VisualStudio and publish them. but I want that admins to be able to change…
Saleh Bagheri
  • 384
  • 3
  • 16
0
votes
2 answers

How to localize default validation message for value-type (ushort) properties if value is out of the type boundaries?

I have some web form where user should enter the port number. Of course the best type for the port number is ushort. I use RangeAttribute to validate the port number and some error message. [Required(ErrorMessage = "The field is…
0
votes
0 answers

dotnet core localization does not work on linux

I have created .net core 2.2 mvc application. also added localization it works fine on my local windows machine, but after deployment to linux, localization does not work. what am I missing ?
Nario
  • 541
  • 5
  • 16
0
votes
0 answers

How to use localization in Asp.Net Core with Generic Controller

I've worked on Asp.Net Core web application. I've tried to use localization with my generic controller like this: public class ManageController : Controller where TUser : IdentityUser, new() where TKey…
Jenan
  • 2,956
  • 10
  • 52
  • 99
0
votes
1 answer

Get folders from a class library

I have a Startup.cs file where I need to access resources files from "Resources" folder in a different class library. I tried specifying path to dll and get all files from dll. I'm not sure how to get folder "Resources" from dll. This is what I…
user989988
  • 1,051
  • 11
  • 28
0
votes
1 answer

Resource files from Resource folder

I have 3 resource files: /Resources/Values.en-US.resx /Resources/Values.es-ES.resx /Resources/Values.fr-FR.resx (English, Spanish, French) From here I want to 'scan' what languages (from these resource files) are available so I can put them in a…
user989988
  • 1,051
  • 11
  • 28
0
votes
2 answers

Redirect To Default Culture, if culture does not specified in url

I'm trying to do something like what is microsoft used for docs site. for example when I enter the link below in addressbar, microsoft docs site redirects me to default cultured link as what is in second link. first link:…
0
votes
1 answer

IStringLocalizer vs resource.designer.cs

I don't really like the idea of injecting localizer, what's wrong with the classic approach of having a class with static properties generated? It's much easier to use than injecting IStringLocalizer everywhere I want to localize. I understand that…
Konrad
  • 4,264
  • 8
  • 33
  • 71
0
votes
0 answers

asp.net translation function gives junk letters for non-English characters when used in javascript file

We were using window. resourcekeytotranslationmap function to get the localized strings from javascript file. The function gives junk characters for non-english letters. Is there any other function that can be used
0
votes
1 answer

ASP.NET Core 2.1 Localization Options SupportedCultures always contains only English

I want to setup localization in my ASP.NET Core 2.1. I build the RequestLocalizationOptions object with 6 supported cultures and configure the services, but when retrieving these options (the localizationOptions object in the code sample below), the…
1 2 3
8
9