为什么有些项目没有在 Odoo 中翻译?
Why are some items not translated in Odoo?
我在 Project 模块中遇到翻译问题。某些菜单项未翻译。可能是什么问题?
这里project_view.xml
<!-- Top menu item -->
<menuitem name="Project"
id="base.menu_main_pm"
groups="group_project_manager,group_project_user"
icon="fa-calendar"
web_icon="project,static/description/icon.png"
sequence="50"/>
这里ru.po
#. module: project
#: model:ir.model,name:project.model_project_project
#: model:ir.model.fields,field_description:project.field_project_task_history_cumulative_project_id
#: model:ir.model.fields,field_description:project.field_project_task_project_id
#: model:ir.model.fields,field_description:project.field_report_project_task_user_project_id
#: model:ir.ui.view,arch_db:project.edit_project
#: model:ir.ui.view,arch_db:project.view_task_form2
#: model:ir.ui.view,arch_db:project.view_task_history_search
#: model:ir.ui.view,arch_db:project.view_task_project_user_search
#: model:ir.ui.view,arch_db:project.view_task_search_form
#: model:res.request.link,name:project.req_link_project
msgid "Project"
msgstr "Проект"
有时翻译效果不是很好。尝试按 "Base" 模块中的 "Update" 按钮。这应该可以解决问题。
更新:2019 年 11 月 21 日
我不知道在旧版本中,但现在命令行中有更多选项可以更新、导入和导出翻译。参数 --i18n-overwrite
可能对您的情况有用:
Use these options to translate Odoo to another language. See i18n
section of the user manual. Option '-d' is mandatory. Option '-l' is
mandatory in case of importation
--load-language=LOAD_LANGUAGE
specifies the languages for the translations you want
to be loaded
-l LANGUAGE, --language=LANGUAGE
specify the language of the translation file. Use it
with --i18n-export or --i18n-import
--i18n-export=TRANSLATE_OUT
export all sentences to be translated to a CSV file, a
PO file or a TGZ archive and exit
--i18n-import=TRANSLATE_IN
import a CSV or a PO file with translations and exit.
The '-l' option is required.
--i18n-overwrite overwrites existing translation terms on updating a
module or importing a CSV or a PO file.
--modules=TRANSLATE_MODULES
specify modules to export. Use in combination with
--i18n-export
是的,有时本地化并不完美。这是来自 v8 的另一个策略,它可能在 v9 中仍然对您有所帮助。
- 首先,按照描述更新您的模块
- 然后,从数据库中删除模块的所有已翻译字符串。这是安全的,因为您的 ru.po 文件中有它们。
- 转到“设置”>“翻译”>“应用程序条款”>“翻译的条款”
- 使用 'Module' 'contains' 执行 "Advanced Search" 以查找所有术语
- select 全部(可能将寻呼机设置为 'unlimited')
- Select 'More' > 'Delete'
- 确认
- 再次更新您的模块。
- 再次导出ru.po文件;它现在应该包含所有缺失的术语。
问题似乎是该模块有时会从默认 (en) 语言中获取一些值到目标语言中,然后禁止将术语列为 'to be translated'。
我在翻译方面也遇到过这个问题。我也更新了模块 base
很多次并且它有效,但有时没有必要。我做的是下一个流程:
转到设置 > 翻译 > 加载翻译,select 你的
语言并选中复选框 覆盖现有条款,然后单击
加载按钮。
之后,按F5刷新浏览器,然后进入设置>
翻译 > 应用术语 > 同步术语,select 你的
语言并单击 更新。然后再按F5看看你的
条款已更新。
此致。
有时,仅更新基础模块是不够的。我实现了一个基于 post 的解决方案。我所做的是使用查询清除整个语言,然后再次使用重新加载语言。 "Load a Translation" 来自配置菜单。
使之成为可能的查询如下,例如 es_CL:
从 ir_translation 中删除 lang = 'es_CL';
我已经把它放在一个模块中,您可以使用它来适应您的需要:
https://github.com/odoo-chile/l10n_cl_clear_translation
安装此模块后,它会运行查询。然后您可以使用菜单重新加载您的语言。
我在 Project 模块中遇到翻译问题。某些菜单项未翻译。可能是什么问题?
这里project_view.xml
<!-- Top menu item -->
<menuitem name="Project"
id="base.menu_main_pm"
groups="group_project_manager,group_project_user"
icon="fa-calendar"
web_icon="project,static/description/icon.png"
sequence="50"/>
这里ru.po
#. module: project
#: model:ir.model,name:project.model_project_project
#: model:ir.model.fields,field_description:project.field_project_task_history_cumulative_project_id
#: model:ir.model.fields,field_description:project.field_project_task_project_id
#: model:ir.model.fields,field_description:project.field_report_project_task_user_project_id
#: model:ir.ui.view,arch_db:project.edit_project
#: model:ir.ui.view,arch_db:project.view_task_form2
#: model:ir.ui.view,arch_db:project.view_task_history_search
#: model:ir.ui.view,arch_db:project.view_task_project_user_search
#: model:ir.ui.view,arch_db:project.view_task_search_form
#: model:res.request.link,name:project.req_link_project
msgid "Project"
msgstr "Проект"
有时翻译效果不是很好。尝试按 "Base" 模块中的 "Update" 按钮。这应该可以解决问题。
更新:2019 年 11 月 21 日
我不知道在旧版本中,但现在命令行中有更多选项可以更新、导入和导出翻译。参数 --i18n-overwrite
可能对您的情况有用:
Use these options to translate Odoo to another language. See i18n
section of the user manual. Option '-d' is mandatory. Option '-l' is
mandatory in case of importation
--load-language=LOAD_LANGUAGE
specifies the languages for the translations you want
to be loaded
-l LANGUAGE, --language=LANGUAGE
specify the language of the translation file. Use it
with --i18n-export or --i18n-import
--i18n-export=TRANSLATE_OUT
export all sentences to be translated to a CSV file, a
PO file or a TGZ archive and exit
--i18n-import=TRANSLATE_IN
import a CSV or a PO file with translations and exit.
The '-l' option is required.
--i18n-overwrite overwrites existing translation terms on updating a
module or importing a CSV or a PO file.
--modules=TRANSLATE_MODULES
specify modules to export. Use in combination with
--i18n-export
是的,有时本地化并不完美。这是来自 v8 的另一个策略,它可能在 v9 中仍然对您有所帮助。
- 首先,按照描述更新您的模块
- 然后,从数据库中删除模块的所有已翻译字符串。这是安全的,因为您的 ru.po 文件中有它们。
- 转到“设置”>“翻译”>“应用程序条款”>“翻译的条款”
- 使用 'Module' 'contains' 执行 "Advanced Search" 以查找所有术语
- select 全部(可能将寻呼机设置为 'unlimited')
- Select 'More' > 'Delete'
- 确认
- 再次更新您的模块。
- 再次导出ru.po文件;它现在应该包含所有缺失的术语。
问题似乎是该模块有时会从默认 (en) 语言中获取一些值到目标语言中,然后禁止将术语列为 'to be translated'。
我在翻译方面也遇到过这个问题。我也更新了模块 base
很多次并且它有效,但有时没有必要。我做的是下一个流程:
转到设置 > 翻译 > 加载翻译,select 你的 语言并选中复选框 覆盖现有条款,然后单击 加载按钮。
之后,按F5刷新浏览器,然后进入设置> 翻译 > 应用术语 > 同步术语,select 你的 语言并单击 更新。然后再按F5看看你的 条款已更新。
此致。
有时,仅更新基础模块是不够的。我实现了一个基于 post 的解决方案。我所做的是使用查询清除整个语言,然后再次使用重新加载语言。 "Load a Translation" 来自配置菜单。
使之成为可能的查询如下,例如 es_CL:
从 ir_translation 中删除 lang = 'es_CL';
我已经把它放在一个模块中,您可以使用它来适应您的需要:
https://github.com/odoo-chile/l10n_cl_clear_translation
安装此模块后,它会运行查询。然后您可以使用菜单重新加载您的语言。