Skip to content
This repository was archived by the owner on Nov 29, 2018. It is now read-only.

[Discuss] Culture name list #104

Closed
wants to merge 7 commits into from
Closed

[Discuss] Culture name list #104

wants to merge 7 commits into from

Conversation

yukozh
Copy link

@yukozh yukozh commented Oct 8, 2015

The most of browsers will detect the accept lang into zh or zh-CN, but in chrome it will be zh-Hans-CN.
By the way, I am not suggest put cultures in a class, why not put them into the resx? I think a resource file contains the cultures which supported in the file is better.

In PR #101 Line 823

+            "zh-Hans-HK",
+            "zh-Hans-MO",

It should be zh-Hant-HK and zh-Hant-MO and missing zh-Hans-CN & zh-Hant-TW
T means traditional, S means simplified, in HK、MO、TW they are still using the traditional Chinese.

@dnfclas
Copy link

dnfclas commented Oct 8, 2015

Hi @kagamine, I'm your friendly neighborhood .NET Foundation Pull Request Bot (You can call me DNFBOT). Thanks for your contribution!
You've already signed the contribution license agreement. Thanks!

The agreement was validated by .NET Foundation and real humans are currently evaluating your PR.

TTYL, DNFBOT;

@Eilon
Copy link
Contributor

Eilon commented Oct 9, 2015

Which exact OS and version are you running? The file being updated here is auto-generated, so updating it manually will get overwritten the next time the generator tool is run.

@hishamco
Copy link
Contributor

hishamco commented Oct 9, 2015

👍 @Eilon, that's what I mentioned to him before

@yukozh
Copy link
Author

yukozh commented Oct 9, 2015

I forgot the environment which detected a zh-Hans-CN, it may be OSX 10.11 beta

@Eilon
Copy link
Contributor

Eilon commented Oct 9, 2015

Hmm that's an interesting one.

@DamianEdwards seems like different OSes send different sets of cultures. Any thoughts on whether we need to merge in results from various OSes? This seems to be a real culture, and if it isn't a "known culture" then it'll be ignored...

@hishamco
Copy link
Contributor

hishamco commented Oct 9, 2015

Interesting 😄
+1 @Eilon

@yukozh
Copy link
Author

yukozh commented Oct 9, 2015

It was something wrong with dnvm on my mac, it cannot find the latest version of cidev feed. I opened an issue in dnvm repo. aspnet/dnvm#472. Now I cannot run the tool on mac.

@yukozh
Copy link
Author

yukozh commented Oct 10, 2015

Should we make some changes with the generator to ensure it can merge different culture lists?

@yukozh yukozh changed the title Fix to google chrome with the header zh-Hans-CN [Discuss] Culture name list Oct 10, 2015
@hishamco
Copy link
Contributor

What the error are you facing when you run the dnx CultureInfoGenerator?

@yukozh
Copy link
Author

yukozh commented Oct 10, 2015

~~ My CLRs are old, must be updated, but the dnvm cannot find the latest version from cidev feed. like aspnet/dnvm#472. ~~

@yukozh
Copy link
Author

yukozh commented Oct 10, 2015

Oh, I just missed a 's' in protocol. Now I am going to run the generator on mac.

@yukozh
Copy link
Author

yukozh commented Oct 10, 2015

So interesting, the generator seems that can be run on Windows only.

dnx CultureInfoGenerator
System.NullReferenceException: Object reference not set to an instance of an object
  at CultureInfoGenerator.Program.Get45or451FromRegistry () <0x106117b60 + 0x0005e> in <filename unknown>:0 
  at CultureInfoGenerator.Program.Main (System.String[] args) <0x1061177b0 + 0x00082> in <filename unknown>:0 
  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) <0x10221afd0 + 0x000a3> in <filename unknown>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0x102070510 + 0x00029> in <filename unknown>:0 
  at Microsoft.Dnx.Runtime.Common.EntryPointExecutor.Execute (System.Reflection.Assembly assembly, System.String[] args, IServiceProvider serviceProvider) <0x106116620 + 0x001c8> in <filename unknown>:0 
  at Microsoft.Dnx.ApplicationHost.Program.ExecuteMain (Microsoft.Dnx.ApplicationHost.DefaultHost host, System.String applicationName, System.String[] args) <0x10487e3d0 + 0x003c9> in <filename unknown>:0 
  at Microsoft.Dnx.ApplicationHost.Program.Main (System.String[] args) <0x1031ad030 + 0x0061e> in <filename unknown>:0 
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () in <filename unknown>:line 0
   at Microsoft.Dnx.Runtime.Common.EntryPointExecutor.Execute (System.Reflection.Assembly assembly, System.String[] args, IServiceProvider serviceProvider) in <filename unknown>:line 0
   at Microsoft.Dnx.Host.Bootstrapper.RunAsync (System.Collections.Generic.List`1 args, IRuntimeEnvironment env, System.String appBase, System.Runtime.Versioning.FrameworkName targetFramework) in <filename unknown>:line 0

@hishamco
Copy link
Contributor

can you upgrade the dnvm at your end

@yukozh
Copy link
Author

yukozh commented Oct 10, 2015

dnvm has been upgraded to the latest rc1-15524 successfully, and the errors occurred when I run the generator.

There are still many language codes which missed that compare to the ISO-639-1 list.

https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes

@hishamco
Copy link
Contributor

i don't know why the filename is unknown in the exception?!!
Can you run the CultureInfoGenerator project and see if you get the same result or not

@yukozh
Copy link
Author

yukozh commented Oct 10, 2015

Maybe the generator is not a cross-plat program.

image

@yukozh
Copy link
Author

yukozh commented Oct 10, 2015

I solved the cross-plat problem, and it gave us a different result from #101

The following result was generated from Mac OS X 10.10.5

        public static readonly HashSet<string> KnownCultureNames = new HashSet<string>(StringComparer.OrdinalIgnoreCase)
        {
            "",
            "ar",
            "bg",
            "ca",
            "zh-CHS",
            "zh-Hans",
            "cs",
            "da",
            "de",
            "el",
            "en",
            "es",
            "fi",
            "fr",
            "he",
            "hu",
            "is",
            "it",
            "ja",
            "ko",
            "nl",
            "no",
            "pl",
            "pt",
            "rm",
            "ro",
            "ru",
            "hr",
            "sk",
            "sq",
            "sv",
            "th",
            "tr",
            "ur",
            "id",
            "uk",
            "be",
            "sl",
            "et",
            "lv",
            "lt",
            "tg",
            "fa",
            "vi",
            "hy",
            "az",
            "eu",
            "mk",
            "tn",
            "xh",
            "zu",
            "af",
            "ka",
            "fo",
            "hi",
            "mt",
            "se",
            "ga",
            "ms",
            "kk",
            "ky",
            "sw",
            "uz",
            "bn",
            "pa",
            "gu",
            "or",
            "ta",
            "te",
            "kn",
            "ml",
            "as",
            "mr",
            "mn",
            "bo",
            "cy",
            "km",
            "lo",
            "gl",
            "kok",
            "si",
            "am",
            "tzm",
            "ne",
            "ps",
            "fil",
            "ha",
            "yo",
            "nso",
            "kl",
            "ig",
            "ii",
            "br",
            "gsw",
            "sah",
            "rw",
            "gd",
            "ar-SA",
            "bg-BG",
            "ca-ES",
            "zh-TW",
            "cs-CZ",
            "da-DK",
            "de-DE",
            "el-GR",
            "en-US",
            "fi-FI",
            "fr-FR",
            "he-IL",
            "hu-HU",
            "is-IS",
            "it-IT",
            "ja-JP",
            "ko-KR",
            "nl-NL",
            "nb-NO",
            "pl-PL",
            "pt-BR",
            "rm-CH",
            "ro-RO",
            "ru-RU",
            "hr-HR",
            "sk-SK",
            "sq-AL",
            "sv-SE",
            "th-TH",
            "tr-TR",
            "ur-PK",
            "id-ID",
            "uk-UA",
            "be-BY",
            "sl-SI",
            "et-EE",
            "lv-LV",
            "lt-LT",
            "tg-Cyrl-TJ",
            "fa-IR",
            "vi-VN",
            "hy-AM",
            "az-Latn-AZ",
            "eu-ES",
            "mk-MK",
            "tn-ZA",
            "xh-ZA",
            "zu-ZA",
            "af-ZA",
            "ka-GE",
            "fo-FO",
            "hi-IN",
            "mt-MT",
            "se-NO",
            "sw-KE",
            "uz-Latn-UZ",
            "bn-IN",
            "gu-IN",
            "or-IN",
            "ta-IN",
            "te-IN",
            "kn-IN",
            "ml-IN",
            "as-IN",
            "mr-IN",
            "bo-CN",
            "cy-GB",
            "km-KH",
            "lo-LA",
            "gl-ES",
            "kok-IN",
            "si-LK",
            "am-ET",
            "ne-NP",
            "ps-AF",
            "fil-PH",
            "ha-Latn-NG",
            "yo-NG",
            "nso-ZA",
            "kl-GL",
            "ig-NG",
            "ii-CN",
            "br-FR",
            "sah-RU",
            "rw-RW",
            "gd-GB",
            "ar-IQ",
            "zh-CN",
            "de-CH",
            "en-GB",
            "es-MX",
            "fr-BE",
            "it-CH",
            "nl-BE",
            "nn-NO",
            "pt-PT",
            "sv-FI",
            "az-Cyrl-AZ",
            "ga-IE",
            "uz-Cyrl-UZ",
            "bn-BD",
            "ar-EG",
            "zh-HK",
            "de-AT",
            "en-AU",
            "es-ES",
            "fr-CA",
            "se-FI",
            "ar-LY",
            "zh-SG",
            "de-LU",
            "en-CA",
            "es-GT",
            "fr-CH",
            "hr-BA",
            "ar-DZ",
            "zh-MO",
            "de-LI",
            "en-NZ",
            "es-CR",
            "fr-LU",
            "bs-Latn-BA",
            "ar-MA",
            "en-IE",
            "es-PA",
            "fr-MC",
            "sr-Latn-BA",
            "ar-TN",
            "en-ZA",
            "es-DO",
            "sr-Cyrl-BA",
            "ar-OM",
            "en-JM",
            "es-VE",
            "bs-Cyrl-BA",
            "ar-YE",
            "es-CO",
            "sr-Latn-RS",
            "ar-SY",
            "en-BZ",
            "es-PE",
            "sr-Cyrl-RS",
            "ar-JO",
            "en-TT",
            "es-AR",
            "sr-Latn-ME",
            "ar-LB",
            "en-ZW",
            "es-EC",
            "sr-Cyrl-ME",
            "ar-KW",
            "en-PH",
            "es-CL",
            "ar-AE",
            "es-UY",
            "ar-BH",
            "es-PY",
            "ar-QA",
            "en-IN",
            "es-BO",
            "es-SV",
            "en-SG",
            "es-HN",
            "es-NI",
            "es-PR",
            "es-US",
            "bs-Cyrl",
            "bs-Latn",
            "sr-Cyrl",
            "sr-Latn",
            "az-Cyrl",
            "zh",
            "nn",
            "bs",
            "az-Latn",
            "uz-Cyrl",
            "mn-Cyrl",
            "zh-Hant",
            "zh-CHT",
            "nb",
            "sr",
            "tg-Cyrl",
            "uz-Latn",
            "tzm-Latn",
            "ha-Latn"
        };

@hishamco
Copy link
Contributor

@DamianEdwards, @kirthik your thoughts

@yukozh
Copy link
Author

yukozh commented Oct 10, 2015

I did some changes with the generator. Now it will make a json result in ../Microsoft.Extensions.Globalization.CultureInfoCache/GeneratedResults/, and when you run the generator, it will combine the current result and all of the results in the result path .

By the way, I do not have the environment of Mac OS X 10.11 beta now, which I said before. If you need, I will install one and generate a culture list.

/cc @kirthik, @DamianEdwards, @Eilon, @hishamco

@hishamco
Copy link
Contributor

@kagamine the cultures should be retrieved from the OS itself rather than json file, which is based on the .NET version

@yukozh
Copy link
Author

yukozh commented Oct 10, 2015

Maybe you are right. But I don't know how to get the cultures by using the original methods of OS.

@yukozh
Copy link
Author

yukozh commented Oct 10, 2015

zh-Hans-CN appeared in Windows 8.1 + IE 11.09600.16476:

image

Interesting 😄 +1

It's really an existed culture.

I think we should make some original tools for different OS, and use the json to store them, and each tools can merge these json files.

@hishamco
Copy link
Contributor

FYI the same culture shows in the issue #38 , I will check it now in my end, if it's require may i will check it in a Mac OS if I got a chance

@yukozh
Copy link
Author

yukozh commented Oct 10, 2015

Nope, in #38 is zh-Hans not zh-Hans-CN.
I will go to sleep, bye~ @hishamco

@hishamco
Copy link
Contributor

Perhaps you got me confuse with Chinese cultures 😄

@yukozh
Copy link
Author

yukozh commented Oct 10, 2015

😄 There were more informal cultures in China, such as zh-wuu, zh-yue, zh-gan.

For example, I cannot understand the words which are spoken by zh-yue person.

en-US we
zh-CN 我们
zh-yue 我哋
zh-wuu 啊啦

😭 I still confuse with git rebase.... QAQ

@Eilon
Copy link
Contributor

Eilon commented Oct 10, 2015

We will discuss these next week and get back to you.

@Eilon
Copy link
Contributor

Eilon commented Oct 14, 2015

Closing this because we're making a design change so that this isn't necessary: #111

In the new design the list of cultures is not a master list, just a cache.

@Eilon Eilon closed this Oct 14, 2015
@yukozh yukozh deleted the patch-2 branch October 22, 2015 00:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants