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 #1643 (closed enhancement: fixed)

Opened 11 years ago

Last modified 11 years ago

[PATCH] Duplicate lang files since CalendarLangFileLink does not normalize charset

Reported by: chrisz Owned by: anonymous
Priority: normal Milestone: 1.5
Component: TurboGears Version: 1.0.4b3
Severity: normal Keywords: calendar charset lang utf8
Cc:

Description

I noticed that turbogears/widgets/static/calendar/lang contains duplicate copies of the same files with different spelling variants of the charset name, probably in order to cope with browsers that do not send a normalized charset name. TurboGears should provide a lang file name with a normalized charset name, so that only one lang file per charset needs to be provided.

I'm suggesting the attached patch for normalizing the charset name.

When the patch is applied, the following files in turbogears/widgets/static/calendar/lang can be removed:

calendar-cs-utf8.js
calendar-he-utf8.js
calendar-hr-utf8.js
calendar-ko-utf8.js
calendar-lt-utf8.js
calendar-pl-utf8.js
calendar-pt-utf8.js
calendar-zh-cn-utf8.js
calendar-zh-tw-utf8.js
calendar-zh-utf8.js

Also, the following two files should be renamed to use the normalized names:

calendar-cs-win.js  --> calendar-cs-cp1250.js
calendar-ru_win_.js --> calendar-ru-cp1251.js

Note that #1323 is another open issue with picking the calendar lang file.

Attachments

calendar_charset.patch Download (921 bytes) - added by chrisz 11 years ago.

Change History

Changed 11 years ago by chrisz

comment:1 Changed 11 years ago by chrisz

  • Status changed from new to closed
  • Resolution set to fixed

I should have known that this ticket opens a whole can of worms.

It turned out that most of the files in turbogears/widgets/static/calendar/lang were broken anyway. They had wrong names, wrong encodings, or were outdated (did not work with the calendar version shipped with TG), or all of these, plus there were some duplicates.

So I needed to do a lot of cleaning in that folder. There is now always a default file with ascii or utf-8 encoding. If other charsets are offered, these files have the normalized charset name as last part of the file base name.

Ticket #1323 has been solved in the same changeset, r4061.

Note: See TracTickets for help on using tickets.