.net core localizer view5/7/2023 ![]() ![]() Var localizationOptions = new RequestLocalizationOptions()Īppl圜urrentCultureToResponseHeaders = true The solution is to place the dummy class at the root of the application (for example) and leave the resource files inside the Resources f The code goes like this, in ConfigureServices: services.AddMvc() It turns out, however, that that won’t work: even if you change the namespace of this class to be the root assembly namespace (usually the web application’s name), the satellite resource assembly will not be generated properly. When using shared resources, we often create a dummy class (say, SharedResources) to which we can associate resources that are not associated with a specific view or page, for example, resources used in the page layout, so, we may be tempted to place this class inside this Resources folder. resx) to be located inside a Resources folder on the root of the web application. Using shared resources, e.g., not bound to a specific view or pageīy default, ASP.NET Core’s localization expects resource files(. ![]()
0 Comments
Leave a Reply. |