w2ui本地化

原创
2013/07/04 17:46
阅读数 1K
{
    "locale"		: "zh-CN",
	"date_format"	: "yyyy-mm-dd",
	"date_display"	: "yyyy年mm月dd日",
	"time_format"	: "h24点mi分",
	"currency"		: "^[\\$\\€\\£\\¥\\¥]?[-]?[0-9]*[\\.]?[0-9]+$",
	"float"			: "^[-]?[0-9]*[\\.]?[0-9]+$",
	"shortmonths"	: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"],
	"fullmonths"	: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"],
	"shortdays"		: ["一", "二", "三", "四", "五", "六","日"],
	"fulldays" 		: ["星期一", "星期二", "星期三", "星期四", "星期五", "星期六","星期日"],
	"phrases" : {
		"yesterday"	: "昨天",
		"none" : "没有",
		"No items found" : "没有找到项目",
		"Attach files by dragging and dropping or Click to Select" : "附加文件通过拖放或单击以选中", 
		"Remove" : "移动", 
		"Not a valid date" : "不是一个有效的日期", 
		"Required field" : "必须填写",
		"Saving..." : "保存中...",
		"Not an integer" : "不是一个整数(int)",
		"Not a float" : "不是一个浮点数(float)",
		"Not in money format" : "不是货币格式",
		"Not a hex number" : "不是一个十六进制数",
		"Not alpha-numeric" : "不是字母或数字",
		"Not a valid email" : "不是一个有效的Email地址",
		"Are you sure you want to delete selected records?" : "你是想要删除选中的记录吗?",
		"Return data is not in JSON format. See console for more information." : "返回的数据不是JSON格式,更多信息请在控制台中查看.",
		"Refreshing..." : "刷新中...",
		"All Fields" : "所有字段",
		"Multi Fields" : "多个字段",
		"Delete Confirmation": "删除确认",
		"Ok": "好",
		"Yes" : "是",
		"No" : "不是",
		"Reload data in the list" : "重新加载数据列表中",
		"Show/hide columns" : "显示/隐藏列",
		"Select Search Field" : "选择搜索字段",
		"Search..." : "搜索中...",
		"Open Search Fields" : "开放搜索字段",
		"is" : "是(等于)",
		"begins with" : "开始于",
		"contains" : "包含",
		"ends with" : "结束于",
		"between" : "在之间",
		"Add new record" : "添加新记录",
		"Add New" : "添加新的",
		"Delete selected records" : "删除选中的记录",
		"Delete" : "删除",
		"Save changed records" : "保存修改过的记录",
		"Save" : "保存",
		"Reset" : "重置",
		"Search" : "搜索",
		"Confirmation" : "确认",
		"Notification" : "通知",
		"Show" : "显示",
		"Hide" : "隐藏"
	}
}

讲文件保存为zh-cn.json的文件并放在locale目录中,调用方法如下:

var locale = {
	path : 'ui/',  // 本地化文件路径
	lang : 'zh-CN'    // 本地化文件名称
}

$(function(){
	w2utils.locale(locale);
});

 

展开阅读全文
打赏
0
4 收藏
分享
加载中
更多评论
打赏
0 评论
4 收藏
0
分享
返回顶部
顶部