I read articles about globalizing asp.net core application. All of them suggests to create 'Resources' folder and create sub folders and for each Controller/View/ViewModel, create resource file for each language. Is there a better way to do this, just having one resource file per language? If yes, what change I need to make in startup.cs file?
Is there a better way to do this, just having one resource file per language?
Globalization with help of SharedResource, you could refer to the below:
SharedResource.cs
, put it in the root folder of project and it does not need to contain any data, just the class declaration.
create a resource file called the same as the.cs file and it needs to be put in the Resources folder.
For the usage of SharedResource file, you could refer to below links:
https://docs.microsoft.com/en-us/aspnet/core/fundamentals/localization?view=aspnetcore-3.1
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.