aspnetcore: Localization — Generic Class and Localization not working

May be a documentation issue, but I try here:

For non generic class, Localization works as expected. But with generic classes, seems that localization does not work.   I tried to localize Identities classes, like AppIdentityUser<TKey>, I tried something like

  • AppIdentityUser.it.resx
  • AppIdentityUser<T>.it.resx
  • AppIdentityUser`1.it.resx (name get by reflection)

But nothing works. I cannot get the properties translated.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 18 (13 by maintainers)

Most upvoted comments

FYI I added an extra property named UseGenericResources on LocalizationOptions to make it easier to control the resource name for generic class. I described everything in details in my blog post Localization & Generics

Yep, but there’s no resource file related to the class, but seems the issue more than that I think I will start debugging the localization source …

@hishamco Are you sure? What that file?

But this is a first time I see someone trying to localize a generic class, nothing but still i’m not sure if we really need to localize such classes because T is a generic type

Well, if you want to localize Identity classes, you will soon see that we really need to localize such classes…

And, I do not want to use empty class as wrapper, and pollute my projects, just because ASP.NET Core MVC, is once again, buggy… But thanks @hishamco for all your engagement/serious. You are more professional than MS guys…

@Eilon you wrote:

Hi. We’re closing this issue because we have been unable to reproduce it. If you have more details and are encountering this issue please add a new reply and re-open the issue.

This is not the first time I see this “kind of reply”, whereas other are able—without any difficulties—to reproduce an issue… I do not know how you MS guys work, but seems not very serious/reassuring…

If you do not want to spend time on issue, do not lie, but rather, write—even with a “saved reply”

  • “We do not want to spend time in your issue…”.

Finally, does anybody use ASP.NET Core MVC??? I often—not only me—find all kind of problems/limitations, on basic usages, as if it was a beta project…