Ticket #2335 (closed defect: fixed)
[patch] tg.i18n.setup_i18n() doesn't set FormEncode translation when there's language in session
| Reported by: | TimurIzhbulatov | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | 2.0.* bugfix |
| Component: | TurboGears | Version: | trunk |
| Severity: | normal | Keywords: | i18n FormEncode |
| Cc: |
Description
Please see the discussion for more details on the issue.
The attached patch uses set_temporary_lang() instead of just pylons.i18n.set_lang(). Perhaps, that was the original intent, as set_temporary_lang() calls set_lang() internally. Also, the patch makes the code a bit simpler, because exception handling and logging is already done inside set_temporary_lang().
In my development virtual environment this patch doesn't break any tests.
Attachments
Change History
Changed 3 years ago by TimurIzhbulatov
-
attachment
setup_i18n.diff
added
comment:3 Changed 3 years ago by chrisz
Just noticed that in the trunk setup_i18n isn't called any more, so i18n doesn't work with the current 2.1dev anyway.
comment:4 Changed 3 years ago by chrisz
I have now added a unit test for formencode translation (test_form_validation_translation in tests.test_validation) (which is broken in the trunk, as mentioned above).
@Timur: Can you provide another test for the specific problem in this ticket, based on my general test? We really need regression tests for every bugfix.
Patch for tg/i18n.py