Mercurial > p > roundup > code
diff doc/developers.txt @ 5332:d0689aaa83db
Applied patch 0038 from issue2550960 to upgrade code examples in
documentation to be compatible with both python 2 and 3. Patch
supplied by Joseph Myers.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Tue, 12 Jun 2018 20:27:04 -0400 |
| parents | 132801e38324 |
| children | 979390afb001 |
line wrap: on
line diff
--- a/doc/developers.txt Thu Jun 07 12:39:31 2018 +0200 +++ b/doc/developers.txt Tue Jun 12 20:27:04 2018 -0400 @@ -213,12 +213,12 @@ Simple translations are automatically marked by calls to builtin message translation function ``_()``:: - print _("This message is translated") + print(_("This message is translated")) Translations for messages whose grammatical depends on a number must be done by ``ngettext()`` function:: - print ngettext("Nuked %i file", "Nuked %i files", number_of_files_nuked) + print(ngettext("Nuked %i file", "Nuked %i files", number_of_files_nuked)) Deferred Translations ~~~~~~~~~~~~~~~~~~~~~ @@ -228,7 +228,7 @@ Example:: for meal in ("spam", "egg", "beacon"): - print _(meal) + print(_(meal)) In such cases, strings must be marked for translation without actual call to the translating function. To mark these strings, we use Python
