Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #2335 (closed defect: fixed)

Opened 10 years ago

Last modified 10 years ago

[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

setup_i18n.diff Download (1.0 KB) - added by TimurIzhbulatov 10 years ago.
Patch for tg/i18n.py

Change History

Changed 10 years ago by TimurIzhbulatov

Patch for tg/i18n.py

comment:1 Changed 10 years ago by TimurIzhbulatov

  • Milestone changed from 2.1 to 2.1a1

comment:2 Changed 10 years ago by TimurIzhbulatov

  • Milestone changed from 2.1a1 to 2.* bugfix

comment:3 Changed 10 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 10 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.

comment:5 Changed 10 years ago 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.

comment:6 Changed 10 years ago 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.

Note: See TracTickets for help on using tickets.