Closed wizpig64 closed 3 years ago
Pausing this PR until I can figure out adding auto trimming support to the makemessages command.
@paris-ci says this fixed their issue. if nobody else comments here with knowledge of a regression, i'll probably merge this next week and release it as 2.9.0.
pinging known users from previous makemessages issues: @canassa @pacahon @hugokernel
Fixes #284.
In their 2.9, Jinja2 added a
policies
dict on the base Environment, which controls rendering behaviours.This change adds the ability to set those policies via django settings, and adds a section about it in the docs.
I tested this out by adding the
ext.i18n.trimmed
setting to the testapp's template options dict, and indeed the i18n view started rendering with everything trimmed.Update: I've now figured out how to get this trimming policy to work with our custom
makemessages
command, by insertingtrimmed
in all the right places, assumingext.i18n.trimmed
is enabled.To test this feature out in your project, you can install this branch thusly: