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

[wasm][icu] Locale aliases are not resolved correcly #79815

Closed
ilonatommy opened this issue Dec 19, 2022 · 1 comment · Fixed by dotnet/icu#296
Closed

[wasm][icu] Locale aliases are not resolved correcly #79815

ilonatommy opened this issue Dec 19, 2022 · 1 comment · Fixed by dotnet/icu#296
Assignees
Labels
Milestone

Comments

@ilonatommy
Copy link
Member

ilonatommy commented Dec 19, 2022

Description

"no" is an alias of "nb" locale. While "nb" is working fine with the new icudt data files from https://github.com/ilonatommy/icu/tree/dotnet/main/eng/prebuilts, "no" is throwing an exception of incorrect culture name.

Reproduction Steps

            var languageCodes = new List<string>() { "nb", "no", "nn" };
            foreach (var language in languageCodes)
            {
                try
                {
                    var culture = CultureInfo.CreateSpecificCulture(language);
                    var today = DateTime.Now.ToString("dddd, dd MMM yyyy", CultureInfo.GetCultureInfo(language));
                    Console.WriteLine($"locale: {language}; date: {today}");
                }
                catch (Exception ex)
                {
                    Console.WriteLine($"EXCEPTION: {ex}");
                }

"nn" locale, initially considered an unresolved alias, is in fact a separate locale, not listed as KNOWN_CANONICALIZED. It probably should not be added to the ICU batch.

Expected behavior

Check on Console App, it prints correctly e.g.
image

Actual behavior

image

Regression?

No response

Known Workarounds

Use "nb" with the newest icu bundle.

Configuration

No response

Other information

No response

@ilonatommy ilonatommy added this to the 8.0.0 milestone Dec 19, 2022
@ilonatommy ilonatommy self-assigned this Dec 19, 2022
@ghost
Copy link

ghost commented Dec 19, 2022

Tagging subscribers to 'arch-wasm': @lewing
See info in area-owners.md if you want to be subscribed.

Issue Details

Description

"nn" and "no" are aliases of "nb" locale. While "nb" is working fine with the new icudt data files from https://github.com/ilonatommy/icu/tree/dotnet/main/eng/prebuilts, "nn" and "no" are throwing an exception of incorrect culture name.

Reproduction Steps

            var languageCodes = new List<string>() { "nb", "no", "nn" };
            foreach (var language in languageCodes)
            {
                try
                {
                    var culture = CultureInfo.CreateSpecificCulture(language);
                    var today = DateTime.Now.ToString("dddd, dd MMM yyyy", CultureInfo.GetCultureInfo(language));
                    Console.WriteLine($"locale: {language}; date: {today}");
                }
                catch (Exception ex)
                {
                    Console.WriteLine($"EXCEPTION: {ex}");
                }

Expected behavior

Check on Console App, it prints correctly e.g.
image

Actual behavior

Uploading image.png…

Regression?

No response

Known Workarounds

Use "nb" with the newest icu bundle.

Configuration

No response

Other information

No response

Author: ilonatommy
Assignees: ilonatommy
Labels:

arch-wasm, area-System.Globalization

Milestone: 8.0.0

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant