diff options
| author | Chris McDonough <chrism@plope.com> | 2011-10-14 18:27:45 -0400 |
|---|---|---|
| committer | Chris McDonough <chrism@plope.com> | 2011-10-14 18:27:45 -0400 |
| commit | 5a20b131b921362785dda87409ca8eb3a1a9c6a1 (patch) | |
| tree | 59fa2ee99d61fdb1ecda5583ccdc88c4185ab97b | |
| parent | 9713a66fe175d5045340557f1a720e87419cad2e (diff) | |
| parent | c1265329e28bc513a2304fd451e727d9bc95f7ba (diff) | |
| download | pyramid-5a20b131b921362785dda87409ca8eb3a1a9c6a1.tar.gz pyramid-5a20b131b921362785dda87409ca8eb3a1a9c6a1.tar.bz2 pyramid-5a20b131b921362785dda87409ca8eb3a1a9c6a1.zip | |
Merge branch 'master' of github.com:Pylons/pyramid
| -rw-r--r-- | docs/narr/i18n.rst | 6 | ||||
| -rw-r--r-- | pyramid/url.py | 7 |
2 files changed, 6 insertions, 7 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 diff --git a/pyramid/url.py b/pyramid/url.py index 862d48b82..617529955 100644 --- a/pyramid/url.py +++ b/pyramid/url.py @@ -340,10 +340,9 @@ class URLMethodsMixin(object): The ``path`` argument points at a file or directory on disk which a URL should be generated for. The ``path`` may be either a - relative path (e.g. ``static/foo.css``) or a :term:`asset - specification` (e.g. ``mypackage:static/foo.css``). A ``path`` - may not be an absolute filesystem path (a :exc:`ValueError` will - be raised if this function is supplied with an absolute path). + relative path (e.g. ``static/foo.css``) or an absolute path (e.g. + ``/abspath/to/static/foo.css``) or a :term:`asset specification` + (e.g. ``mypackage:static/foo.css``). The purpose of the ``**kw`` argument is the same as the purpose of the :meth:`pyramid.request.Request.route_url` ``**kw`` argument. See |
