Support adding additional cultures to LanguageController.GetAllCultures() #13121
ThomasSkyldahl
started this conversation in
Features and ideas
Replies: 1 comment
-
Another way to support custom cultures could be to introduce an |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Currently it's very hard to add extra cultures to Umbraco as it uses
CultureInfo.GetCultures(CultureTypes.AllCultures)
to get the list of OS supported cultures.but the new CultureInfo system is smart about custom cultures when they are supplied in the known format:
eg: "en-ES"
<LANGUGE_CODE>-<COUNTRY_CODE>
So it would be great if the
LanguageController.GetAllCultures()
for cultures could be extended to include cultures added during umbraco startup.One example is that "en-ES" that doesn't currently exist in the call to
CultureInfo.GetCultures(CultureTypes.AllCultures)
.If we create an instance of
var englishSpain = new CultureInfo("en-ES");
Every other API around cultures understands our intention,
RegionInfo
will understand that its "Spain" we are referring to.And
CultureInfo
will know that the language is "English (Spain)" and that its parent is "English".The current way to add cultures is tough and OS dependent as .NET Core and beyond does not support
CultureAndRegionInfoBuilder
Beta Was this translation helpful? Give feedback.
All reactions