From 36a7a96e0e91437344ae30e51ca3c08966aabe1e Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 7 Sep 2023 10:37:09 +0100 Subject: [PATCH] Migrate more strings to translation keys (#11574) --- .../dialogs/AnalyticsLearnMoreDialog.tsx | 27 +- .../dialogs/SessionRestoreErrorDialog.tsx | 2 +- src/components/views/dialogs/TermsDialog.tsx | 4 +- .../views/elements/ErrorBoundary.tsx | 2 +- .../views/elements/EventListSummary.tsx | 70 ++-- .../views/emojipicker/EmojiPicker.tsx | 18 +- src/components/views/emojipicker/Header.tsx | 2 +- .../views/emojipicker/QuickReactions.tsx | 4 +- .../views/right_panel/EncryptionInfo.tsx | 2 +- .../views/right_panel/VerificationPanel.tsx | 19 +- .../views/settings/IntegrationManager.tsx | 2 +- .../views/settings/LayoutSwitcher.tsx | 4 +- src/components/views/settings/SetIdServer.tsx | 2 +- .../verification/VerificationCancelled.tsx | 2 +- .../verification/VerificationComplete.tsx | 4 +- .../verification/VerificationShowSas.tsx | 10 +- src/i18n/strings/ar.json | 54 +-- src/i18n/strings/az.json | 4 +- src/i18n/strings/bg.json | 236 ++++++------ src/i18n/strings/bn_BD.json | 6 +- src/i18n/strings/bn_IN.json | 6 +- src/i18n/strings/bs.json | 4 +- src/i18n/strings/ca.json | 178 ++++----- src/i18n/strings/cs.json | 362 +++++++++--------- src/i18n/strings/cy.json | 4 +- src/i18n/strings/da.json | 10 +- src/i18n/strings/de_DE.json | 362 +++++++++--------- src/i18n/strings/el.json | 344 +++++++++-------- src/i18n/strings/en_EN.json | 359 ++++++++--------- src/i18n/strings/eo.json | 260 +++++++------ src/i18n/strings/es.json | 346 +++++++++-------- src/i18n/strings/et.json | 362 +++++++++--------- src/i18n/strings/eu.json | 236 ++++++------ src/i18n/strings/fa.json | 244 ++++++------ src/i18n/strings/fi.json | 326 ++++++++-------- src/i18n/strings/fr.json | 362 +++++++++--------- src/i18n/strings/ga.json | 44 ++- src/i18n/strings/gl.json | 346 +++++++++-------- src/i18n/strings/he.json | 280 +++++++------- src/i18n/strings/hi.json | 10 +- src/i18n/strings/hr.json | 6 +- src/i18n/strings/hu.json | 346 +++++++++-------- src/i18n/strings/id.json | 362 +++++++++--------- src/i18n/strings/is.json | 306 ++++++++------- src/i18n/strings/it.json | 362 +++++++++--------- src/i18n/strings/ja.json | 346 +++++++++-------- src/i18n/strings/jbo.json | 16 +- src/i18n/strings/kab.json | 236 ++++++------ src/i18n/strings/ko.json | 222 +++++------ src/i18n/strings/lo.json | 344 +++++++++-------- src/i18n/strings/lt.json | 256 +++++++------ src/i18n/strings/lv.json | 240 ++++++------ src/i18n/strings/ml.json | 6 +- src/i18n/strings/nb_NO.json | 184 ++++----- src/i18n/strings/nl.json | 346 +++++++++-------- src/i18n/strings/nn.json | 174 +++++---- src/i18n/strings/oc.json | 22 +- src/i18n/strings/pl.json | 358 ++++++++--------- src/i18n/strings/pt_BR.json | 268 ++++++------- src/i18n/strings/ru.json | 346 +++++++++-------- src/i18n/strings/sk.json | 362 +++++++++--------- src/i18n/strings/sq.json | 346 +++++++++-------- src/i18n/strings/sr.json | 182 ++++----- src/i18n/strings/sv.json | 346 +++++++++-------- src/i18n/strings/tr.json | 226 +++++------ src/i18n/strings/tzm.json | 6 +- src/i18n/strings/uk.json | 362 +++++++++--------- src/i18n/strings/vi.json | 336 ++++++++-------- src/i18n/strings/vls.json | 196 +++++----- src/i18n/strings/zh_Hans.json | 344 +++++++++-------- src/i18n/strings/zh_Hant.json | 362 +++++++++--------- src/toasts/AnalyticsToast.tsx | 12 +- 72 files changed, 6593 insertions(+), 6152 deletions(-) diff --git a/src/components/views/dialogs/AnalyticsLearnMoreDialog.tsx b/src/components/views/dialogs/AnalyticsLearnMoreDialog.tsx index 9e2372545c..3b09adbb52 100644 --- a/src/components/views/dialogs/AnalyticsLearnMoreDialog.tsx +++ b/src/components/views/dialogs/AnalyticsLearnMoreDialog.tsx @@ -51,7 +51,7 @@ export const AnalyticsLearnMoreDialog: React.FC = ({ const privacyPolicyLink = privacyPolicyUrl ? ( {_t( - "You can read all our terms here", + "analytics|privacy_policy", {}, { PrivacyPolicyUrl: (sub) => { @@ -71,33 +71,18 @@ export const AnalyticsLearnMoreDialog: React.FC = ({
- {_t( - "Help us identify issues and improve %(analyticsOwner)s by sharing anonymous usage data. To understand how people use multiple devices, we'll generate a random identifier, shared by your devices.", - { analyticsOwner }, - )} + {_t("analytics|pseudonymous_usage_data", { analyticsOwner })}
    -
  • - {_t( - "We don't record or profile any account data", - {}, - { Bold: (sub) => {sub} }, - )} -
  • -
  • - {_t( - "We don't share information with third parties", - {}, - { Bold: (sub) => {sub} }, - )} -
  • -
  • {_t("You can turn this off anytime in settings")}
  • +
  • {_t("analytics|bullet_1", {}, { Bold: (sub) => {sub} })}
  • +
  • {_t("analytics|bullet_2", {}, { Bold: (sub) => {sub} })}
  • +
  • {_t("analytics|disable_prompt")}
{privacyPolicyLink}
diff --git a/src/components/views/dialogs/SessionRestoreErrorDialog.tsx b/src/components/views/dialogs/SessionRestoreErrorDialog.tsx index 27e8965f6f..7893e271db 100644 --- a/src/components/views/dialogs/SessionRestoreErrorDialog.tsx +++ b/src/components/views/dialogs/SessionRestoreErrorDialog.tsx @@ -67,7 +67,7 @@ export default class SessionRestoreErrorDialog extends React.Component { if (SdkConfig.get().bug_report_endpoint_url) { dialogButtons = ( - {_t("Identity server")} + {_t("common|identity_server")}
({host})
); case SERVICE_TYPES.IM: return (
- {_t("Integration manager")} + {_t("common|integration_manager")}
({host})
); diff --git a/src/components/views/elements/ErrorBoundary.tsx b/src/components/views/elements/ErrorBoundary.tsx index 4a24d22f98..81584a5145 100644 --- a/src/components/views/elements/ErrorBoundary.tsx +++ b/src/components/views/elements/ErrorBoundary.tsx @@ -85,7 +85,7 @@ export default class ErrorBoundary extends React.PureComponent {

{_t( - "Please create a new issue on GitHub so that we can investigate this bug.", + "bug_reporting|create_new_issue", {}, { newIssueLink: (sub) => { diff --git a/src/components/views/elements/EventListSummary.tsx b/src/components/views/elements/EventListSummary.tsx index e0279a7c9c..9ed1345a0b 100644 --- a/src/components/views/elements/EventListSummary.tsx +++ b/src/components/views/elements/EventListSummary.tsx @@ -133,7 +133,7 @@ export default class EventListSummary extends React.Component< const desc = formatCommaSeparatedList(descs); - return _t("%(nameList)s %(transitionList)s", { nameList, transitionList: desc }); + return _t("timeline|summary|format", { nameList, transitionList: desc }); }); if (!summaries) { @@ -250,101 +250,101 @@ export default class EventListSummary extends React.Component< case TransitionType.Joined: res = userCount > 1 - ? _t("%(severalUsers)sjoined %(count)s times", { severalUsers: "", count }) - : _t("%(oneUser)sjoined %(count)s times", { oneUser: "", count }); + ? _t("timeline|summary|joined_multiple", { severalUsers: "", count }) + : _t("timeline|summary|joined", { oneUser: "", count }); break; case TransitionType.Left: res = userCount > 1 - ? _t("%(severalUsers)sleft %(count)s times", { severalUsers: "", count }) - : _t("%(oneUser)sleft %(count)s times", { oneUser: "", count }); + ? _t("timeline|summary|left_multiple", { severalUsers: "", count }) + : _t("timeline|summary|left", { oneUser: "", count }); break; case TransitionType.JoinedAndLeft: res = userCount > 1 - ? _t("%(severalUsers)sjoined and left %(count)s times", { severalUsers: "", count }) - : _t("%(oneUser)sjoined and left %(count)s times", { oneUser: "", count }); + ? _t("timeline|summary|joined_and_left_multiple", { severalUsers: "", count }) + : _t("timeline|summary|joined_and_left", { oneUser: "", count }); break; case TransitionType.LeftAndJoined: res = userCount > 1 - ? _t("%(severalUsers)sleft and rejoined %(count)s times", { severalUsers: "", count }) - : _t("%(oneUser)sleft and rejoined %(count)s times", { oneUser: "", count }); + ? _t("timeline|summary|rejoined_multiple", { severalUsers: "", count }) + : _t("timeline|summary|rejoined", { oneUser: "", count }); break; case TransitionType.InviteReject: res = userCount > 1 - ? _t("%(severalUsers)srejected their invitations %(count)s times", { + ? _t("timeline|summary|rejected_invite_multiple", { severalUsers: "", count, }) - : _t("%(oneUser)srejected their invitation %(count)s times", { oneUser: "", count }); + : _t("timeline|summary|rejected_invite", { oneUser: "", count }); break; case TransitionType.InviteWithdrawal: res = userCount > 1 - ? _t("%(severalUsers)shad their invitations withdrawn %(count)s times", { + ? _t("timeline|summary|invite_withdrawn_multiple", { severalUsers: "", count, }) - : _t("%(oneUser)shad their invitation withdrawn %(count)s times", { oneUser: "", count }); + : _t("timeline|summary|invite_withdrawn", { oneUser: "", count }); break; case TransitionType.Invited: res = userCount > 1 - ? _t("were invited %(count)s times", { count }) - : _t("was invited %(count)s times", { count }); + ? _t("timeline|summary|invited_multiple", { count }) + : _t("timeline|summary|invited", { count }); break; case TransitionType.Banned: res = userCount > 1 - ? _t("were banned %(count)s times", { count }) - : _t("was banned %(count)s times", { count }); + ? _t("timeline|summary|banned_multiple", { count }) + : _t("timeline|summary|banned", { count }); break; case TransitionType.Unbanned: res = userCount > 1 - ? _t("were unbanned %(count)s times", { count }) - : _t("was unbanned %(count)s times", { count }); + ? _t("timeline|summary|unbanned_multiple", { count }) + : _t("timeline|summary|unbanned", { count }); break; case TransitionType.Kicked: res = userCount > 1 - ? _t("were removed %(count)s times", { count }) - : _t("was removed %(count)s times", { count }); + ? _t("timeline|summary|kicked_multiple", { count }) + : _t("timeline|summary|kicked", { count }); break; case TransitionType.ChangedName: res = userCount > 1 - ? _t("%(severalUsers)schanged their name %(count)s times", { severalUsers: "", count }) - : _t("%(oneUser)schanged their name %(count)s times", { oneUser: "", count }); + ? _t("timeline|summary|changed_name_multiple", { severalUsers: "", count }) + : _t("timeline|summary|changed_name", { oneUser: "", count }); break; case TransitionType.ChangedAvatar: res = userCount > 1 - ? _t("%(severalUsers)schanged their profile picture %(count)s times", { + ? _t("timeline|summary|changed_avatar_multiple", { severalUsers: "", count, }) - : _t("%(oneUser)schanged their profile picture %(count)s times", { oneUser: "", count }); + : _t("timeline|summary|changed_avatar", { oneUser: "", count }); break; case TransitionType.NoChange: res = userCount > 1 - ? _t("%(severalUsers)smade no changes %(count)s times", { severalUsers: "", count }) - : _t("%(oneUser)smade no changes %(count)s times", { oneUser: "", count }); + ? _t("timeline|summary|no_change_multiple", { severalUsers: "", count }) + : _t("timeline|summary|no_change", { oneUser: "", count }); break; case TransitionType.ServerAcl: res = userCount > 1 - ? _t("%(severalUsers)schanged the server ACLs %(count)s times", { severalUsers: "", count }) - : _t("%(oneUser)schanged the server ACLs %(count)s times", { oneUser: "", count }); + ? _t("timeline|summary|server_acls_multiple", { severalUsers: "", count }) + : _t("timeline|summary|server_acls", { oneUser: "", count }); break; case TransitionType.ChangedPins: res = userCount > 1 ? _t( - "%(severalUsers)schanged the pinned messages for the room %(count)s times", + "timeline|summary|pinned_events_multiple", { severalUsers: "", count }, { a: (sub) => ( @@ -355,7 +355,7 @@ export default class EventListSummary extends React.Component< }, ) : _t( - "%(oneUser)schanged the pinned messages for the room %(count)s times", + "timeline|summary|pinned_events", { oneUser: "", count }, { a: (sub) => ( @@ -369,14 +369,14 @@ export default class EventListSummary extends React.Component< case TransitionType.MessageRemoved: res = userCount > 1 - ? _t("%(severalUsers)sremoved a message %(count)s times", { severalUsers: "", count }) - : _t("%(oneUser)sremoved a message %(count)s times", { oneUser: "", count }); + ? _t("timeline|summary|redacted_multiple", { severalUsers: "", count }) + : _t("timeline|summary|redacted", { oneUser: "", count }); break; case TransitionType.HiddenEvent: res = userCount > 1 - ? _t("%(severalUsers)ssent %(count)s hidden messages", { severalUsers: "", count }) - : _t("%(oneUser)ssent %(count)s hidden messages", { oneUser: "", count }); + ? _t("timeline|summary|hidden_event_multiple", { severalUsers: "", count }) + : _t("timeline|summary|hidden_event", { oneUser: "", count }); break; } diff --git a/src/components/views/emojipicker/EmojiPicker.tsx b/src/components/views/emojipicker/EmojiPicker.tsx index 51b3b77796..7d1956c815 100644 --- a/src/components/views/emojipicker/EmojiPicker.tsx +++ b/src/components/views/emojipicker/EmojiPicker.tsx @@ -87,63 +87,63 @@ class EmojiPicker extends React.Component { this.categories = [ { id: "recent", - name: _t("Frequently Used"), + name: _t("emoji|category_frequently_used"), enabled: this.recentlyUsed.length > 0, visible: this.recentlyUsed.length > 0, ref: React.createRef(), }, { id: "people", - name: _t("Smileys & People"), + name: _t("emoji|category_smileys_people"), enabled: true, visible: true, ref: React.createRef(), }, { id: "nature", - name: _t("Animals & Nature"), + name: _t("emoji|category_animals_nature"), enabled: true, visible: false, ref: React.createRef(), }, { id: "foods", - name: _t("Food & Drink"), + name: _t("emoji|category_food_drink"), enabled: true, visible: false, ref: React.createRef(), }, { id: "activity", - name: _t("Activities"), + name: _t("emoji|category_activities"), enabled: true, visible: false, ref: React.createRef(), }, { id: "places", - name: _t("Travel & Places"), + name: _t("emoji|category_travel_places"), enabled: true, visible: false, ref: React.createRef(), }, { id: "objects", - name: _t("Objects"), + name: _t("emoji|category_objects"), enabled: true, visible: false, ref: React.createRef(), }, { id: "symbols", - name: _t("Symbols"), + name: _t("emoji|category_symbols"), enabled: true, visible: false, ref: React.createRef(), }, { id: "flags", - name: _t("Flags"), + name: _t("emoji|category_flags"), enabled: true, visible: false, ref: React.createRef(), diff --git a/src/components/views/emojipicker/Header.tsx b/src/components/views/emojipicker/Header.tsx index c3643f6e2a..27638bae1a 100644 --- a/src/components/views/emojipicker/Header.tsx +++ b/src/components/views/emojipicker/Header.tsx @@ -95,7 +95,7 @@ class Header extends React.PureComponent {