diff options
| author | Michael Merickel <michael@merickel.org> | 2011-10-14 14:39:15 -0500 |
|---|---|---|
| committer | Michael Merickel <michael@merickel.org> | 2011-10-14 14:39:15 -0500 |
| commit | c1265329e28bc513a2304fd451e727d9bc95f7ba (patch) | |
| tree | 3c25fccfe557b05cd706784464aab4445a9c19e7 | |
| parent | 1f61fc717d00523f7f79df7e84f4b39a95cb57cd (diff) | |
| download | pyramid-c1265329e28bc513a2304fd451e727d9bc95f7ba.tar.gz pyramid-c1265329e28bc513a2304fd451e727d9bc95f7ba.tar.bz2 pyramid-c1265329e28bc513a2304fd451e727d9bc95f7ba.zip | |
fixed translationstring docs, default is not the first argument
| -rw-r--r-- | docs/narr/i18n.rst | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/docs/narr/i18n.rst b/docs/narr/i18n.rst index c2ecba9bb..631654d32 100644 --- a/docs/narr/i18n.rst +++ b/docs/narr/i18n.rst @@ -149,7 +149,7 @@ generated by using it. For example: from pyramid.i18n import TranslationStringFactory _ = TranslationStringFactory('pyramid') - ts = _('Add ${number}', msgid='add-number', mapping={'number':1}) + ts = _('add-number', default='Add ${number}', mapping={'number':1}) .. note:: We assigned the translation string factory to the name ``_``. This is a convention which will be supported by translation @@ -170,7 +170,7 @@ to: :linenos: from pyramid.i18n import TranslationString as _ - ts = _('Add ${number}', msgid='add-number', mapping={'number':1}, + ts = _('add-number', default='Add ${number}', mapping={'number':1}, domain='pyramid') You can set up your own translation string factory much like the one @@ -185,7 +185,7 @@ do something like this: from pyramid.i18n import TranslationStringFactory _ = TranslationStringFactory('form') - ts = _('Add ${number}', msgid='add-number', mapping={'number':1}) + ts = _('add-number', default='Add ${number}', mapping={'number':1}) Creating a unique domain for your application via a translation string factory is best practice. Using your own unique translation domain |
