-
Notifications
You must be signed in to change notification settings - Fork 203
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
doc: add documentation for new trans with variable substitution
- Loading branch information
Showing
6 changed files
with
38 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
.. include:: meta-mod_import_csv-dispatch.rst | ||
|
||
.. Not yet documented. (no todo item, as this is not a major issue) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
|
||
.. index:: tag; translate | ||
.. _tag-trans_ext: | ||
|
||
translate with variable substitution | ||
==================================== | ||
|
||
Translate a text value using gettext and substitute variables. | ||
|
||
Example:: | ||
|
||
{% trans "Hello {foo} World" foo=1234 %} | ||
|
||
This translates the text using the available po files. The variables in the translated text will | ||
be substituted with the value of the arguments. | ||
|
||
If the active language is “en” then the example above will output “Hello 1234 World”, in “nl” it will be “Hallo 1234 wereld”. Of course depending on the available translations. | ||
|
||
If a translation is not available then the text is output as-is without any translation. | ||
|
||
If a “{” is needed in the string, then repeat it: | ||
|
||
{% trans "Hello {{foo}}, and this is {foo}." foo=1234 %} | ||
|
||
Will echo “Hello {foo}, and this is 1234.” | ||
|
||
.. seealso:: :ref:`tag-trans`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters