Ticket #7018 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

[patch] breaks wiki page, if calender items have non-ascii chars in i18n enabled environment

Reported by: hasienda Assigned to: anonymous
Priority: normal Component: WikiTicketCalendarMacro
Severity: critical Keywords: i18n Genshi unicode hasienda
Cc: Trac Release: 0.11

Description

wiki page not shown, if some locale settings cause special characters (i.e. German "Umlaute") to be sent to Genshi for display,

i.e. German month name for March is causing no page display at all on Feb (contains '>' navigation link to March with tooltip "März", Apr (contains '<' nav link to Mar too and of course the month March itself with its name being prominent on to of Calender, rendering it almost useless for my use cases that strictly require German Web_UI

Attachments

20090824_trac_wikiticketcalendermakro_err.pdf (9.6 kB) - added by hasienda on 04/21/10 22:39:03.
Screenshot with Genshi error, while hit by not properly encoded non-ascii chars
WikiTicketCalendarMacro_i18n_unicode-fix.patch (3.7 kB) - added by hasienda on 04/21/10 22:40:42.
unicode encode fix for I18n support for calender items

Change History

04/21/10 22:39:03 changed by hasienda

  • attachment 20090824_trac_wikiticketcalendermakro_err.pdf added.

Screenshot with Genshi error, while hit by not properly encoded non-ascii chars

04/21/10 22:40:42 changed by hasienda

  • attachment WikiTicketCalendarMacro_i18n_unicode-fix.patch added.

unicode encode fix for I18n support for calender items

04/21/10 22:47:50 changed by hasienda

tested with

Trac trunk 0.12dev t:r8263 and t:r9115
Genshi 0.6dev-r1092 (i18n branch)

04/27/10 03:02:07 changed by rjollos

I'm going to go ahead and apply the patch to the trunk, but I won't have time to test. I'd appreciate if you can report back if you are able to test the latest version of the trunk. Thanks for the patch.

04/27/10 03:36:17 changed by rjollos

  • status changed from new to assigned.
  • owner changed from rjollos to anonymous.

I committed the file you sent by email. I'm not sure if that includes a fix for the issue described here. If not, could you please send create a patch against the current 0.12 branch that includes these changes?

Sorry, I haven't had much time lately to work on this plugin or review patches.

04/28/10 11:58:18 changed by hasienda

  • status changed from assigned to closed.
  • keywords changed from i18n Genshi unicode to i18n Genshi unicode hasienda.
  • resolution set to fixed.

As I found out, that the modified version here will work only with Trac < 0.12devr9210.

The version you committed into r7893 has more than the changes in the patch file attached to this ticket. It includes

  • i18n support (introduced with trac-0.12dev) by adding unicode function to cope well with non-ascii chars (closing this ticket),
  • cleanup the code a litte,
  • support for pre-configuration of template to be used with new wiki pages called from calendar,
  • code to produce 2 additional nav items on top of the calendar to support for going back/forward 3 months at once

I'll announce especially last two as new features at wiki page, if you don't mind.

  • Template support is just a must-have.
  • The navs are an useful addition to existing month and year nav - just 2 clicks instead of 6 for skipping half a year. Someone might want to make that an option, well that could be done too.

Beware: You'll need another version for recent versions of trac-0.12dev, so for upcoming Trac 0.12 as well. But this is already done. Look at #7039, please.

05/27/10 12:50:06 changed by hasienda

appears to be a follow-up to #2548

BTW, speaking about i18n/l10n support before was misleading. The fixes where for proper unicode character handling, what is relevant in internationalized environments. Actual i18n work was WiP that leaked into with current revision. But that is lame, doing actually nothing but bloat the code. I'll rework this now to match current best practice for Trac plugin i18n/l10n.

But beware: This will require a transition from the one-file-macro to a full-fledged plugin, since we'll use one message catalog per language, and all this will need to be packaged (as a Python egg). Goodbye macro-style, hello WikiTicketCalendarMacro plugin-style.


Add/Change #7018 ([patch] breaks wiki page, if calender items have non-ascii chars in i18n enabled environment)




Change Properties
Action