Description
Description
When having localized resources in your application, and one of them is norwegian no
, the resource lookup no longer works and falls back to english. This behavior is only observed on net9.0-ios, and not on Windows and Android or in net8.0-ios.
Reproduction Steps
-
Open and run the following sample on iOS:
MauiApp12.zip -
Notice that the button says "Language is English". Repeat on Android and Windows or downgrade the iOS target to .NET 8 and notice the output is now correctly "Language is Norwegian".
Expected behavior
Norwegian resources are correctly looked up.
Actual behavior
Resources not found and falls back to the default english resource.
Regression?
Yes
Known Workarounds
No response
Configuration
.NET 9.0.101, ios-arm64 with iOS 18.2 as well as on iOS17.5
Other information
Looking at the generated NO culture this is what I'm seeing which is likely the cause of it:
var no = new System.Globalization.CultureInfo("no");
Debug.WriteLine(no.TwoLetterISOLanguageName); // return "nb" on net9.0-iOS, "no" on net9.0-Android and net8.0-ios
Debug.WriteLine(no.Name); // return "nb" on net9.0-iOS, "no" on net9.0-Android and net8.0-ios
Looks like in 8.0, dotnet linked its own fork of ICU into every ios app, and in 9.0, you use system libraries as much as possible instead: #80689
I'm guessing this is the root of the problem.
Might also be related to: #110680
Also related:
- https://learn.microsoft.com/en-us/answers/questions/1848600/icu-update-nb-no-to-no-no-locale-id-change-net-fra
- https://icu.unicode.org/design/norwegian-locales-changes-in-v39
This is a pretty big regression for our localized libraries that we ship to other developers.