using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Mesnac.Basic
{
///
/// 区域辅助类
///
public class LocaleHelper
{
///
/// 获取所有区域信息
///
public static Dictionary AllLocales
{
get
{
Dictionary dic = new Dictionary() {
{ "da-DK", new LocaleItem() { Code = "da-DK", Country = "丹麦", Language = "丹麦语" } },
{ "DE-AT", new LocaleItem() { Code = "DE-AT", Country = "奥地利", Language = "德语" } },
{ "DE-CH", new LocaleItem() { Code = "DE-CH", Country = "瑞士", Language = "德语" } },
{ "DE-DE", new LocaleItem() { Code = "DE-DE", Country = "德国", Language = "德语" } },
{ "el-GR", new LocaleItem() { Code = "el-GR", Country = "希腊", Language = "希腊语" } },
{ "en-CA", new LocaleItem() { Code = "en-CA", Country = "加拿大", Language = "英语" } },
{ "en-GB", new LocaleItem() { Code = "en-GB", Country = "英国", Language = "英语" } },
{ "en-IE", new LocaleItem() { Code = "en-IE", Country = "爱尔兰", Language = "英语" } },
{ "en-US", new LocaleItem() { Code = "en-US", Country = "美国", Language = "英语" } },
{ "en-ES", new LocaleItem() { Code = "en-ES", Country = "西班牙", Language = "西班牙语" } },
{ "fi-FI", new LocaleItem() { Code = "fi-FI", Country = "芬兰", Language = "芬兰语" } },
{ "fr-BE", new LocaleItem() { Code = "fr-BE", Country = "比利时", Language = "法语" } },
{ "fr-CA", new LocaleItem() { Code = "fr-CA", Country = "加拿大", Language = "法语" } },
{ "fr-CH", new LocaleItem() { Code = "fr-CH", Country = "瑞士", Language = "法语" } },
{ "fr-FR", new LocaleItem() { Code = "fr-FR", Country = "法国", Language = "法语" } },
{ "it-CH", new LocaleItem() { Code = "it-CH", Country = "瑞士", Language = "意大利语" } },
{ "it-IT", new LocaleItem() { Code = "it-IT", Country = "意大利", Language = "意大利语" } },
{ "ja-JP", new LocaleItem() { Code = "ja-JP", Country = "日本", Language = "日语" } },
{ "ko-KR", new LocaleItem() { Code = "ko-KR", Country = "韩国", Language = "韩语" } },
{ "nl-BE", new LocaleItem() { Code = "nl-BE", Country = "比利时", Language = "荷兰语" } },
{ "nl-NL", new LocaleItem() { Code = "nl-NL", Country = "荷兰", Language = "荷兰语" } },
{ "no-NO", new LocaleItem() { Code = "no-NO", Country = "挪威", Language = "挪威语(Nynorsk)" } },
{ "no-NO-B", new LocaleItem() { Code = "no-NO-B", Country = "挪威", Language = "挪威语(Bokmal)" } },
{ "pt-PT", new LocaleItem() { Code = "pt-PT", Country = "葡萄牙", Language = "葡萄牙语" } },
{ "sv-SE", new LocaleItem() { Code = "sv-SE", Country = "瑞典", Language = "瑞典语" } },
{ "tr-TR", new LocaleItem() { Code = "rr-TR", Country = "土耳其", Language = "土耳其语" } },
{ "zh-CN", new LocaleItem() { Code = "zh-CN", Country = "中国", Language = "中文(简体)" } },
{ "zh-TW", new LocaleItem() { Code = "zh-TW", Country = "中国台湾", Language = "中文(繁体)" } },
};
return dic;
}
}
}
///
/// 系统国际化资源数据类
///
[Serializable]
public class SysMessage
{
private List localeCodes = new List() { "en-US", "zh-CN" };
private Dictionary> messages = new Dictionary>();
///
/// 区域列表
///
public List LocaleCodes
{
get { return localeCodes; }
set { localeCodes = value; }
}
///
/// 资源列表
///
public Dictionary> Messages
{
get { return messages; }
set { messages = value; }
}
}
///
/// 区域项
///
[Serializable]
public class LocaleItem
{
private string code;
private string country;
private string language;
private string value;
///
/// 区域代号
///
public string Code
{
get { return code; }
set { code = value; }
}
///
/// 国家
///
public string Country
{
get { return country; }
set { country = value; }
}
///
/// 语言
///
public string Language
{
get { return language; }
set { language = value; }
}
///
/// 区域值
///
public string Value
{
get { return this.value; }
set { this.value = value; }
}
public override string ToString()
{
return String.Format("({0}) {1}", this.code , this.country + "-" + this.language);
}
}
///
/// 国际化资源项
///
//[Serializable]
//public class MessageItem
//{
// private string msgId;
// private Dictionary locales = new Dictionary();
// ///
// /// 资源Id
// ///
// public string MsgId
// {
// get { return msgId; }
// set { msgId = value; }
// }
// ///
// /// 区域集合信息
// ///
// public Dictionary Locales
// {
// get { return locales; }
// set { locales = value; }
// }
//}
}