odoo17 翻译模块备忘

odoo17 翻译模块备忘

自定义模块安装前:

复制代码
{
  "en_US": "<field name=\"groups_id\" position=\"replace\">\n  <field name=\"sel_groups_1_10_11\" invisible=\"1\" on_change=\"1\"/>\n  <field name=\"sel_groups_8\" groups=\"!base.group_no_one\" readonly=\"sel_groups_1_10_11 != 1\" on_change=\"1\" invisible=\"1\"/>\n  <field name=\"in_group_9\" groups=\"!base.group_no_one\" readonly=\"sel_groups_1_10_11 != 1\" invisible=\"1\"/>\n  <field name=\"in_group_5\" groups=\"!base.group_no_one\" readonly=\"sel_groups_1_10_11 != 1\" invisible=\"1\"/>\n  <field name=\"in_group_6\" groups=\"!base.group_no_one\" readonly=\"sel_groups_1_10_11 != 1\" invisible=\"1\"/>\n  <field name=\"in_group_7\" groups=\"!base.group_no_one\" readonly=\"sel_groups_1_10_11 != 1\" invisible=\"1\"/>\n  <field name=\"in_group_3\" readonly=\"sel_groups_1_10_11 != 1\" invisible=\"1\" groups=\"!base.group_no_one\"/>\n  <group groups=\"base.group_no_one\">\n    <separator string=\"User Type\" colspan=\"2\" groups=\"base.group_no_one\"/>\n    <field name=\"sel_groups_1_10_11\" widget=\"radio\" on_change=\"1\"/>\n    <newline/>\n  </group>\n  <group invisible=\"sel_groups_1_10_11 != 1\">\n    <div class=\"alert alert-warning\" role=\"alert\" colspan=\"2\" invisible=\"not user_group_warning\">\n      <label for=\"user_group_warning\" string=\"Access Rights Mismatch\" class=\"text text-warning fw-bold\"/>\n      <field name=\"user_group_warning\"/>\n    </div>\n  </group>\n  <group invisible=\"sel_groups_1_10_11 != 1\">\n    <group string=\"Administration\">\n      <newline/>\n      <field name=\"sel_groups_2_4\" readonly=\"sel_groups_1_10_11 != 1\" on_change=\"1\"/>\n      <newline/>\n    </group>\n    <group string=\"Other\">\n      <newline/>\n      <field name=\"sel_groups_8\" groups=\"base.group_no_one\" readonly=\"sel_groups_1_10_11 != 1\" on_change=\"1\"/>\n      <newline/>\n    </group>\n  </group>\n  <group invisible=\"sel_groups_1_10_11 != 1\" groups=\"base.group_no_one\" class=\"o_label_nowrap\">\n    <separator string=\"其它权限\" groups=\"base.group_no_one\"/>\n    <group>\n      <field name=\"in_group_9\" groups=\"base.group_no_one\" readonly=\"sel_groups_1_10_11 != 1\"/>\n      <field name=\"in_group_6\" groups=\"base.group_no_one\" readonly=\"sel_groups_1_10_11 != 1\"/>\n    </group>\n    <group>\n      <field name=\"in_group_5\" groups=\"base.group_no_one\" readonly=\"sel_groups_1_10_11 != 1\"/>\n      <field name=\"in_group_7\" invisible=\"1\" groups=\"base.group_no_one\" readonly=\"sel_groups_1_10_11 != 1\"/>\n    </group>\n    <separator string=\"Other\"/>\n    <group>\n      <field name=\"in_group_3\" readonly=\"sel_groups_1_10_11 != 1\"/>\n    </group>\n    <group/>\n  </group>\n</field>",
  "zh_CN": "<field name=\"groups_id\" position=\"replace\">\n  <field name=\"sel_groups_1_10_11\" invisible=\"1\" on_change=\"1\"/>\n  <field name=\"sel_groups_8\" groups=\"!base.group_no_one\" readonly=\"sel_groups_1_10_11 != 1\" on_change=\"1\" invisible=\"1\"/>\n  <field name=\"in_group_9\" groups=\"!base.group_no_one\" readonly=\"sel_groups_1_10_11 != 1\" invisible=\"1\"/>\n  <field name=\"in_group_5\" groups=\"!base.group_no_one\" readonly=\"sel_groups_1_10_11 != 1\" invisible=\"1\"/>\n  <field name=\"in_group_6\" groups=\"!base.group_no_one\" readonly=\"sel_groups_1_10_11 != 1\" invisible=\"1\"/>\n  <field name=\"in_group_7\" groups=\"!base.group_no_one\" readonly=\"sel_groups_1_10_11 != 1\" invisible=\"1\"/>\n  <field name=\"in_group_3\" readonly=\"sel_groups_1_10_11 != 1\" invisible=\"1\" groups=\"!base.group_no_one\"/>\n  <group groups=\"base.group_no_one\">\n    <separator string=\"用户类型\" colspan=\"2\" groups=\"base.group_no_one\"/>\n    <field name=\"sel_groups_1_10_11\" widget=\"radio\" on_change=\"1\"/>\n    <newline/>\n  </group>\n  <group invisible=\"sel_groups_1_10_11 != 1\">\n    <div class=\"alert alert-warning\" role=\"alert\" colspan=\"2\" invisible=\"not user_group_warning\">\n      <label for=\"user_group_warning\" string=\"访问权限不匹配\" class=\"text text-warning fw-bold\"/>\n      <field name=\"user_group_warning\"/>\n    </div>\n  </group>\n  <group invisible=\"sel_groups_1_10_11 != 1\">\n    <group string=\"管理栏\">\n      <newline/>\n      <field name=\"sel_groups_2_4\" readonly=\"sel_groups_1_10_11 != 1\" on_change=\"1\"/>\n      <newline/>\n    </group>\n    <group string=\"其他\">\n      <newline/>\n      <field name=\"sel_groups_8\" groups=\"base.group_no_one\" readonly=\"sel_groups_1_10_11 != 1\" on_change=\"1\"/>\n      <newline/>\n    </group>\n  </group>\n  <group invisible=\"sel_groups_1_10_11 != 1\" groups=\"base.group_no_one\" class=\"o_label_nowrap\">\n    <separator string=\"其它权限\" groups=\"base.group_no_one\"/>\n    <group>\n      <field name=\"in_group_9\" groups=\"base.group_no_one\" readonly=\"sel_groups_1_10_11 != 1\"/>\n      <field name=\"in_group_6\" groups=\"base.group_no_one\" readonly=\"sel_groups_1_10_11 != 1\"/>\n    </group>\n    <group>\n      <field name=\"in_group_5\" groups=\"base.group_no_one\" readonly=\"sel_groups_1_10_11 != 1\"/>\n      <field name=\"in_group_7\" invisible=\"1\" groups=\"base.group_no_one\" readonly=\"sel_groups_1_10_11 != 1\"/>\n    </group>\n    <separator string=\"其他\"/>\n    <group>\n      <field name=\"in_group_3\" readonly=\"sel_groups_1_10_11 != 1\"/>\n    </group>\n    <group/>\n  </group>\n</field>"
}

安装后

复制代码
{
  "en_US": "<field name=\"groups_id\" position=\"replace\">\n  <field name=\"sel_groups_1_10_11\" invisible=\"1\" on_change=\"1\"/>\n  <field name=\"in_group_8\" groups=\"!base.group_no_one\" readonly=\"sel_groups_1_10_11 != 1\" invisible=\"1\"/>\n  <field name=\"in_group_12\" groups=\"!base.group_no_one\" readonly=\"sel_groups_1_10_11 != 1\" invisible=\"1\"/>\n  <field name=\"in_group_9\" groups=\"!base.group_no_one\" readonly=\"sel_groups_1_10_11 != 1\" invisible=\"1\"/>\n  <field name=\"in_group_5\" groups=\"!base.group_no_one\" readonly=\"sel_groups_1_10_11 != 1\" invisible=\"1\"/>\n  <field name=\"in_group_6\" groups=\"!base.group_no_one\" readonly=\"sel_groups_1_10_11 != 1\" invisible=\"1\"/>\n  <field name=\"in_group_7\" groups=\"!base.group_no_one\" readonly=\"sel_groups_1_10_11 != 1\" invisible=\"1\"/>\n  <field name=\"in_group_3\" readonly=\"sel_groups_1_10_11 != 1\" invisible=\"1\" groups=\"!base.group_no_one\"/>\n  <group groups=\"base.group_no_one\">\n    <separator string=\"User Type\" colspan=\"2\" groups=\"base.group_no_one\"/>\n    <field name=\"sel_groups_1_10_11\" widget=\"radio\" on_change=\"1\"/>\n    <newline/>\n  </group>\n  <group invisible=\"sel_groups_1_10_11 != 1\">\n    <div class=\"alert alert-warning\" role=\"alert\" colspan=\"2\" invisible=\"not user_group_warning\">\n      <label for=\"user_group_warning\" string=\"Access Rights Mismatch\" class=\"text text-warning fw-bold\"/>\n      <field name=\"user_group_warning\"/>\n    </div>\n  </group>\n  <group invisible=\"sel_groups_1_10_11 != 1\">\n    <group string=\"管理\">\n      <newline/>\n      <field name=\"sel_groups_2_4\" readonly=\"sel_groups_1_10_11 != 1\" on_change=\"1\"/>\n      <newline/>\n    </group>\n  </group>\n  <group invisible=\"sel_groups_1_10_11 != 1\" groups=\"base.group_no_one\" class=\"o_label_nowrap\">\n    <separator string=\"Technical\" groups=\"base.group_no_one\"/>\n    <group>\n      <field name=\"in_group_8\" groups=\"base.group_no_one\" readonly=\"sel_groups_1_10_11 != 1\"/>\n    </group>\n    <group>\n      <field name=\"in_group_12\" groups=\"base.group_no_one\" readonly=\"sel_groups_1_10_11 != 1\"/>\n    </group>\n    <separator string=\"其它权限\" groups=\"base.group_no_one\"/>\n    <group>\n      <field name=\"in_group_9\" groups=\"base.group_no_one\" readonly=\"sel_groups_1_10_11 != 1\"/>\n      <field name=\"in_group_6\" groups=\"base.group_no_one\" readonly=\"sel_groups_1_10_11 != 1\"/>\n    </group>\n    <group>\n      <field name=\"in_group_5\" groups=\"base.group_no_one\" readonly=\"sel_groups_1_10_11 != 1\"/>\n      <field name=\"in_group_7\" invisible=\"1\" groups=\"base.group_no_one\" readonly=\"sel_groups_1_10_11 != 1\"/>\n    </group>\n    <separator string=\"Other\"/>\n    <group>\n      <field name=\"in_group_3\" readonly=\"sel_groups_1_10_11 != 1\"/>\n    </group>\n    <group/>\n  </group>\n</field>",
  "zh_CN": "<field name=\"groups_id\" position=\"replace\">\n  <field name=\"sel_groups_1_10_11\" invisible=\"1\" on_change=\"1\"/>\n  <field name=\"in_group_8\" groups=\"!base.group_no_one\" readonly=\"sel_groups_1_10_11 != 1\" invisible=\"1\"/>\n  <field name=\"in_group_12\" groups=\"!base.group_no_one\" readonly=\"sel_groups_1_10_11 != 1\" invisible=\"1\"/>\n  <field name=\"in_group_9\" groups=\"!base.group_no_one\" readonly=\"sel_groups_1_10_11 != 1\" invisible=\"1\"/>\n  <field name=\"in_group_5\" groups=\"!base.group_no_one\" readonly=\"sel_groups_1_10_11 != 1\" invisible=\"1\"/>\n  <field name=\"in_group_6\" groups=\"!base.group_no_one\" readonly=\"sel_groups_1_10_11 != 1\" invisible=\"1\"/>\n  <field name=\"in_group_7\" groups=\"!base.group_no_one\" readonly=\"sel_groups_1_10_11 != 1\" invisible=\"1\"/>\n  <field name=\"in_group_3\" readonly=\"sel_groups_1_10_11 != 1\" invisible=\"1\" groups=\"!base.group_no_one\"/>\n  <group groups=\"base.group_no_one\">\n    <separator string=\"User Type\" colspan=\"2\" groups=\"base.group_no_one\"/>\n    <field name=\"sel_groups_1_10_11\" widget=\"radio\" on_change=\"1\"/>\n    <newline/>\n  </group>\n  <group invisible=\"sel_groups_1_10_11 != 1\">\n    <div class=\"alert alert-warning\" role=\"alert\" colspan=\"2\" invisible=\"not user_group_warning\">\n      <label for=\"user_group_warning\" string=\"Access Rights Mismatch\" class=\"text text-warning fw-bold\"/>\n      <field name=\"user_group_warning\"/>\n    </div>\n  </group>\n  <group invisible=\"sel_groups_1_10_11 != 1\">\n    <group string=\"管理\">\n      <newline/>\n      <field name=\"sel_groups_2_4\" readonly=\"sel_groups_1_10_11 != 1\" on_change=\"1\"/>\n      <newline/>\n    </group>\n  </group>\n  <group invisible=\"sel_groups_1_10_11 != 1\" groups=\"base.group_no_one\" class=\"o_label_nowrap\">\n    <separator string=\"Technical\" groups=\"base.group_no_one\"/>\n    <group>\n      <field name=\"in_group_8\" groups=\"base.group_no_one\" readonly=\"sel_groups_1_10_11 != 1\"/>\n    </group>\n    <group>\n      <field name=\"in_group_12\" groups=\"base.group_no_one\" readonly=\"sel_groups_1_10_11 != 1\"/>\n    </group>\n    <separator string=\"其它权限\" groups=\"base.group_no_one\"/>\n    <group>\n      <field name=\"in_group_9\" groups=\"base.group_no_one\" readonly=\"sel_groups_1_10_11 != 1\"/>\n      <field name=\"in_group_6\" groups=\"base.group_no_one\" readonly=\"sel_groups_1_10_11 != 1\"/>\n    </group>\n    <group>\n      <field name=\"in_group_5\" groups=\"base.group_no_one\" readonly=\"sel_groups_1_10_11 != 1\"/>\n      <field name=\"in_group_7\" invisible=\"1\" groups=\"base.group_no_one\" readonly=\"sel_groups_1_10_11 != 1\"/>\n    </group>\n    <separator string=\"Other\"/>\n    <group>\n      <field name=\"in_group_3\" readonly=\"sel_groups_1_10_11 != 1\"/>\n    </group>\n    <group/>\n  </group>\n</field>"
}

升级模块:

翻译也不起作用

复制代码
#. module: resconfig
#: model_terms:ir.ui.view,arch_db:base.user_groups_view
msgid "User Type"
msgstr "用户类型"

#. module: resconfig
#: model_terms:ir.ui.view,arch_db:base.res.users.groups
msgid ""
"<separator string=\"Technical\" groups=\"base.group_no_one\"/>\n"
""
msgstr ""
"<separator string=\"真怪了的技术 \" groups=\"base.group_no_one\"/>\n"
""
复制代码
#. module: base
#: model_terms:ir.ui.view,arch_db:base.user_groups_view
msgid "User Type"
msgstr "用户类型"

#. module: base
#: model_terms:ir.ui.view,arch_db:base.res.users.groups
msgid ""
"<separator string=\"Technical\" groups=\"base.group_no_one\"/>\n"
""
msgstr ""
"<separator string=\"真怪了的技术 \" groups=\"base.group_no_one\"/>\n"
""
相关推荐
杨云龙UP16 分钟前
SQL Server 备份异地同步 + 清理脚本
运维·服务器·数据库·sql·mysql·sqlserver
行走的陀螺仪17 分钟前
GitLab CI/CD 完整教学指南
前端·ci/cd·gitlab·团队开发·自动化测试部署
O***Z61623 分钟前
Redis——Windows安装
数据库·windows·redis
老鱼说AI26 分钟前
算法基础教学第一步:数据结构
数据结构·python·算法
2301_7951672028 分钟前
Python 高手编程系列八:缓存
开发语言·python·缓存
0***h94228 分钟前
MySQL 启动失败 (code=exited, status=1FAILURE) 异常解决方案
数据库·mysql
谢尔登29 分钟前
Webpack高级之常用配置项
前端·webpack·node.js
helloyangkl33 分钟前
前端——不同环境下配置env
前端·javascript·react.js
竹秋…35 分钟前
webpack搭建react开发环境
前端·react.js·webpack