有人知道翻译的时区描述的来源吗? [英] Anyone know a source for translated Time Zone descriptions?

查看:148
本文介绍了有人知道翻译的时区描述的来源吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道Windows中时区名称的编译清单吗?我需要全部75左右的德语,法语和西班牙语.或者,我将如何使用.Net来编译这样的列表?

Does anyone know of a compiled list of translations for the time zone names in Windows? I need all 75 or so of them in German, French and Spanish. Alternatively, how would I use .Net to compile such a list?

示例格式:(GMT + 01:00)贝尔格莱德,布拉迪斯拉发,布达佩斯,卢布尔雅那,布拉格

Example format: (GMT+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague

推荐答案

注册表中所有时区的列表位于:

There is a list of all the time zones in the registry at:

HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Windows NT \ CurrentVersion \时区

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones

可以使用以下方式加载

ArrayList zones = new ArrayList();

using( RegistryKey key = Registry.LocalMachine.OpenSubKey(
    @"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones" ) )
{
    string[] zoneNames = key.GetSubKeyNames();

    foreach( string zoneName in zoneNames )
    {
        using( RegistryKey subKey = key.OpenSubKey( zoneName ) )
        {
            TimeZoneInformation tzi = new TimeZoneInformation();
            tzi.Name = zoneName;
            tzi.DisplayName = (string)subKey.GetValue( "Display" );
            tzi.StandardName = (string)subKey.GetValue( "Std" );
            tzi.DaylightName = (string)subKey.GetValue( "Dlt" );
            object value = subKey.GetValue( "Index" );
            if( value != null )
            {
                tzi.Index = (int)value;
            }

            tzi.InitTzi( (byte[])subKey.GetValue( "Tzi" ) );

            zones.Add( tzi );
        }
    }
}

TimeZoneInformation只是一个用于存储信息以方便访问的类.

Where TimeZoneInformation is just a class which stores the information for easy access.

您要查找的描述在显示"值中.

The description you're looking for is in the Display value.

这篇关于有人知道翻译的时区描述的来源吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆