[ English | Indonesia | 日本語 | русский | 한국어 (대한민국) | Deutsch ]
This page collects small tips and tricks around translations.
If you have any, don’t hesitate to share it :)
Where a string is used in source code?¶
It is important to understand how an original string is used in the source code with contextual knowledge for better quality of translations. Unfortunately Zanata translation interface does not show where a target string is used in a source code correspondingly.
You can find the location in a source code by checking the POT file.
The POT file is found under
<Zanata-project-name>is Zanata project name,
<Zanata-project-version>is Zanata project version such as
<path>is a path of a document such as
<resource>is a document name in Zanata.
The easiest way would be to open
http://tarballs.openstack.org/translation-source and then
<Zanata-version> and corresponding links.
Open a POT file you find and search a string you are interested in. Then you can find an entry like:
#: 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
the corresponding git repository location is
For example, if you are translating
horizon, the git repository is found at
POT files are no longer stored in git repositories. The change was made at the beginning of Newton development cycle .
Where a string is used in Dashboard UI?¶
During translating a dashboard related project, you may want to know “where is this string used in the dashboard?”.
You can estimate where a string is used from a location in a source code. (See the previous entry on how to find a location.)
This means “Aggregates” menu in “Admin” group in the left side menu. In Horizon code, the second level corresponds to a dashboard group like “Project” or “Admin” and the third level corresponds to a panel like “Aggregates” (in this example), “Instances” or “Networks”.
When a filename is
forms.py, it means it is used in a form for creating or editing something.
A template is a skeleton of static HTML files. In this case, the string is perhaps used in “Update” form in “Container” menu.