汉化 OpenERP 6.1 的日历
-
研究了一下怎么汉化 OpenERP 6.1 的日历视图,最终还是搞定了。解决的办法就是修改 openerp/addons/web_calendar/openerp.py 文件:
{<br /> "name": "web calendar",<br /> "category": "Hidden",<br /> "description":<br /> """<br /> OpenERP Web calendar view.<br /> """,<br /> "version": "2.0",<br /> "depends": ['web'],<br /> "js": [<br /> 'static/lib/dhtmlxScheduler/codebase/dhtmlxscheduler_debug.js',<br /> 'static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_minical.js',<br /> 'static/lib/dhtmlxScheduler/sources/locale_cn.js',<br /> 'static/src/js/calendar.js',<br /> ],<br /> "css": [<br /> 'static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_ext.css',<br /> 'static/src/css/web_calendar.css'<br /> ],<br /> 'qweb' : [<br /> "static/src/xml/*.xml",<br /> ],<br /> 'active': True<br />}<br />
详情参考:
http://oldrev.wordpress.com/2012/03/24/如何汉化-openerp-6-1-日历视图/
上面的 wordpress 链接如果打不开可以看国内 cnblogs 镜像:
http://www.cnblogs.com/oldrev/archive/2012/03/24/2415404.html -
[quote author=Jeff link=topic=2851.msg9593#msg9593 date=1332582362]
直接用编辑器打开 openerp/addons/web_calendar/openerp.py,在系统原有的 'static/src/js/calendar.js' 行上方插入:'static/lib/dhtmlxScheduler/sources/locale_cn.js'。
那么其他国家的岂不是要引入其他js?
如果有更通用的办法就好了,可以给官方提个patch
另外,登陆界面也是英文,改xml毕竟是下策。
[/quote]
没办法,locale_xxx.js 的后缀跟 OE 的又没有对应,而且在 openerp.py 里也没法取到当前登录用户的语言(或者我不知道?)。 -
汉化这个解决方案
1、到http://jquery-ui.googlecode.com/svn/trunk/ui/i18n/jquery.ui.datepicker-zh-CN.js下载到相关文件夹中,我的存在"static/lib/jquery.ui.timepicker/js/",中,此汉化日期
2、将以下存成jquery.ui.timepicker-zh-CN.js中并放在同样文件夹下,此汉化时间
/* Chinese translation for the jQuery Timepicker Addon */
jQuery(function($) {
$.timepicker.regional['zh-CN'] = {
currentText: '现在',
closeText: '完成',
ampm: false,
amNames: ['上午', 'AM'],
pmNames: ['下午', 'PM'],
timeFormat: 'hh:mm tt',
timeSuffix: '',
timeOnlyTitle: '选择时间',
timeText: '时间',
hourText: '时',
minuteText: '分',
secondText: '秒',
millisecText: '毫秒',
timezoneText: '时区',
};
$.timepicker.setDefaults($.timepicker.regional['zh-CN']);
});
3、在web的__openerp__.py中 "static/lib/jquery.ui.timepicker/js/jquery-ui-timepicker-addon.js",下加入以下两行
"static/lib/jquery.ui.timepicker/js/jquery.ui.datepicker-zh-CN.js",
"static/lib/jquery.ui.timepicker/js/jquery.ui.timepicker-zh-CN.js",
即可 -
dhtmlxgantt中找到个参数。
web_gantt/static/src/js/gantt.js 文件中,添加以下两行,可以将月份改成中文。
起始日期,结束日期好象还是英文。
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login