|
Revision 12, 1.1 kB
(checked in by matt_dorn@yahoo.com, 3 years ago)
|
Spanish i18n
|
| Line | |
|---|
| 1 |
from Products.CMFCore.utils import getToolByName |
|---|
| 2 |
from DateTime import DateTime |
|---|
| 3 |
from urllib import quote_plus |
|---|
| 4 |
|
|---|
| 5 |
def changeTransOwner(self): |
|---|
| 6 |
|
|---|
| 7 |
mtool = getToolByName(self, 'portal_membership') |
|---|
| 8 |
putils = getToolByName(self, 'plone_utils') |
|---|
| 9 |
translation_service = getToolByName(self, 'translation_service') |
|---|
| 10 |
|
|---|
| 11 |
member = mtool.getAuthenticatedMember().getId() |
|---|
| 12 |
|
|---|
| 13 |
if putils.getOwnerName(self) != member: |
|---|
| 14 |
putils.changeOwnershipOf(self, member) |
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
now=DateTime() |
|---|
| 18 |
|
|---|
| 19 |
self.getField('translationModTime').set(self, now) |
|---|
| 20 |
|
|---|
| 21 |
url=self.absolute_url() |
|---|
| 22 |
msg = translation_service.utranslate(domain='PloneXL8', |
|---|
| 23 |
msgid='You have taken ownership of this translation.', |
|---|
| 24 |
default='You have taken ownership of this translation.', |
|---|
| 25 |
context=self) |
|---|
| 26 |
|
|---|
| 27 |
msg = msg.encode('utf-8') |
|---|
| 28 |
msg = quote_plus(msg) |
|---|
| 29 |
|
|---|
| 30 |
self.REQUEST.RESPONSE.redirect(url + "?portal_status_message=" + msg) |
|---|