List of all available languages for Windows .NET framework

前端 未结 3 1182
逝去的感伤
逝去的感伤 2020-12-31 17:03

I\'ve been searching for the answer over the net, but I don\'t seem to be able to find a comprehensive list of all languages available for my app with their exact display na

3条回答
  •  醉梦人生
    2020-12-31 17:34

    These strings are probably taken from SDL Studio embedded resources, from Sdl.LanguagePlatform.Lingua.dll. I did a quick try to locate your Taiwanese example, but it did not work. Still, to show you how not to do it, here is my code:

        static void Main(string[] args)
        {
            // forced enum iteration
            for (int n = 0; n < 6; ++n)
            {
                var localInfoSet = Sdl.LanguagePlatform.Lingua.Locales.LocaleInfoSet.GetLocaleInfoSet((Sdl.LanguagePlatform.Lingua.Locales.LocaleSource)n);
    
                var tradLocaleInfo = localInfoSet.Where(item => item.Name.Contains("Traditional,"));
                foreach (var item in tradLocaleInfo)
                {
                    System.Diagnostics.Debug.WriteLine(item.Name);
                }
            }
        }
    

    I deliberately left the full namespaces in instead of using them. Perhaps this can serve you as a starting point to get access to those lists. Or perhaps not, but it could be worth a try.

提交回复
热议问题