.. _ref-i18n:
.. module:: trytond.i18n

Internationalization
====================

.. function:: gettext(message_id, [language[, \**variables]])

   Return the message translated into the ``language``.

   The ``message_id`` is the ``XML`` id for the `Message <model-ir.message>`
   that is to be translated, and the ``variables`` keyword arguments are used
   as a mapping to format the string.
   If ``language`` is not set, then the :attr:`Transaction.language
   <trytond.transaction.Transaction.language>` is used.

.. function:: lazy_gettext(message_id, [language[, \**variables]])

   Return a LazyString that will be translated with :meth:`gettext` later when
   actually used.

.. function:: ngettext(message_id, n, [language[, \**variables]])

   Like :meth:`gettext` but for plural message which depend on ``n`` the number
   of count.

.. function:: lazy_ngettext(message_id, n, [language[, \**variables]])

   Return a LazyString that will be translated with :meth:`ngettext` later when
   actually used.
