Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Missing Valencian language #115180

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

Closed
bdovaz opened this issue Apr 30, 2025 · 9 comments
Closed

Missing Valencian language #115180

bdovaz opened this issue Apr 30, 2025 · 9 comments

Comments

@bdovaz
Copy link

bdovaz commented Apr 30, 2025

Description

If you run this example on .NET 9, the Valencian language does not appear among the available languages:

https://learn.microsoft.com/en-us/dotnet/api/system.globalization.cultureinfo.getcultures#examples

Even in Windows or Office it is possible to install it as a language:

https://support.microsoft.com/en-us/office/language-accessory-pack-for-microsoft-365-82ee1236-0f9a-45ee-9c72-05b026ee809f

Image

Reproduction Steps

using System.Globalization;

CultureInfo cultureInfo = new("ca-ES-valencia");

Console.WriteLine(cultureInfo.DisplayName);

Output:

Catalan (Spain, Valencian)

Expected behavior

It should appear in the list of CultureInfo.GetCultures(CultureTypes.AllCultures).

Actual behavior

The language does not appear in the list.

Regression?

No response

Known Workarounds

No response

Configuration

No response

Other information

No response

@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label Apr 30, 2025
Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-system-globalization
See info in area-owners.md if you want to be subscribed.

@huoyaoyuan
Copy link
Member

The culture list is provided by underlying culture provider. ca-ES-valencia is present in Windows NLS, but not in ICU CLDR which is the default.
You can switch to NLS to get support from Windows.
To request it be included in CLDR, please go to https://cldr.unicode.org/ . New changes need some time to get included by the OS.

@bdovaz
Copy link
Author

bdovaz commented Apr 30, 2025

Created: https://unicode-org.atlassian.net/jira/software/c/projects/CLDR/issues/CLDR-18583?jql=project%20%3D%20%22CLDR%22%20ORDER%20BY%20created%20DESC

Does this make it appear on all OS or does it only apply to Windows? I have not been able to check if the same thing happens in other OS.

Thanks!

@huoyaoyuan
Copy link
Member

NLS is Windows only. On other OSes currently there is no way to use globalization component other than ICU, and their behavior is expected to the same with Windows with ICU. Note that ICU versions can differ for different OS versions. You have to wait for updated ICU to be included in updated OS.

@bdovaz
Copy link
Author

bdovaz commented Apr 30, 2025

Ok, thanks!

@tarekgh tarekgh closed this as completed Apr 30, 2025
@dotnet-policy-service dotnet-policy-service bot removed the untriaged New issue has not been triaged by the area owner label Apr 30, 2025
@Clockwork-Muse
Copy link
Contributor

Note that it's possible to build your own version of ICU, if you really need it.

Potentially, you could also create a custom culture object with Valencian.

@bdovaz
Copy link
Author

bdovaz commented Apr 30, 2025

Note that it's possible to build your own version of ICU, if you really need it.

And how can it be done? Sounds complicated.

Potentially, you could also create a custom culture object with Valencian.

You mean what I already put new CultureInfo(“ca-ES-valencia”);?

@Clockwork-Muse
Copy link
Contributor

And how can it be done? Sounds complicated.

I'm not completely sure, and it probably depends on distro. But presumably you'd build icu4c.

You mean what I already put new CultureInfo(“ca-ES-valencia”);?

You have a few options:

  1. Clone an existing culture and set some properties
    var ci = new CultureInfo("es-ES");
    var ci = (CultureInfo) ci.Clone();
    ci.DateTimeFormat = new DateTimeFormat(...);
    // etc - although not all properties can be changed this way
  2. One of the overrides for GetCultureInfo(...) will retrieve a culture even if the data doesn't exist, at which point you should be able to set properties as if cloned.
  3. CultureInfo isn't sealed, and most of the properties are virtual. You can subclass it.

@bdovaz
Copy link
Author

bdovaz commented May 2, 2025

Thank you very much for the information @Clockwork-Muse

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

No branches or pull requests

4 participants