From 70acc279f54ffca2f6b925baf9da1f82e32bd4ae Mon Sep 17 00:00:00 2001 From: Aaron Raimist Date: Fri, 22 Oct 2021 16:10:34 -0500 Subject: [PATCH 1/6] Change wording from avatar to profile picture Signed-off-by: Aaron Raimist --- src/components/views/avatars/BaseAvatar.tsx | 8 ++++++-- src/components/views/avatars/MemberAvatar.tsx | 8 +++++--- .../views/elements/MemberEventListSummary.tsx | 4 ++-- src/components/views/messages/EncryptionEvent.tsx | 4 ++-- src/i18n/strings/en_EN.json | 12 ++++++------ 5 files changed, 21 insertions(+), 15 deletions(-) diff --git a/src/components/views/avatars/BaseAvatar.tsx b/src/components/views/avatars/BaseAvatar.tsx index 6aaef298547..d8d9571ac5a 100644 --- a/src/components/views/avatars/BaseAvatar.tsx +++ b/src/components/views/avatars/BaseAvatar.tsx @@ -44,6 +44,8 @@ interface IProps { onClick?: React.MouseEventHandler; inputRef?: React.RefObject; className?: string; + altText?: string; + ariaLabel?: string; } const calculateUrls = (url, urls, lowBandwidth) => { @@ -112,6 +114,8 @@ const BaseAvatar = (props: IProps) => { onClick, inputRef, className, + altText = _t("Avatar"), + ariaLabel = _t("Avatar"), ...otherProps } = props; @@ -149,7 +153,7 @@ const BaseAvatar = (props: IProps) => { if (onClick) { return ( { height: toPx(height), }} title={title} - alt={_t("Avatar")} + alt={altText} inputRef={inputRef} {...otherProps} /> ); diff --git a/src/components/views/avatars/MemberAvatar.tsx b/src/components/views/avatars/MemberAvatar.tsx index 48b2575cd25..7004177d4ef 100644 --- a/src/components/views/avatars/MemberAvatar.tsx +++ b/src/components/views/avatars/MemberAvatar.tsx @@ -18,14 +18,14 @@ limitations under the License. import React from 'react'; import { RoomMember } from "matrix-js-sdk/src/models/room-member"; import { ResizeMethod } from 'matrix-js-sdk/src/@types/partials'; +import { logger } from "matrix-js-sdk/src/logger"; import dis from "../../../dispatcher/dispatcher"; import { Action } from "../../../dispatcher/actions"; import BaseAvatar from "./BaseAvatar"; import { replaceableComponent } from "../../../utils/replaceableComponent"; import { mediaFromMxc } from "../../../customisations/Media"; - -import { logger } from "matrix-js-sdk/src/logger"; +import { _t } from '../../../languageHandler'; interface IProps extends Omit, "name" | "idName" | "url"> { member: RoomMember; @@ -110,7 +110,9 @@ export default class MemberAvatar extends React.Component { title={this.state.title} idName={userId} url={this.state.imageUrl} - onClick={onClick} /> + onClick={onClick} + altText={_t("Profile picture")} + ariaLabel={_t("Profile picture")} /> ); } } diff --git a/src/components/views/elements/MemberEventListSummary.tsx b/src/components/views/elements/MemberEventListSummary.tsx index 4eb0177fef6..067a94355dc 100644 --- a/src/components/views/elements/MemberEventListSummary.tsx +++ b/src/components/views/elements/MemberEventListSummary.tsx @@ -309,8 +309,8 @@ export default class MemberEventListSummary extends React.Component { break; case "changed_avatar": res = (userCount > 1) - ? _t("%(severalUsers)schanged their avatar %(count)s times", { severalUsers: "", count: repeats }) - : _t("%(oneUser)schanged their avatar %(count)s times", { oneUser: "", count: repeats }); + ? _t("%(severalUsers)schanged their profile picture %(count)s times", { severalUsers: "", count: repeats }) + : _t("%(oneUser)schanged their profile picture %(count)s times", { oneUser: "", count: repeats }); break; case "no_change": res = (userCount > 1) diff --git a/src/components/views/messages/EncryptionEvent.tsx b/src/components/views/messages/EncryptionEvent.tsx index 8f352610e0d..a6a6bb6fb73 100644 --- a/src/components/views/messages/EncryptionEvent.tsx +++ b/src/components/views/messages/EncryptionEvent.tsx @@ -50,10 +50,10 @@ const EncryptionEvent = forwardRef(({ mxEvent }, ref) => } else if (dmPartner) { const displayName = cli?.getRoom(roomId)?.getMember(dmPartner)?.rawDisplayName || dmPartner; subtitle = _t("Messages here are end-to-end encrypted. " + - "Verify %(displayName)s in their profile - tap on their avatar.", { displayName }); + "Verify %(displayName)s in their profile - tap on their profile picture.", { displayName }); } else { subtitle = _t("Messages in this room are end-to-end encrypted. " + - "When people join, you can verify them in their profile, just tap on their avatar."); + "When people join, you can verify them in their profile, just tap on their profile picture."); } return Date: Fri, 22 Oct 2021 17:58:49 -0500 Subject: [PATCH 2/6] lint Signed-off-by: Aaron Raimist --- src/components/views/elements/MemberEventListSummary.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/views/elements/MemberEventListSummary.tsx b/src/components/views/elements/MemberEventListSummary.tsx index 067a94355dc..9c33da7497f 100644 --- a/src/components/views/elements/MemberEventListSummary.tsx +++ b/src/components/views/elements/MemberEventListSummary.tsx @@ -309,7 +309,10 @@ export default class MemberEventListSummary extends React.Component { break; case "changed_avatar": res = (userCount > 1) - ? _t("%(severalUsers)schanged their profile picture %(count)s times", { severalUsers: "", count: repeats }) + ? _t("%(severalUsers)schanged their profile picture %(count)s times", { + severalUsers: "", + count: repeats, + }) : _t("%(oneUser)schanged their profile picture %(count)s times", { oneUser: "", count: repeats }); break; case "no_change": From 7cabf4d69c1755d93a948cb106f3a01dccc5ffe0 Mon Sep 17 00:00:00 2001 From: Aaron Raimist Date: Thu, 12 May 2022 06:09:21 +0000 Subject: [PATCH 3/6] Update EventListSummary Signed-off-by: Aaron Raimist --- src/components/views/elements/EventListSummary.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/views/elements/EventListSummary.tsx b/src/components/views/elements/EventListSummary.tsx index 1fc99c774af..ded100d497a 100644 --- a/src/components/views/elements/EventListSummary.tsx +++ b/src/components/views/elements/EventListSummary.tsx @@ -309,8 +309,8 @@ export default class EventListSummary extends React.Component { break; case TransitionType.ChangedAvatar: res = (userCount > 1) - ? _t("%(severalUsers)schanged their avatar %(count)s times", { severalUsers: "", count }) - : _t("%(oneUser)schanged their avatar %(count)s times", { oneUser: "", count }); + ? _t("%(severalUsers)schanged their profile picture %(count)s times", { severalUsers: "", count }) + : _t("%(oneUser)schanged their profile picture %(count)s times", { oneUser: "", count }); break; case TransitionType.NoChange: res = (userCount > 1) From 788f252c477340f703da516f82eeb4e45478e44b Mon Sep 17 00:00:00 2001 From: Aaron Raimist Date: Thu, 12 May 2022 06:11:37 +0000 Subject: [PATCH 4/6] Delete MembershipEventListSummary.tsx Signed-off-by: Aaron Raimist --- src/components/views/elements/MemberEventListSummary.tsx | 1 - 1 file changed, 1 deletion(-) delete mode 100644 src/components/views/elements/MemberEventListSummary.tsx diff --git a/src/components/views/elements/MemberEventListSummary.tsx b/src/components/views/elements/MemberEventListSummary.tsx deleted file mode 100644 index 8b137891791..00000000000 --- a/src/components/views/elements/MemberEventListSummary.tsx +++ /dev/null @@ -1 +0,0 @@ - From de5e67dfc79c2d25c1b51cb9c31890c95fdf0cfc Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Fri, 7 Jul 2023 11:02:40 +0100 Subject: [PATCH 5/6] delint --- src/components/views/elements/EventListSummary.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/views/elements/EventListSummary.tsx b/src/components/views/elements/EventListSummary.tsx index 6863f0e7e1e..7e14ad28c32 100644 --- a/src/components/views/elements/EventListSummary.tsx +++ b/src/components/views/elements/EventListSummary.tsx @@ -324,7 +324,10 @@ export default class EventListSummary extends React.Component< case TransitionType.ChangedAvatar: res = userCount > 1 - ? _t("%(severalUsers)schanged their profile picture %(count)s times", { severalUsers: "", count }) + ? _t("%(severalUsers)schanged their profile picture %(count)s times", { + severalUsers: "", + count, + }) : _t("%(oneUser)schanged their profile picture %(count)s times", { oneUser: "", count }); break; case TransitionType.NoChange: From 256fbb9a727e743167031728e1f30e7bbf33dd41 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Fri, 7 Jul 2023 11:30:38 +0100 Subject: [PATCH 6/6] Update tests --- .../views/right_panel/__snapshots__/UserInfo-test.tsx.snap | 2 +- .../__snapshots__/PreferencesUserSettingsTab-test.tsx.snap | 4 ++-- test/components/views/voip/CallView-test.tsx | 2 +- test/utils/exportUtils/__snapshots__/HTMLExport-test.ts.snap | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/test/components/views/right_panel/__snapshots__/UserInfo-test.tsx.snap b/test/components/views/right_panel/__snapshots__/UserInfo-test.tsx.snap index 2d9f24e9fc9..1b14fe13a82 100644 --- a/test/components/views/right_panel/__snapshots__/UserInfo-test.tsx.snap +++ b/test/components/views/right_panel/__snapshots__/UserInfo-test.tsx.snap @@ -94,7 +94,7 @@ exports[` with crypto enabled renders 1`] = ` class="mx_UserInfo_avatar_transition_child" > - Show current avatar and name for users in message history + Show current profile picture and name for users in message history
{ const carol = mkRoomMember(room.roomId, "@carol:example.org"); const expectAvatars = (userIds: string[]) => { - const avatars = screen.queryAllByRole("button", { name: "Avatar" }); + const avatars = screen.queryAllByRole("button", { name: "Profile picture" }); expect(userIds.length).toBe(avatars.length); for (const [userId, avatar] of zip(userIds, avatars)) { diff --git a/test/utils/exportUtils/__snapshots__/HTMLExport-test.ts.snap b/test/utils/exportUtils/__snapshots__/HTMLExport-test.ts.snap index 582447ebfe8..bdc38bfeb27 100644 --- a/test/utils/exportUtils/__snapshots__/HTMLExport-test.ts.snap +++ b/test/utils/exportUtils/__snapshots__/HTMLExport-test.ts.snap @@ -66,7 +66,7 @@ exports[`HTMLExport should export 1`] = `

-
  • @user49:example.com
    Message #49
  • @user48:example.com
    Message #48
  • @user47:example.com
    Message #47
  • @user46:example.com
    Message #46
  • @user45:example.com
    Message #45
  • @user44:example.com
    Message #44
  • @user43:example.com
    Message #43
  • @user42:example.com
    Message #42
  • @user41:example.com
    Message #41
  • @user40:example.com
    Message #40
  • @user39:example.com
    Message #39
  • @user38:example.com
    Message #38
  • @user37:example.com
    Message #37
  • @user36:example.com
    Message #36
  • @user35:example.com
    Message #35
  • @user34:example.com
    Message #34
  • @user33:example.com
    Message #33
  • @user32:example.com
    Message #32
  • @user31:example.com
    Message #31
  • @user30:example.com
    Message #30
  • @user29:example.com
    Message #29
  • @user28:example.com
    Message #28
  • @user27:example.com
    Message #27
  • @user26:example.com
    Message #26
  • @user25:example.com
    Message #25
  • @user24:example.com
    Message #24
  • @user23:example.com
    Message #23
  • @user22:example.com
    Message #22
  • @user21:example.com
    Message #21
  • @user20:example.com
    Message #20
  • @user19:example.com
    Message #19
  • @user18:example.com
    Message #18
  • @user17:example.com
    Message #17
  • @user16:example.com
    Message #16
  • @user15:example.com
    Message #15
  • @user14:example.com
    Message #14
  • @user13:example.com
    Message #13
  • @user12:example.com
    Message #12
  • @user11:example.com
    Message #11
  • @user10:example.com
    Message #10
  • @user9:example.com
    Message #9
  • @user8:example.com
    Message #8
  • @user7:example.com
    Message #7
  • @user6:example.com
    Message #6
  • @user5:example.com
    Message #5
  • @user4:example.com
    Message #4
  • @user3:example.com
    Message #3
  • @user2:example.com
    Message #2
  • @user1:example.com
    Message #1
  • @user0:example.com
    Message #0
  • +
  • @user49:example.com
    Message #49
  • @user48:example.com
    Message #48
  • @user47:example.com
    Message #47
  • @user46:example.com
    Message #46
  • @user45:example.com
    Message #45
  • @user44:example.com
    Message #44
  • @user43:example.com
    Message #43
  • @user42:example.com
    Message #42
  • @user41:example.com
    Message #41
  • @user40:example.com
    Message #40
  • @user39:example.com
    Message #39
  • @user38:example.com
    Message #38
  • @user37:example.com
    Message #37
  • @user36:example.com
    Message #36
  • @user35:example.com
    Message #35
  • @user34:example.com
    Message #34
  • @user33:example.com
    Message #33
  • @user32:example.com
    Message #32
  • @user31:example.com
    Message #31
  • @user30:example.com
    Message #30
  • @user29:example.com
    Message #29
  • @user28:example.com
    Message #28
  • @user27:example.com
    Message #27
  • @user26:example.com
    Message #26
  • @user25:example.com
    Message #25
  • @user24:example.com
    Message #24
  • @user23:example.com
    Message #23
  • @user22:example.com
    Message #22
  • @user21:example.com
    Message #21
  • @user20:example.com
    Message #20
  • @user19:example.com
    Message #19
  • @user18:example.com
    Message #18
  • @user17:example.com
    Message #17
  • @user16:example.com
    Message #16
  • @user15:example.com
    Message #15
  • @user14:example.com
    Message #14
  • @user13:example.com
    Message #13
  • @user12:example.com
    Message #12
  • @user11:example.com
    Message #11
  • @user10:example.com
    Message #10
  • @user9:example.com
    Message #9
  • @user8:example.com
    Message #8
  • @user7:example.com
    Message #7
  • @user6:example.com
    Message #6
  • @user5:example.com
    Message #5
  • @user4:example.com
    Message #4
  • @user3:example.com
    Message #3
  • @user2:example.com
    Message #2
  • @user1:example.com
    Message #1
  • @user0:example.com
    Message #0