projects/mvc/localization/README.md
We are exploring all the nitty gritty of localization with MVC here.
Demonstrate the sample of naming resource file using the "." dot naming convention. In this case, our Assembly Name differs from our namespace so we use full type name in our resource. This allows IStringLocalizer<> to be used in Controllers.
This sample is identical as previous example except that we are using the path naming convention.
Demonstrate an easy way to use shared resources. The class name, Global, is just a name. It can be Common or CommonResources, etc. It does not matter.
Similar to MVC Localization - 3 except that now the assembly name and namespace share the same name. This is in contrast to MVC Localization - 1 and MVC Localization.
Use shared resource on View.
If you keep wondering why your default request language doesn't work, this example is for you.
This example demonstrates on how to ignore browser language preference by removing AcceptLanguageHeaderRequestCultureProvider and forcing your default language. This article has a useful explanation on this provider.
This sample shows how to use localization resources located in a separate project. Notice how the namespace correspondents to the folder name at the resource project.
This sample demonstrates the usage of AcceptLanguageHeaderRequestCultureProvider and Accept-Language HTTP header.
This sample demonstrates the situation of cultural fallback behaviour - Starting from the requested culture, if not found, it reverts to the parent culture of that culture.doc.
This sample uses CustomRequestCultureProvider to provide fine localization based on the first part of a url segment e.g. /en/my-page, /fr.
dotnet6