Closed
Description
Description
CultureInfo.CurrentCulture.Name
returns just "en", even if a non-English region is set in the iOS settings (such as "Germany")
Reproduction Steps
- Specify iOS settings as can be seen in the screenshot below
- create new iOS app (
dotnet new ios
) and setPublishAot=true
in csproj - get iOS device ID using
xcrun xctrace list devices
- run
dotnet publish -t:Run -p:_DeviceName=DEVICE_ID
Example project: ios_test.zip
Expected behavior
CultureInfo.CurrentCulture.Name
returns "en-DE"
Actual behavior
CultureInfo.CurrentCulture.Name
returns "en"
Regression?
No response
Known Workarounds
I can construct my own, custom CultureInfo:
new CultureInfo(CultureInfo.CurrentCulture.TwoLetterISOLanguageName + "-" + NSLocale.CurrentLocale.RegionCode)
Configuration
.NET 9.0.4
iOS 18.4.1
iPhone SE
Other information
Perhaps related to #113614
CultureInfo.CurrentCulture.Name
returns "en-DE" as expected when running in Debug mode (or in Release mode without using PublishAot=true
) and also in a net9.0-macos app using these settings (Debug and Release mode):