Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CultureInfo.GetCultures returns nothing on iOS platforms with HybridGlobalization enabled #93514

Closed
drasticactions opened this issue Oct 14, 2023 · 1 comment · Fixed by #93594
Assignees
Milestone

Comments

@drasticactions
Copy link

drasticactions commented Oct 14, 2023

Description

Using .NET 8 RC2 and enabling HybridGlobalization mode for iOS platform apps (Re. iOS/Mac Catalyst/tvOS etc), calling CultureInfo.GetCultures will always return an empty set. No matter what enum value it's set to, it's always empty. Disabling HybridGlobalization will return the expect lists, but without fields like "NativeName" being set, which is why I want to enable it.

CC @rolfbjarne

Reproduction Steps

var regions = CultureInfo.GetCultures (CultureTypes.SpecificCultures)
	.Select (culture => new RegionInfo (culture.Name))
	.OrderBy (v => v.ThreeLetterISORegionName);
foreach (var r in regions) {
	Console.WriteLine ($"{r.ThreeLetterISORegionName} {r.NativeName} {r.Name} {r.EnglishName} {r.DisplayName}");
}

Run the following reproduction project: https://github.com/drasticactions/MauiRepros/tree/main/CatalystCultureHybrid

With HybridGlobalization disabled, you'll see this:
スクリーンショット 2023-10-14 19 24 34

Enabled, you'll see an empty list:

スクリーンショット 2023-10-14 19 23 10

Expected behavior

Should get the list of CultureInfos based on the enum value provided.

Actual behavior

Nothing is returned.

Regression?

No response

Known Workarounds

Disable HybridGlobalization, but this will remove other values that would be set with it enabled.

Configuration

.NET SDK:
 Version:   8.0.100-rc.2.23502.2
 Commit:    0abacfc2b6

ランタイム環境:
 OS Name:     Mac OS X
 OS Version:  14.0
 OS Platform: Darwin
 RID:         osx-arm64
 Base Path:   /usr/local/share/dotnet/sdk/8.0.100-rc.2.23502.2/

インストール済みの .NET ワークロード:
 [macos]
   インストール ソース: SDK 8.0.100-rc.2
   マニフェストのバージョン:    13.3.8968-net8-rc2/8.0.100-rc.2
   マニフェスト パス:       /usr/local/share/dotnet/sdk-manifests/8.0.100-rc.2/microsoft.net.sdk.macos/13.3.8968-net8-rc2/WorkloadManifest.json
   インストールの種類:        FileBased

 [maccatalyst]
   インストール ソース: SDK 8.0.100-rc.2
   マニフェストのバージョン:    16.4.8968-net8-rc2/8.0.100-rc.2
   マニフェスト パス:       /usr/local/share/dotnet/sdk-manifests/8.0.100-rc.2/microsoft.net.sdk.maccatalyst/16.4.8968-net8-rc2/WorkloadManifest.json
   インストールの種類:        FileBased

 [maui]
   インストール ソース: SDK 8.0.100-rc.2
   マニフェストのバージョン:    8.0.0-rc.2.9373/8.0.100-rc.2
   マニフェスト パス:       /usr/local/share/dotnet/sdk-manifests/8.0.100-rc.2/microsoft.net.sdk.maui/8.0.0-rc.2.9373/WorkloadManifest.json
   インストールの種類:        FileBased

 [tvos]
   インストール ソース: SDK 8.0.100-rc.2
   マニフェストのバージョン:    16.4.8968-net8-rc2/8.0.100-rc.2
   マニフェスト パス:       /usr/local/share/dotnet/sdk-manifests/8.0.100-rc.2/microsoft.net.sdk.tvos/16.4.8968-net8-rc2/WorkloadManifest.json
   インストールの種類:        FileBased

 [android]
   インストール ソース: SDK 8.0.100-rc.2
   マニフェストのバージョン:    34.0.0-rc.2.468/8.0.100-rc.2
   マニフェスト パス:       /usr/local/share/dotnet/sdk-manifests/8.0.100-rc.2/microsoft.net.sdk.android/34.0.0-rc.2.468/WorkloadManifest.json
   インストールの種類:        FileBased


Host:
  Version:      8.0.0-rc.2.23479.6
  Architecture: arm64
  Commit:       0b25e38ad3

.NET SDKs installed:
  7.0.401 [/usr/local/share/dotnet/sdk]
  8.0.100-rc.1.23463.5 [/usr/local/share/dotnet/sdk]
  8.0.100-rc.2.23502.2 [/usr/local/share/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 7.0.11 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.0-rc.1.23421.29 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.0-rc.2.23480.2 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 7.0.11 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.0-rc.1.23419.4 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.0-rc.2.23479.6 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
  None

Other information

No response

@dotnet-issue-labeler dotnet-issue-labeler bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Oct 14, 2023
@ghost ghost added the untriaged New issue has not been triaged by the area owner label Oct 14, 2023
@vcsjones vcsjones added area-System.Globalization os-ios Apple iOS and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Oct 15, 2023
@ghost
Copy link

ghost commented Oct 15, 2023

Tagging subscribers to 'os-ios': @steveisok, @akoeplinger, @kotlarmilos
See info in area-owners.md if you want to be subscribed.

Issue Details

Description

Using .NET 8 RC2 and enabling HybridGlobalization mode for iOS platform apps (Re. iOS/Mac Catalyst/tvOS etc), calling CultureInfo.GetCultures will always return an empty set. No matter what enum value it's set to, it's always empty. Disabling HybridGlobalization will return the expect lists, but without fields like "NativeName" being set, which is why I want to enable it.

CC @rolfbjarne

Reproduction Steps

var regions = CultureInfo.GetCultures (CultureTypes.SpecificCultures)
	.Select (culture => new RegionInfo (culture.Name))
	.OrderBy (v => v.ThreeLetterISORegionName);
foreach (var r in regions) {
	Console.WriteLine ($"{r.ThreeLetterISORegionName} {r.NativeName} {r.Name} {r.EnglishName} {r.DisplayName}");
}

Run the following reproduction project: https://github.com/drasticactions/MauiRepros/tree/main/CatalystCultureHybrid

With HybridGlobalization disabled, you'll see this:
スクリーンショット 2023-10-14 19 24 34

Enabled, you'll see an empty list:

スクリーンショット 2023-10-14 19 23 10

Expected behavior

Should get the list of CultureInfos based on the enum value provided.

Actual behavior

Nothing is returned.

Regression?

No response

Known Workarounds

Disable HybridGlobalization, but this will remove other values that would be set with it enabled.

Configuration

.NET SDK:
 Version:   8.0.100-rc.2.23502.2
 Commit:    0abacfc2b6

ランタイム環境:
 OS Name:     Mac OS X
 OS Version:  14.0
 OS Platform: Darwin
 RID:         osx-arm64
 Base Path:   /usr/local/share/dotnet/sdk/8.0.100-rc.2.23502.2/

インストール済みの .NET ワークロード:
 [macos]
   インストール ソース: SDK 8.0.100-rc.2
   マニフェストのバージョン:    13.3.8968-net8-rc2/8.0.100-rc.2
   マニフェスト パス:       /usr/local/share/dotnet/sdk-manifests/8.0.100-rc.2/microsoft.net.sdk.macos/13.3.8968-net8-rc2/WorkloadManifest.json
   インストールの種類:        FileBased

 [maccatalyst]
   インストール ソース: SDK 8.0.100-rc.2
   マニフェストのバージョン:    16.4.8968-net8-rc2/8.0.100-rc.2
   マニフェスト パス:       /usr/local/share/dotnet/sdk-manifests/8.0.100-rc.2/microsoft.net.sdk.maccatalyst/16.4.8968-net8-rc2/WorkloadManifest.json
   インストールの種類:        FileBased

 [maui]
   インストール ソース: SDK 8.0.100-rc.2
   マニフェストのバージョン:    8.0.0-rc.2.9373/8.0.100-rc.2
   マニフェスト パス:       /usr/local/share/dotnet/sdk-manifests/8.0.100-rc.2/microsoft.net.sdk.maui/8.0.0-rc.2.9373/WorkloadManifest.json
   インストールの種類:        FileBased

 [tvos]
   インストール ソース: SDK 8.0.100-rc.2
   マニフェストのバージョン:    16.4.8968-net8-rc2/8.0.100-rc.2
   マニフェスト パス:       /usr/local/share/dotnet/sdk-manifests/8.0.100-rc.2/microsoft.net.sdk.tvos/16.4.8968-net8-rc2/WorkloadManifest.json
   インストールの種類:        FileBased

 [android]
   インストール ソース: SDK 8.0.100-rc.2
   マニフェストのバージョン:    34.0.0-rc.2.468/8.0.100-rc.2
   マニフェスト パス:       /usr/local/share/dotnet/sdk-manifests/8.0.100-rc.2/microsoft.net.sdk.android/34.0.0-rc.2.468/WorkloadManifest.json
   インストールの種類:        FileBased


Host:
  Version:      8.0.0-rc.2.23479.6
  Architecture: arm64
  Commit:       0b25e38ad3

.NET SDKs installed:
  7.0.401 [/usr/local/share/dotnet/sdk]
  8.0.100-rc.1.23463.5 [/usr/local/share/dotnet/sdk]
  8.0.100-rc.2.23502.2 [/usr/local/share/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 7.0.11 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.0-rc.1.23421.29 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.0-rc.2.23480.2 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 7.0.11 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.0-rc.1.23419.4 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.0-rc.2.23479.6 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
  None

Other information

No response

Author: drasticactions
Assignees: -
Labels:

area-System.Globalization, untriaged, os-ios

Milestone: -

@steveisok steveisok added this to the 8.0.0 milestone Oct 15, 2023
@ghost ghost removed the untriaged New issue has not been triaged by the area owner label Oct 15, 2023
@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Oct 17, 2023
steveisok pushed a commit that referenced this issue Oct 19, 2023
Implements `GlobalizationNative_GetLocalesNative` for iOS hybrid globalization in order to return all of the available locales on the device.

Fixes #93514

Contributes to #80689
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Oct 19, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Nov 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants