Description

Translation of 'You are not allowed to edit this page.' sentence on edit action is cached incorrectly, leading to old translation after user has changed his language.

Steps to reproduce

  1. Configure ACL for readonly access (e.g. SecurityPolicy.write() returning False).

  2. Open NotYetExistingPage and click 'Create new empty page'.

  3. You will see 'You are not allowed to view this page.' and it is ok.

  4. Now on the other browser tab change your user language to another one (e.g. Russian).
  5. Refresh NotYetExistingPage?action=edit and you will see that:

    1. Almost all possible text is correctly translated to Russian (ok).
    2. But 'You are not allowed to view this page.' is still in English (error).

Example

InvalidTranslationCachingOfYouAreNotAllowedToEditThisPage.png

Component selection

Details

MoinMoin Version

1.9.2

OS and Version

Debian Lenny

Python Version

2.5

Server Setup

N/A

Server Details

N/A

Language you are using the wiki in (set in the browser/UserPreferences)

English, Russian

Workaround

Comment out 1 line (number 26) from MoinMoin/action/edit.py:

  24     if not request.user.may.write(pagename):
  25         page = wikiutil.getLocalizedPage(request, 'PermissionDeniedPage')
  26         # page.body = _('You are not allowed to edit this page.')
  27         # MUST preserve '''<<GetText(You are not allowed to view this page.)>>''' or translation would be cached as plain text in 'PermissionDeniedPage\cache\text_html' and _('...') won't help on user language change - old translation would be taken from cache.
  28         page.page_name = pagename

Discussion

Plan


CategoryMoinMoinBug

MoinMoin: MoinMoinBugs/InvalidTranslationCachingOfYouAreNotAllowedToEditThisPage (last edited 2010-07-21 14:52:22 by DenisRyzhkov)