Skip to content

Comment improvements - #2460

Merged
tf merged 4 commits into
codevise:masterfrom
tf:comment-improvements
Aug 6, 2026
Merged

Comment improvements#2460
tf merged 4 commits into
codevise:masterfrom
tf:comment-improvements

Conversation

@tf

@tf tf commented Aug 6, 2026

Copy link
Copy Markdown
Member

REDMINE-21261

tf added 4 commits August 6, 2026 12:11
So far the frontend I18n.locale has been set to the entry locale both
for published entries and previews. Since only the entry itself was
rendered, there was no user interface that would have needed the locale
of the signed in user.

With commenting, preview mode renders review interface on top of the
entry. Pass the locale of the signed in user via the request env and use
it for the locale and the review/inline_editing translations of the
seed. Frontend code obtains the entry locale from the entry metadata,
which the seed continues to render based on the entry.

Keep setting I18n.locale to the entry locale while rendering, though:
Templates and widgets rely on it to render the entry itself, e.g. for
the dc.language meta tag, the privacy notice label and file licenses.

Published entries keep rendering the entry locale in the seed since
their markup is cached without taking the requesting user into account.
useI18n has been able to translate in the locale of the user interface
rather than the entry locale via the `locale: 'ui'` option. Components
that format data instead of translating it had to read I18n.locale
directly to achieve the same.

Move the option to useLocale and let useI18n pass its options on. This
way useI18n no longer needs to know how to obtain either locale.
Timestamps have been formatted according to English conventions no
matter which locale the review interface was displayed in. Include the
year for comments from previous years to keep them distinguishable from
recent ones.
The review interface is bundled separately, so relative imports from
src/frontend inlined a second copy of those modules into review.js.
Since LocaleProvider is mounted from the frontend bundle, useLocale
called through the inlined copy would have read its own LocaleContext
and returned the default locale instead of the entry locale.

Extend the eslint rule that already guards content elements, widgets
and the editor to cover the review interface, and let it catch bare
'../entryState' imports as well. Keep the spinner icon in the images
directory of the review interface like its other icons.
@tf tf added this to the v17.2 milestone Aug 6, 2026
@tf
tf merged commit 9f154a0 into codevise:master Aug 6, 2026
18 checks passed
@tf
tf deleted the comment-improvements branch August 6, 2026 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant