Support translation contexts

This commit is contained in:
James Westman 2021-11-24 21:12:26 -06:00
parent b0a8f3e2f5
commit 0e33ce190d
No known key found for this signature in database
GPG key ID: CE2DBA0ADB654EA6
6 changed files with 55 additions and 31 deletions

View file

@ -91,7 +91,7 @@ Translations
~~~~~~~~~~~~
Use ``_("...")`` to mark strings as translatable. You can put a comment for
translators on the line above.
translators on the line above if needed.
.. code-block::
@ -100,6 +100,18 @@ translators on the line above.
label: _("Hello, world!");
}
Use ``C_("context", "...")`` to add a *message context* to a string to
disambiguate it, in case the same string appears in different places. Remember,
two strings might be the same in one language but different in another depending
on context.
.. code-block::
Gtk.Label label {
/* Translators: This is a section in the preferences window */
label: C_("preferences window", "Hello, world!");
}
Referencing objects by ID
~~~~~~~~~~~~~~~~~~~~~~~~~