Merge lp:~futatuki/mailman/enhance-i18n-list-overview into lp:mailman/2.1
Status: | Merged |
---|---|
Merged at revision: | 1782 |
Proposed branch: | lp:~futatuki/mailman/enhance-i18n-list-overview |
Merge into: | lp:mailman/2.1 |
Diff against target: |
79 lines (+29/-3) 4 files modified
Mailman/Cgi/admin.py (+1/-1) Mailman/Cgi/listinfo.py (+1/-1) Mailman/HTMLFormatter.py (+6/-1) Mailman/MailList.py (+21/-0) |
To merge this branch: | bzr merge lp:~futatuki/mailman/enhance-i18n-list-overview |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Mark Sapiro | code | Needs Information | |
Review via email:
|
Commit message
enhance i18n of listinfo/admin overview page
Description of the change
On listinfo/admin overview page, lists' description may be stored in different charset/encoding from what the page uses. However current implementation of listinfo/admin overview page uses those regardlessly of the difference, so those cannot be displayed correctly.
To avoid this, (1) I've implemented a new function to get description as string of specified charset (with XML character reference) in MailList class, MailList.
This function uses a precondition that .description attribute is stored in charset of list's preferred_language. This is fundamentally true, but in case list's preferred_language has been changed and of the description hasn't, it is not true(Suppose changing preferred_language temporary to edit template files via Web UI, for example). To help to ensure the precondition, (2) I've added hook to change charset of list's description when preferred_language is changed via Web UI. (This is not always preserve identity of description string when preferred_languages is changed one of other charset/encoding and then changed back, because of multiple mapping of character between charset, and intentional use of XML character reference)
In your change to Mailman/ Cgi/admin. py, mlist.GetDescri ption() should be Utils.websafe( mlist.GetDescri ption() ). I know it isn't currently websafed, but it should be.
I understand the need for the changes to admin.py and listinfo.py because the overview page is in the charset of the site's preferred language and the description may not be.
There is also another issue in the listinfo for a specific list. Here the <mm-list- description> replacement puts the description at the top of the page and the page can be viewed in a language other than the list default, so I think Mailman/ HTMLFormatter. py needs to also be changed to use GetDescription() for the <mm-list- description> replacement.
Finally though, I don't understand the need for the change to Mailman/ Gui/GUIBase. py since there we are dealing with changes via the admin CGI for a list and the admin UI should be in the list's preferred language charset always. Am I missing something here?