Skip to content
  • Categories
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Flatly)
  • No Skin
Collapse

Odoo 中文社区

  1. Home
  2. Categories
  3. Odoo 中文翻译
  4. 汉化 OpenERP 6.1 的日历

汉化 OpenERP 6.1 的日历

Scheduled Pinned Locked Moved Odoo 中文翻译
6 Posts 3 Posters 17.6k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • O Offline
    O Offline
    oldrev
    wrote on last edited by
    #1

    研究了一下怎么汉化 OpenERP 6.1 的日历视图,最终还是搞定了。解决的办法就是修改  openerp/addons/web_calendar/openerp.py 文件:

    {<br />&nbsp; &nbsp; &quot;name&quot;: &quot;web calendar&quot;,<br />&nbsp; &nbsp; &quot;category&quot;: &quot;Hidden&quot;,<br />&nbsp; &nbsp; &quot;description&quot;:<br />&nbsp; &nbsp; &nbsp; &nbsp; &quot;&quot;&quot;<br />&nbsp; &nbsp; &nbsp; &nbsp; OpenERP Web calendar view.<br />&nbsp; &nbsp; &nbsp; &nbsp; &quot;&quot;&quot;,<br />&nbsp; &nbsp; &quot;version&quot;: &quot;2.0&quot;,<br />&nbsp; &nbsp; &quot;depends&quot;: &#91;&#039;web&#039;],<br />&nbsp; &nbsp; &quot;js&quot;: [<br />&nbsp; &nbsp; &nbsp; &nbsp; &#039;static/lib/dhtmlxScheduler/codebase/dhtmlxscheduler_debug.js&#039;,<br />&nbsp; &nbsp; &nbsp; &nbsp; &#039;static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_minical.js&#039;,<br />&nbsp; &nbsp; &nbsp; &nbsp; &#039;static/lib/dhtmlxScheduler/sources/locale_cn.js&#039;,<br />&nbsp; &nbsp; &nbsp; &nbsp; &#039;static/src/js/calendar.js&#039;,<br />&nbsp; &nbsp; ],<br />&nbsp; &nbsp; &quot;css&quot;: [<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#039;static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_ext.css&#039;,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#039;static/src/css/web_calendar.css&#039;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ],<br />&nbsp; &nbsp; &#039;qweb&#039; : [<br />&nbsp; &nbsp; &nbsp; &nbsp; &quot;static/src/xml/*.xml&quot;,<br />&nbsp; &nbsp; ],<br />&nbsp; &nbsp; &#039;active&#039;: 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

    1 Reply Last reply
    0
    • W Offline
      W Offline
      wjfonhand
      wrote on last edited by
      #2

      直接用编辑器打开 openerp/addons/web_calendar/openerp.py,在系统原有的 'static/src/js/calendar.js' 行上方插入:'static/lib/dhtmlxScheduler/sources/locale_cn.js'。

      那么其他国家的岂不是要引入其他js?
      如果有更通用的办法就好了,可以给官方提个patch

      另外,登陆界面也是英文,改xml毕竟是下策。

      GoodERP -- Odoo China fork

      1 Reply Last reply
      0
      • O Offline
        O Offline
        oldrev
        wrote on last edited by
        #3

        [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 Reply Last reply
        0
        • H Offline
          H Offline
          hungriness
          wrote on last edited by
          #4

          汉化这个解决方案
          1、到http://jquery-ui.googlecode.com/svn/trunk/ui/i18n/jquery.ui.datepicker-zh-CN.js下载到相关文件夹中,我的存在&quot;static/lib/jquery.ui.timepicker/js/&quot;,中,此汉化日期
          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",
          即可

          1 Reply Last reply
          0
          • H Offline
            H Offline
            hungriness
            wrote on last edited by
            #5

            dhtmlxgantt中找到个参数。
            web_gantt/static/src/js/gantt.js  文件中,添加以下两行,可以将月份改成中文。
            起始日期,结束日期好象还是英文。

            1 Reply Last reply
            0

            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
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Tags
            • Popular
            • Users
            • Groups