diff --git a/tutorials/i18n/localization_using_gettext.rst b/tutorials/i18n/localization_using_gettext.rst index 181abc4d598..9210635c268 100644 --- a/tutorials/i18n/localization_using_gettext.rst +++ b/tutorials/i18n/localization_using_gettext.rst @@ -21,7 +21,7 @@ Advantages - gettext is a standard format, which can be edited using any text editor or GUI editors such as `Poedit `_. 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 `_ and `Weblate `_, which makes it easier for people to collaborate to localization. @@ -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 -----------------