Ticket #2335 (closed defect: fixed)

Opened 1 year ago

Last modified 1 year ago

[patch] tg.i18n.setup_i18n() doesn't set FormEncode translation when there's language in session

Reported by: TimurIzhbulatov Assigned to:
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

setup_i18n.diff (1.0 kB) - added by TimurIzhbulatov on 06/13/09 11:33:57.
Patch for tg/i18n.py

Change History

06/13/09 11:33:57 changed by TimurIzhbulatov

  • attachment setup_i18n.diff added.

Patch for tg/i18n.py

06/13/09 12:31:48 changed by TimurIzhbulatov

  • milestone changed from 2.1 to 2.1a1.

06/20/09 03:01:56 changed by TimurIzhbulatov

  • milestone changed from 2.1a1 to 2.* bugfix.

06/29/09 04:35:44 changed 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.

06/29/09 11:30:29 changed 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.

07/08/09 16:33:53 changed by chrisz

Added setup_i18n() to 2.1dev again in r876:b3e0; the basic formencode translation test is working again. I'll work on the original issue next.

07/09/09 12:49:23 changed by chrisz

  • status changed from new to closed.
  • resolution set to fixed.

Added unit test for the original problem and fix to the 2.1 branch (changesets 854570, 9699b, 7cb0f1). Backported to the 2.0 branch in r6599.