Bug 15840 - Add a new locale info for de-FR
Summary: Add a new locale info for de-FR
Status: RESOLVED FEATURE
Alias: None
Product: Class Libraries
Classification: Mono
Component: mscorlib ()
Version: master
Hardware: PC Windows
: --- normal
Target Milestone: Untriaged
Assignee: Marek Safar
URL:
Depends on:
Blocks:
 
Reported: 2013-10-31 04:26 UTC by David PIHAN
Modified: 2013-11-04 09:34 UTC (History)
4 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FEATURE

Description David PIHAN 2013-10-31 04:26:24 UTC
If the mobile phone is set in de-FR (I see "German (Frankreich)" in the Android language settings) (HTC One SV bought in France with a french ROM but with German selected as a language), an invariant culture is automaticaly selected (see bug 15214). 

Is it possible to add "de-FR" as a new culture 
or to select "de" which exists in the cultures supported by mono 
or more generally when the full culture in 4 chars (xx-YY) is not supported to select the culture in 2 chars (xx) if supported ?

Thanks in advance,
David
Comment 1 Marek Safar 2013-11-01 03:15:07 UTC
de-FR is not .NET supported culture. However, when you try to create it Mono fallbacks automatically to de-DE.

Simple way to test it is

		var ci = CultureInfo.CreateSpecificCulture ("de-FR");
		Console.WriteLine (ci);
Comment 2 Jonathan Pryor 2013-11-01 09:11:20 UTC
@Marek: That doesn't help for default cultures. On Unixy platforms (e.g. Linux, Android), the default locale is pulled from $LANG and $LC_ALL:

https://github.com/mono/mono/blob/master/mono/metadata/locales.c#L434

The $LANG/$LC_ALL value is used with construct_culture_from_specific_name(), which fails (there's no de-FR data):

https://github.com/mono/mono/blob/master/mono/metadata/locales.c#L500

Since it fails, CultureInfo falls back to the Invariant culture:

https://github.com/mono/mono/blob/master/mcs/class/corlib/System.Globalization/CultureInfo.cs#L127

If adding de-FR data isn't "correct", how can we best support this scenario (using a "correct" fallback locale based on $LANG)? Should construct_culture_from_specific_name() do the fallback detection?
Comment 3 David PIHAN 2013-11-04 03:41:12 UTC
Hi Marek,
Thank you for your analyze but as Jonathan wrotte if you can return "de-DE" when "de-FR" is selected in the system it will be great for me. The problem is the invariant.
I hope you can find a solution.
Best regards,
David
Comment 4 Jonathan Pryor 2013-11-04 09:34:30 UTC
Improved fallback support has been filed as Bug #15875.