如何翻译一个OpenERP模块? [英] How to translate an OpenERP module?

查看:48
本文介绍了如何翻译一个OpenERP模块?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚构建了一个自定义的OpenERP模块,比如说/addons/the_meaning_of_life. 现在,我想将其翻译为另一种语言. 我现在应该有一个包含.pot.po文件的i18n文件夹.如何生成这些?最好有逐步的指南.

I've just built a custom OpenERP module, let's say /addons/the_meaning_of_life. Now I want to translate it to another language. I now I'm supposed to have an i18n folder containing a .pot and .pofiles. How do I generate these ? It would be nice to have a step-by-step guide.

推荐答案

好吧,您可以做的是:

  1. 在您的数据库中安装所需的lang.
  2. 完成模块开发后,请在测试服务器上安装模块,然后转到以下向导Setting(or Configuration) > Translation> Import/Export/Export Translation.然后选择模块the_meaning_of_life和所需的语言.并以.po格式导出.
  3. 保存该po文件,然后在po文件中添加所需的翻译.然后,您可以将该po文件导入回数据库中,或将其添加到模块中的/addons/the_meaning_of_life/i18n文件夹下,该文件随模块一起提供.
  4. (仅适用于新模块),您还需要在同一i18n文件夹中包含"pot"文件,如果尚未安装,则可以通过重复步骤2来生成一个"pot"文件,而无需选择任何语言. 这样可以为模块中的某些语言提供可用的翻译,但是如果您要使用启动板翻译服务,请检查以下 url 会指导您使用.pot,但为此您需要在lp上清楚地进行项目.
  1. Install your desire lang in your db.
  2. Once you are done with your module development, install module on test server then go to the follwing Wizard Setting(or Configuration) > Translation> Import/Export/Export Translation. Then Choose the module the_meaning_of_life and desire lang. and export it in .po format.
  3. Save that po file then add the translation that you want in the po file. Then you can import back that po file in database or add it under your module under folder /addons/the_meaning_of_life/i18n and it is available with your module.
  4. (only for new modules), you need to have also the "pot" file in the same i18n folder, if you don't yet have it you can generate one by repeating step 2 but without choosing any language. This how you can make available translation for the some lang in your module but if you want use Launchpad translation service then check following url this will guide you using .pot but for that you need project on lp clearly.

希望这能回答您,谢谢

这篇关于如何翻译一个OpenERP模块?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆