[ English | 한국어 (대한민국) | Indonesia | русский | 中文 (简体, 中国) | Deutsch | English (United Kingdom) | 日本語 ]

翻译提示

此页面收集有关翻译的小提示和技巧。

如果有,请不要犹豫,分享 :)

源代码中使用字符串的位置?

为了获得更好的翻译质量,重要的是要理解原始字符串是如何在源代码中结合上下文知识被使用的。 不幸的是,Zanata转换接口没有显示相应地在源代码中使用目标字符串的位置。

您可以通过检查POT文件在源代码中找到该位置。

POT 文件位于 http://tarballs.openstack.org/translation-source/<Zanata-project-name>/<Zanata-project-version>/<path>/<resource>.pot, 其中:

  • <Zanata-project-name> 是 Zanata 项目名称,

  • <Zanata-project-version> 是 Zanata 项目版本, 例如 masterstable-mitaka,

  • <path>``是一个文件的路径,如``nova/localeopenstack_dashboard/locale``或者``releasenotes/source/locale

  • <resource> 是 Zanata 里的文档名称.

最简单的方法是打开http://tarballs.openstack.org/translation-source,然后参照``<Zanata-project-name>``,``<Zanata-version>``以及相应的链接。

打开您找到的POT文件并搜索您感兴趣的字符串。然后您可以找到如下条目:

#: trove_dashboard/content/database_backups/views.py:100
#, python-format
msgid "Unable to retrieve details for parent backup: %s"
msgstr ""

Once you find location(s) of a string you would like to check, you can check more detail context where the string is used by looking at the code in the git repository. Zanata project and git repository are one-to-one relationship. If Zanata project name is <Zanata-project-name>, the corresponding git repository location is https://opendev.org/openstack/<Zanata-project-name>/. For example, if you are translating horizon, the git repository is found at https://opendev.org/openstack/horizon/.

备注

POT文件不再存储在git存储库中。 这一变化是在Newton开发周期的开始制定的[#]_。

Dashboard UI中使用的字符串在哪?

在翻译与Dashboard有关的项目期间,您可能想知道“Dashboard中使用的字符串在哪?”。

您可以估计源代码中使用字符串的位置。 (请参阅上一条有关如何查找位置的条目。)

dashboards/admin/aggregates/views.py:104

这表示左侧菜单里“Admin”组中的“Aggregates”菜单。 在Horizon代码中,第二级对应着诸如“Project”或“Admin”等仪表板组,第三级对应着诸如“Aggregates”(在此示例中),“Instances”或“Networks”等面板。

dashboards/project/loadbalancers/workflows.py:44

当文件名是``workflows.py``或``forms.py``时,这表示它在表单中用于创建或编辑某些内容。

dashboards/project/containers/templates/containers/_update.html:21

模板是静态HTML文件的框架。 在这种情况下,字符串可能在“容器”菜单中的“更新”表单中使用。