Mercurial > genshi > genshi-test
comparison doc/i18n.txt @ 884:5a1c0ee0f659
Improve the template loader docs.
author | cmlenz |
---|---|
date | Fri, 16 Apr 2010 20:40:28 +0000 |
parents | 0fb43dc2e165 |
children | 80f80f2eec6a |
comparison
equal
deleted
inserted
replaced
883:0849dcc8ed46 | 884:5a1c0ee0f659 |
---|---|
203 | 203 |
204 def template_loaded(template): | 204 def template_loaded(template): |
205 template.filters.insert(0, Translator(translations.ugettext)) | 205 template.filters.insert(0, Translator(translations.ugettext)) |
206 | 206 |
207 loader = TemplateLoader('templates', callback=template_loaded) | 207 loader = TemplateLoader('templates', callback=template_loaded) |
208 template = loader.load("...") | 208 template = loader.load('test.html') |
209 | 209 |
210 This approach ensures that the filter is not added everytime the template is | 210 This approach ensures that the filter is not added everytime the template is |
211 loaded, and thus being applied multiple times. | 211 loaded, and thus being applied multiple times. |
212 | 212 |
213 | 213 |