Odoo实现多语言翻译

Odoo是支持多语言的,在开发模块包中有i18n文件夹,里面包含各种语言的语言包文件,其后缀名是.po

Odoo语言修改翻译有多种方式:

1.在后台设置->激活开发者模式,翻译->以翻译语言包进行在线编辑翻译,也可以导出未翻译的语言包,在本地用编辑器翻译

2.直接修改开发模块中的po语言翻译文件

我们下面讨论的是第二种方式的翻译工作方法:

Odoo翻译的类型可以分为9类:

(1)字段 fields

 #. module: tkcx_cf_views_v15

#: model:ir.model.fields,field_description: field_ tkcx_cf_views_v15.cf_view

msgid "Balance"

msgstr "余额"  

(2)字段 selection

 #. module: tkcx_cf_views_v15

#: selection:sale.order,status:0

msgid "No Paid"

msgstr "未支付"  

(3)动作 ir.actions.act_window

#. module: base_accounting_kit

#: model:ir.actions.act_window,name:base_accounting_kit.action_account_group

msgid "Account Groups"

msgstr "科目组"

(4)菜单 ir.ui.menu

#. module: base_accounting_kit

#: model:ir.ui.menu,name:base_accounting_kit.menu_account_financial_reports_tree

msgid "Account Reports"

msgstr "财务报告"

(5)视图 ir.ui.view中的 placeholder,string

#. module: base_accounting_kit

#: model_terms:ir.ui.view,arch_db:base_accounting_kit.report_agedpartnerbalance

msgid "Account Total"

msgstr "科目合计"

(6)权限组 res.groups

#. module: base_accounting_kit

#: model:res.groups,name: base_accounting_kit .group_user_readonly

msgid "Readonly"

msgstr "只读"

(7)SQL 约束翻译

#. module: base_accounting_kit

#: model:ir.model.constraint, base_accounting_kit .constraint_res_partner_name_unique

msgid "Already has the same name !"

msgstr "已经有相同的名称了!"

(8)错误/警告提示翻译

#. module: account

#: code:addons/account/report/account_aged_partner_balance.py:0

#: code:addons/account/report/account_journal.py:0

#, python-format

msgid "Form content is missing, this report cannot be printed."

msgstr "表单内容丢失,无法列出此报表。"

(9)Report 报表翻译

#. module: base_accounting_kit

#: model_terms:ir.ui.view,arch_db:base_accounting_kit.report_cash_flow

msgid "All Entries"

msgstr "所有分录"

总结:

翻译文档需要设置模块名,

格式一:#: model:对象名称,field_description/name:模块名.xml_id

格式二:#: model_terms:对象名称,arch_db:模块名.xml_id

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容