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
Configure ACL for readonly access (e.g. SecurityPolicy.write() returning False).
Open NotYetExistingPage and click 'Create new empty page'.
You will see 'You are not allowed to view this page.' and it is ok.
- Now on the other browser tab change your user language to another one (e.g. Russian).
Refresh NotYetExistingPage?action=edit and you will see that:
- Almost all possible text is correctly translated to Russian (ok).
But 'You are not allowed to view this page.' is still in English (error).
Example
Component selection
- action edit
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
- Priority:
- Assigned to:
- Status: