Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .meta.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# See the inline comments on how to expand/tweak this configuration file
[meta]
template = "default"
commit-id = "2.2.1"
commit-id = "2.3.2"

[pyproject]
dependencies_ignores = "['Products.LinguaPlone.interfaces.ITranslatable', 'collective.akismet', 'collective.z3cform.norobots', 'plone.formwidget.captcha', 'plone.formwidget.recaptcha', 'plone.formwidget.hcaptcha', 'plone.contentrules', 'plone.app.contentrules', 'plone.restapi', 'plone.stringinterp', 'plone.app.collection']"
Expand Down
2 changes: 2 additions & 0 deletions news/+meta.internal
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Update configuration files.
[plone devs]
1 change: 1 addition & 0 deletions news/+translatecontext.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix translation of comment byline. @erral
15 changes: 10 additions & 5 deletions src/plone/app/discussion/comment.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
from zope.component import queryUtility
from zope.component.factory import Factory
from zope.event import notify
from zope.globalrequest import getRequest
from zope.i18n import translate
from zope.i18nmessageid import Message
from zope.interface import implementer
Expand Down Expand Up @@ -206,6 +207,7 @@ def Title(self):
default="Anonymous",
),
),
context=getRequest(),
)
else:
author_name = self.author_name
Expand All @@ -220,8 +222,10 @@ def Title(self):
"author_name": safe_text(author_name),
"content": safe_text(content.Title()),
},
)
),
context=getRequest(),
)

return title

def Creator(self):
Expand Down Expand Up @@ -381,7 +385,7 @@ def notify_user(obj, event):
if not emails:
return

subject = translate(_("A comment has been posted."), context=obj.REQUEST)
subject = translate(_("A comment has been posted."), context=getRequest())
message = translate(
Message(
MAIL_NOTIFICATION_MESSAGE,
Expand All @@ -391,7 +395,7 @@ def notify_user(obj, event):
"text": obj.text,
},
),
context=obj.REQUEST,
context=getRequest(),
)
for email in emails:
# Send email
Expand Down Expand Up @@ -449,7 +453,7 @@ def notify_moderator(obj, event):
content_object = aq_parent(conversation)

# Compose email
subject = translate(_("A comment has been posted."), context=obj.REQUEST)
subject = translate(_("A comment has been posted."), context=getRequest())
message = translate(
Message(
MAIL_NOTIFICATION_MESSAGE_MODERATOR,
Expand All @@ -465,10 +469,11 @@ def notify_moderator(obj, event):
default="Anonymous",
),
),
context=getRequest(),
),
},
),
context=obj.REQUEST,
context=getRequest(),
)

# Send email
Expand Down
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ description = check if the package defines all its dependencies
skip_install = true
deps =
build
setuptools<82.0.0
z3c.dependencychecker==2.14.3
commands =
python -m build --sdist
Expand Down