From 5fcac81302ad323a86ab43243c242c4a10cd338a Mon Sep 17 00:00:00 2001
From: ThibG <thib@sitedethib.com>
Date: Fri, 22 Jan 2021 10:09:23 +0100
Subject: [PATCH] =?UTF-8?q?Add=20=E2=80=9Ctranslate=E2=80=9D=20class=20to?=
 =?UTF-8?q?=20other=20user=20strings=20(#15611)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* Add “translate” class to other user strings

Follow-up to #15610.

Allow Google Translate to work on more user content:
- poll options
- reply indicator (contents of the status being replied to)
- directory account cards
- account note in follow requests list

* Fix incorrect styling of account bio

Co-authored-by: Claire <claire.github-309c@sitedethib.com>
---
 app/javascript/mastodon/components/poll.js                      | 2 +-
 app/javascript/mastodon/features/account/components/header.js   | 2 +-
 .../mastodon/features/compose/components/reply_indicator.js     | 2 +-
 .../mastodon/features/directory/components/account_card.js      | 2 +-
 .../features/follow_requests/components/account_authorize.js    | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/app/javascript/mastodon/components/poll.js b/app/javascript/mastodon/components/poll.js
index 41c99710fc..477f56e130 100644
--- a/app/javascript/mastodon/components/poll.js
+++ b/app/javascript/mastodon/components/poll.js
@@ -153,7 +153,7 @@ class Poll extends ImmutablePureComponent {
           </span>}
 
           <span
-            className='poll__option__text'
+            className='poll__option__text translate'
             dangerouslySetInnerHTML={{ __html: titleEmojified }}
           />
 
diff --git a/app/javascript/mastodon/features/account/components/header.js b/app/javascript/mastodon/features/account/components/header.js
index 0b4431d625..4647b98b21 100644
--- a/app/javascript/mastodon/features/account/components/header.js
+++ b/app/javascript/mastodon/features/account/components/header.js
@@ -340,7 +340,7 @@ class Header extends ImmutablePureComponent {
 
               {account.get('id') !== me && !suspended && <AccountNoteContainer account={account} />}
 
-              {account.get('note').length > 0 && account.get('note') !== '<p></p>' && <div className='account__header__content' dangerouslySetInnerHTML={content} className='translate' />}
+              {account.get('note').length > 0 && account.get('note') !== '<p></p>' && <div className='account__header__content translate' dangerouslySetInnerHTML={content} />}
             </div>
 
             {!suspended && (
diff --git a/app/javascript/mastodon/features/compose/components/reply_indicator.js b/app/javascript/mastodon/features/compose/components/reply_indicator.js
index 8563838932..a1d5c420cb 100644
--- a/app/javascript/mastodon/features/compose/components/reply_indicator.js
+++ b/app/javascript/mastodon/features/compose/components/reply_indicator.js
@@ -56,7 +56,7 @@ class ReplyIndicator extends ImmutablePureComponent {
           </a>
         </div>
 
-        <div className='reply-indicator__content' dangerouslySetInnerHTML={content} />
+        <div className='reply-indicator__content translate' dangerouslySetInnerHTML={content} />
 
         {status.get('media_attachments').size > 0 && (
           <AttachmentList
diff --git a/app/javascript/mastodon/features/directory/components/account_card.js b/app/javascript/mastodon/features/directory/components/account_card.js
index 419ab9e114..e377338280 100644
--- a/app/javascript/mastodon/features/directory/components/account_card.js
+++ b/app/javascript/mastodon/features/directory/components/account_card.js
@@ -241,7 +241,7 @@ class AccountCard extends ImmutablePureComponent {
 
         <div className='directory__card__extra' ref={this.setRef}>
           <div
-            className='account__header__content'
+            className='account__header__content translate'
             dangerouslySetInnerHTML={{ __html: account.get('note_emojified') }}
           />
         </div>
diff --git a/app/javascript/mastodon/features/follow_requests/components/account_authorize.js b/app/javascript/mastodon/features/follow_requests/components/account_authorize.js
index a3b524db1d..8269f5ae43 100644
--- a/app/javascript/mastodon/features/follow_requests/components/account_authorize.js
+++ b/app/javascript/mastodon/features/follow_requests/components/account_authorize.js
@@ -35,7 +35,7 @@ class AccountAuthorize extends ImmutablePureComponent {
             <DisplayName account={account} />
           </Permalink>
 
-          <div className='account__header__content' dangerouslySetInnerHTML={content} />
+          <div className='account__header__content translate' dangerouslySetInnerHTML={content} />
         </div>
 
         <div className='account--panel'>