Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion tutorials/i18n/localization_using_gettext.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Advantages
- gettext is a standard format, which can be edited using any text editor
or GUI editors such as `Poedit <https://poedit.net/>`_. This can be significant
as it provides a lot of tools for translators, such as marking outdated
strings, finding strings that haven't been translated etc.
strings, finding strings that haven't been translated, etc.
- gettext is supported by translation platforms such as
`Transifex <https://www.transifex.com/>`_ and `Weblate <https://weblate.org/>`_,
which makes it easier for people to collaborate to localization.
Expand Down Expand Up @@ -294,6 +294,20 @@ For example:
tr("Shop", "Main Menu")
tr("Shop", "In Game")

In a gettext PO file, a string with a context can be defined as follows:

::

# Example of a string with a translation context.
msgctxt "Main Menu"
msgid "Shop"
msgstr ""

# A different source string that is identical, but with a different context.
msgctxt "In Game"
msgid "Shop"
msgstr ""

Updating PO files
-----------------

Expand Down
Loading