diff options
| author | Michael Merickel <michael@merickel.org> | 2017-01-17 01:07:58 -0600 |
|---|---|---|
| committer | Michael Merickel <michael@merickel.org> | 2017-01-17 01:07:58 -0600 |
| commit | c1374524655ac9da42c6f45281f5e11b086f5973 (patch) | |
| tree | b5ea609ff2c38e849e935c02f71d9ceb1fe67e37 | |
| parent | b24aeb73e7849dc360aefb634376ef0595abd0ca (diff) | |
| download | pyramid-c1374524655ac9da42c6f45281f5e11b086f5973.tar.gz pyramid-c1374524655ac9da42c6f45281f5e11b086f5973.tar.bz2 pyramid-c1374524655ac9da42c6f45281f5e11b086f5973.zip | |
fix the add_translation_dirs documentation to reflect the current impl
fixes #1473
| -rw-r--r-- | pyramid/config/i18n.py | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/pyramid/config/i18n.py b/pyramid/config/i18n.py index 9538d766b..96fd30a51 100644 --- a/pyramid/config/i18n.py +++ b/pyramid/config/i18n.py @@ -57,15 +57,19 @@ class I18NConfiguratorMixin(object): config.add_translation_dirs('/usr/share/locale', 'some.package:locale') - Later calls to ``add_translation_dir`` insert directories into the - beginning of the list of translation directories created by earlier - calls. This means that the same translation found in a directory - added later in the configuration process will be found before one - added earlier in the configuration process. However, if multiple - specs are provided in a single call to ``add_translation_dirs``, the - directories will be inserted into the beginning of the directory list - in the order they're provided in the ``*specs`` list argument (items - earlier in the list trump ones later in the list). + The translation directories are defined as a list in which + translations defined later have precedence over translations defined + earlier. + + If multiple specs are provided in a single call to + ``add_translation_dirs``, the directories will be inserted in the + order they're provided (earlier items are trumped by later items). + + .. warning:: + + Consecutive calls to ``add_translation_dirs`` will sort the + directories such that the later calls will add folders with + lower precedence than earlier calls. """ introspectables = [] @@ -76,7 +80,7 @@ class I18NConfiguratorMixin(object): # defer spec resolution until register to allow for asset # overrides to take place in an earlier config phase - for spec in specs[::-1]: # reversed + for spec in specs[::-1]: # reversed # the trailing slash helps match asset overrides for folders if not spec.endswith('/'): spec += '/' |
