Organizing ASP.NET Resource Files in Language Based Folders

In my root application, App_LocalResourcesI created several resource files ( .resx) to localize my application for several languages.

For Spanish, I copied the default resource files and added .esup .resxto have the full name myresource.es.resx. When I change the culture of the user interface, changing the language works fine.

However, when I wanted to organize their Spanish resource files in the same folder (the try: es-Es, esand Spanish) in the folder App_LocalResources, the application ceased to recognize the resource files.

Is there an agreement on how to organize resource files for each language so that I do not have one folder with all resource files?

+3
source share
2 answers

If you are not using the file per page resource, use App_GlobalResources. This method can be organized into a folder structure. IIRC, your file names must be unique throughout the tree, not just each branch. I had a good success by naming the files as a section of the site, but, of course, YMMV.

Here is an MSDN article that will help you:
http://msdn.microsoft.com/en-us/library/ms227427.aspx

-1
source

What is the name of the resource dll in the resource folder? It should no longer contain the locale identifier (so es \ myresource.dll, not es \ myresource.es.dll)

-1
source

Source: https://habr.com/ru/post/1774632/


All Articles