Closed codebolt closed 2 years ago
.NET does not have a culture with code "no". The issue can be easily reproduced by the following code (copied from https://github.com/dotnet/runtime/blob/main/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/CultureInfoConverter.cs):
CultureInfo?[] installedCultures = CultureInfo.GetCultures(CultureTypes.SpecificCultures | CultureTypes.NeutralCultures);
var no = installedCultures.Where(c => c.Name.StartsWith("n")).Select(c => c);
foreach (var c in no)
{
Debug.WriteLine(c);
}
.NET 6 | .NET Framework 4.7.2 |
---|---|
naq naq-NA nb nb-NO nb-SJ nd nd-ZW nds nds-DE nds-NL ne ne-IN ne-NP nl nl-AW nl-BE nl-BQ nl-CW nl-NL nl-SR nl-SX nmg nmg-CM nn nn-NO nnh nnh-CM nqo nqo-GN nr nr-ZA nso nso-ZA nus nus-SS nyn nyn-UG |
naq naq-NA nb nb-NO nb-SJ nd nd-ZW nds nds-DE nds-NL ne ne-IN ne-NP nl nl-AW nl-BE nl-BQ nl-CW nl-NL nl-SR nl-SX nmg nmg-CM nn nn-NO nnh nnh-CM no nqo nqo-GN nr nr-ZA nso nso-ZA nus nus-SS nyn nyn-UG |
You may also find this SO question useful: https://stackoverflow.com/q/13159969/2338036.
This is a .NET runtime issue, which I guess is by design, though I let the area owners to confirm this.
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.
This is a .NET runtime issue, which I guess is by design, though I let the area owners to confirm this.
Thanks for following up. If it is by design, then I would assume the problem of missing translations in Forms and other localizable resources after migration from .NET Framework is an unintended consequence. Would be very happy if I could at least get a workaround. I tried to simply rename the (...).no.resx file to .nb.resx but it didn't seem to work (still saw English texts in designer after switching to Norwegian Bokmål).
@RussKie thoughts on an area label? I was about to transfer to winforms, but I see you transferred it to runtime
@jeffschwMSFT my guess would be something to do with "CultureInfo" or how system languages are enumerated. The Windows Forms and VS are calling into https://github.com/dotnet/runtime/blob/main/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/CultureInfoConverter.cs.
Tagging subscribers to this area: @dotnet/area-system-componentmodel See info in area-owners.md if you want to be subscribed.
Author: | codebolt |
---|---|
Assignees: | - |
Labels: | `area-System.ComponentModel`, `untriaged` |
Milestone: | - |
@RussKie Culture enumerations depends on the underlying globalization libraries. It is the decision of the Unicode Standard through ICU to not enumerate the "no" culture. The current enumerated Norwgian cultures are
nb ... Norwegian Bokmål
nb-NO ... Norwegian Bokmål (Norway)
nb-SJ ... Norwegian Bokmål (Svalbard & Jan Mayen)
nn ... Norwegian Nynorsk
nn-NO ... Norwegian Nynorsk (Norway)
Which I believe covers all cases for that language. right?
https://en.wikipedia.org/wiki/Norwegian_language
Today there are two official forms of written Norwegian, [Bokmål](https://en.wikipedia.org/wiki/Bokm%C3%A5l) (literally 'book tongue') and [Nynorsk](https://en.wikipedia.org/wiki/Nynorsk) ('new Norwegian'),
The .NET prefers to stick with whatever the Unicode Standard decides for parity and consistency. If WinForm or VS want to include the "no" in their list for any compatibility reasons, they can do that as we still allow creating no
culture if you do that manually. Like CultureInfo.GetCultureInfo("no")
. This will work fine.
In general, depending on the enumerated cultures and assume, will never change is a wrong assumption and no one should depend on that.
@jefgen looking at https://github.com/unicode-org/cldr/pull/1031, what ICU version will have this change? Why is the ICU version on Windows not having this change? running with ICU version 68.2.0.6
having nb
and nn
with invariant parent.
The changes for that PR were done for CLDR-14493, which was integrated into ICU 69.
It makes "no" become a parent locale for both "nb" and "nn", instead of "nb" being deprecated and aliasing to "no". This change matches with now NLS handles the locales. However, IIRC, in ICU 68, "no" is aliased to "nb", so it wouldn't be enumerated.
The Windows ICU version hasn't yet been updated to pick up a newer version of public ICU yet.
The Windows ICU version hasn't yet been updated to pick up a newer version of public ICU yet.
Thanks @jefgen, is it scheduled yet when the ICU will get updated?
I am closing this issue as the ICU update should fix this issue. @jefgen may inform us when this will happen.
.NET Core Version: 6.0.200
Have you experienced this same bug with .NET Framework?: No
Problem description:
Working in with the WinForms Designer in .NET Framework, I created several localizable Forms/User Controls where I used two languages: English (default) and Norwegian (language code 'no'). When I open these forms in VS 2022/.NET 6 (after using the migration tool), I can no longer find "Norwegian" in the language list. I can only find Norwegian Bokmål ('nb') and Norwegian Bokmål Norway ('nb-NO'):
I see that the (...).no.resx file is there, but because Norwegian is not in the language list I am unable to use it:
Expected behavior:
Expected behavior is to select Norwegian (code 'no') in the list and see/edit the translated control.
Minimal repro:
To reproduce you would need to: