[IMP] doc: move translations to reference documentation
This commit is contained in:
parent
4854d5562f
commit
4d6fb49b8f
|
@ -18,5 +18,6 @@ Reference
|
||||||
reference/qweb
|
reference/qweb
|
||||||
reference/javascript
|
reference/javascript
|
||||||
|
|
||||||
|
reference/translations
|
||||||
reference/reports
|
reference/reports
|
||||||
reference/workflows
|
reference/workflows
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
.. _guides/translations:
|
.. _reference/translations:
|
||||||
|
|
||||||
===================
|
===================
|
||||||
Translating Modules
|
Translating Modules
|
||||||
|
@ -26,16 +26,15 @@ the backend interface and opening :menuselection:`Settings --> Translations
|
||||||
:align: center
|
:align: center
|
||||||
:width: 75%
|
:width: 75%
|
||||||
|
|
||||||
This gives you a file called :file:`{yourmodule}.po` which should be renamed
|
This gives you a file called :file:`{yourmodule}.pot` which should be moved to
|
||||||
to :file:`{yourmodule}.pot` and moved to the :file:`{yourmodule}/i18n/`
|
the :file:`{yourmodule}/i18n/` directory. The file is a *PO Template* which
|
||||||
directory. The file is a *PO Template* which simply lists translatable strings
|
simply lists translatable strings and from which actual translations (PO files)
|
||||||
and from which actual translations (PO files) can be created. PO files can
|
can be created. PO files can be created using msginit_, with a dedicated
|
||||||
be created using msginit_, with a dedicated translation tool like POEdit_ or
|
translation tool like POEdit_ or by simply copying the template to a new file
|
||||||
by simply copying the template to a new file called :file:`{language}.po`.
|
called :file:`{language}.po`. Translation files should be put in
|
||||||
Translation files should be put in :file:`{yourmodule}/i18n/`, next to
|
:file:`{yourmodule}/i18n/`, next to :file:`{yourmodule}.pot`, and will be
|
||||||
:file:`{yourmodule}.pot`, and will be automatically loaded by Odoo when the
|
automatically loaded by Odoo when the corresponding language is installed (via
|
||||||
corresponding language is installed (via :menuselection:`Settings -->
|
:menuselection:`Settings --> Translations --> Load a Translation`)
|
||||||
Translations --> Load a Translation`)
|
|
||||||
|
|
||||||
.. note:: translations for all loaded languages are also installed or updated
|
.. note:: translations for all loaded languages are also installed or updated
|
||||||
when installing or updating a module
|
when installing or updating a module
|
||||||
|
@ -70,7 +69,7 @@ code, Odoo is not able to automatically export translatable terms and they
|
||||||
must be marked explicitly for export. This is done by wrapping a literal
|
must be marked explicitly for export. This is done by wrapping a literal
|
||||||
string in a function call.
|
string in a function call.
|
||||||
|
|
||||||
In Python, the wrapping function is :func:`openerp.tools.translate._`::
|
In Python, the wrapping function is :func:`openerp._`::
|
||||||
|
|
||||||
title = _("Bank Accounts")
|
title = _("Bank Accounts")
|
||||||
|
|
||||||
|
@ -82,9 +81,9 @@ In JavaScript, the wrapping function is generally :js:func:`openerp.web._t`:
|
||||||
|
|
||||||
.. warning::
|
.. warning::
|
||||||
|
|
||||||
only literal strings can be marked for exports, not expressions and not
|
Only literal strings can be marked for exports, not expressions and not
|
||||||
variables. For situations where strings are formatted, this means the
|
variables. For situations where strings are formatted, this means the
|
||||||
format string must be marked not the formatted string::
|
format string must be marked, not the formatted string::
|
||||||
|
|
||||||
# bad, the extract may work but it will not correctly translate the text
|
# bad, the extract may work but it will not correctly translate the text
|
||||||
_("Scheduled meeting with %s" % invitee.name)
|
_("Scheduled meeting with %s" % invitee.name)
|
Before Width: | Height: | Size: 5.9 KiB After Width: | Height: | Size: 5.9 KiB |
Loading…
Reference in New Issue