Files
ClientServerProject/CommonLibrary/LocalizationSupport/Localization.cs

168 lines
4.5 KiB
C#
Raw Normal View History

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace CommonLibrary
{
/*******************************************************************************************
*
*
*
*******************************************************************************************/
/// <summary>
/// 整个软件系统的本地化策略
/// </summary>
public static class UserLocalization
{
/// <summary>
/// 设置系统的语言选项
/// </summary>
/// <param name="language">语言名称</param>
public static void SettingLocalization(string language)
{
if(language.ToLower() == "chinese")
{
localization = Chinese;
}
else
{
localization = English;
}
}
/// <summary>
/// 获取当前指定的语言选项信息
/// </summary>
/// <param name="language"></param>
/// <returns></returns>
public static ILocalization GetSpecifiedLocalization(string language)
{
if (language.ToLower() == "chinese")
{
return Chinese;
}
else
{
return English;
}
}
/// <summary>
/// 默认的语言选项
/// </summary>
public static ILocalization Localization
{
get { return localization; }
}
private static ILocalization Chinese = new ChineseLocalization(); // 中文语言
private static ILocalization English = new EnglishLocalization(); // 英文语言
private static ILocalization localization = Chinese; // 当前语言
}
/// <summary>
/// 所有支持的语言必须从本接口继承
/// </summary>
public interface ILocalization
{
string FormateDateTime { get; set; }
/// <summary>
/// 唯一标识
/// </summary>
string GeneralUniqueID { get; set;}
/// <summary>
/// 名称
/// </summary>
string GeneralName { get; set; }
/// <summary>
/// 描述
/// </summary>
string GeneralDescription { get; set; }
#region
/// <summary>
/// 确认
/// </summary>
string ButtonEnsure { get; set; }
/// <summary>
/// 新增
/// </summary>
string ButtonAdd { get; set; }
/// <summary>
/// 编辑
/// </summary>
string ButtonEdit { get; set; }
/// <summary>
/// 删除
/// </summary>
string ButtonDelete { get; set; }
/// <summary>
/// 保存
/// </summary>
string ButtonSave { get; set; }
/// <summary>
/// 取消
/// </summary>
string ButtonCancel { get; set; }
#endregion
#region
string AccountSelect { get; set; }
string AccountName { get; set; }
string AccountAlias { get; set; }
string AccountPassword { get; set; }
string AccountFactory { get; set; }
string AccountGrade { get; set; }
string AccountRegisterTime { get; set; }
string AccountLoginEnable { get; set; }
string AccountForbidMessage { get; set; }
string AccountLoginFrequency { get; set; }
string AccountLastLoginTime { get; set; }
string AccountLastLoginIpAddress { get; set; }
string AccountLoginFailedCount { get; set; }
string AccountLastLoginWay { get; set; }
string AccountPortrait { get; set; }
string AccountDetails { get; set; }
string AccountRegisterTitle { get; set; }
string AccountRoleAdd { get; set; }
string AccountRoleEdit { get; set; }
string AccountRoleNameList { get; set; } // 角色名称列表
string AccountRoleAccountList { get; set; } //关联账户列表
#endregion
#region
string SettingsText { get; set; }
string SettingsSystem { get; set; }
string SettingsGeneral { get; set; }
string SettingsAccountFactory { get; set; }
string SettingsTrustClient { get; set; }
string SettingsRoleAssign { get; set; }
string SettingsRoleAddTitle { get; set; }
string SettingsRoleEditTitle { get; set; }
#endregion
}
}