Skip to content

Regression: Norwegian localization no longer works in iOS with .NET 9 #112249

Open
@dotMorten

Description

@dotMorten

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

  1. Open and run the following sample on iOS:
    MauiApp12.zip

  2. 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:

This is a pretty big regression for our localized libraries that we ship to other developers.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions