From dc7e2985e60c90e8efe82e56edb4fdd473bd1651 Mon Sep 17 00:00:00 2001 From: Jeong Arm Date: Sat, 28 May 2022 22:50:36 +0900 Subject: [PATCH] Add lang html attr to each posts (#18544) --- app/javascript/mastodon/components/status_content.js | 9 +++++---- app/views/statuses/_detailed_status.html.haml | 2 +- app/views/statuses/_simple_status.html.haml | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/app/javascript/mastodon/components/status_content.js b/app/javascript/mastodon/components/status_content.js index d01365afbf..724165ada0 100644 --- a/app/javascript/mastodon/components/status_content.js +++ b/app/javascript/mastodon/components/status_content.js @@ -176,6 +176,7 @@ export default class StatusContent extends React.PureComponent { const content = { __html: status.get('contentHtml') }; const spoilerContent = { __html: status.get('spoilerHtml') }; + const lang = status.get('language'); const classNames = classnames('status__content', { 'status__content--with-action': this.props.onClick && this.context.router, 'status__content--with-spoiler': status.get('spoiler_text').length > 0, @@ -212,14 +213,14 @@ export default class StatusContent extends React.PureComponent { return (
{mentionsPlaceholder} -
+
{!hidden && !!status.get('poll') && } @@ -229,7 +230,7 @@ export default class StatusContent extends React.PureComponent { } else if (this.props.onClick) { const output = [
-
+
{!!status.get('poll') && } @@ -245,7 +246,7 @@ export default class StatusContent extends React.PureComponent { } else { return (
-
+
{!!status.get('poll') && } diff --git a/app/views/statuses/_detailed_status.html.haml b/app/views/statuses/_detailed_status.html.haml index 1d0e5a38c6..c67f0e4d9b 100644 --- a/app/views/statuses/_detailed_status.html.haml +++ b/app/views/statuses/_detailed_status.html.haml @@ -20,7 +20,7 @@ %p< %span.p-summary> #{prerender_custom_emojis(h(status.spoiler_text), status.emojis)}  %button.status__content__spoiler-link= t('statuses.show_more') - .e-content + .e-content{ :lang => status.language } = prerender_custom_emojis(status_content_format(status), status.emojis) - if status.preloadable_poll diff --git a/app/views/statuses/_simple_status.html.haml b/app/views/statuses/_simple_status.html.haml index 552b42078c..f16d2c186b 100644 --- a/app/views/statuses/_simple_status.html.haml +++ b/app/views/statuses/_simple_status.html.haml @@ -32,7 +32,7 @@ %p< %span.p-summary> #{prerender_custom_emojis(h(status.spoiler_text), status.emojis)}  %button.status__content__spoiler-link= t('statuses.show_more') - .e-content + .e-content{ :lang => status.language } = prerender_custom_emojis(status_content_format(status), status.emojis) - if status.preloadable_poll