More freedom in the Language creation #14736
Replies: 5 comments 11 replies
-
PR: #14738 |
Beta Was this translation helpful? Give feedback.
-
To me, this sounds like dangerous grounds to walk 🙈 Umbraco relies on the information saved in the culture info not just the string value. So we need to know how to handle number formats etc. I haven't tested, but maybe this suggestion on how to install cultures in the OS still works. dotnet/runtime#23802 (comment) Thereby the information will be available everywhere in .NET. |
Beta Was this translation helpful? Give feedback.
-
@bergmania Do you have any examples on where Umbraco uses the CultureInfo values so we could test if it works with custom cultures? As far as my quick testing custom cultures works quite well when using existing languages and country combinations like "en-CZ" |
Beta Was this translation helpful? Give feedback.
-
I'm pretty sure this is not supported in the same way between operation systems. |
Beta Was this translation helpful? Give feedback.
-
Umbraco using dotnet by proxy uses ICU, an attempt at standardization for encoding cultures/serialization between cultures. ICU/CLDR is not meant for defining business language/region pairs, but for UTF-8 translations for data serialization given a sort of (dialect) of a language (typically in a specific region, though CLDR is a tree where language is fallback). So supporting a region would most likely choose to utilize an existing utf8 culture. Could it make sense to allow for defining a language by a "locale" name (or some other term) and a providing CultureInfo (given that CultureInfo is for UTF8 globalization but not necessarily business level region/language goals)? This code would also act as a deliminator in routing. So the Thread CultureInfo would still be a system level supported CultureInfo but the "business level" languages would be a user defined feature. Fundamentally the CultureInfo doesn't need to be the same as the content's "translation" e.g.
OR (if my assumption is that most US French speakers are more likely utilizing Canadian standards
|
Beta Was this translation helpful? Give feedback.
-
The feature I'm looking for
When creating a language you only have the languages provided by
CultureInfo.GetCultures(CultureTypes.AllCultures)
which isn't always every option you need. Therefore it would be great to have an option to provide a custom IsoCode in the interface. As far as my quick test goes it shouldn't be a problem to have custom Cultures registered via the language. SourceExample of other people running into the same issue:
Example of missing language variant:
en-CZ
English (Czechia)
here we don't have an english variant for the czech republic which means if I would like to have a version of my website that's specific to the czech republic but written in english I would have to go about other ways of making my content tree instead of language variations.I found a workaround using USync where you can copy paste the from for example
en-ch
:To a new file named
en-cz.config
:After running the import your language will show but it would be much cooler if I could add the custom language directly in the Umbraco interface.
If you would like to know more about this issue take a look at the following:
CultureAndRegionInfoBuilder
as a backup for missing cultures.Beta Was this translation helpful? Give feedback.
All reactions