'.net 6 mvc localization both in view and in javascript
I wanted to share some important problem with localization (transilation of words in many languages) in javascript that i solved
this is the code in view that you use in view and you can you use in js as well
@inject Microsoft.AspNetCore.Mvc.Localization.IViewLocalizer localizer
in view you can use like this
@localizer["addReference"].Value
in js you can use like this
@localizer["addReference"]
Solution 1:[1]
in view you can use like this @localizer["addReference"].Value
in js you can use like this @localizer["addReference"]
translation should be in double quatation mark such as "Add Reference" in resource.resx
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
