Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Change wording from avatar to profile picture #7015

Merged
merged 8 commits into from
Jul 7, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/components/views/avatars/BaseAvatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ interface IProps {
onClick?: React.MouseEventHandler;
inputRef?: React.RefObject<HTMLImageElement & HTMLSpanElement>;
className?: string;
altText?: string;
ariaLabel?: string;
}

const calculateUrls = (url, urls, lowBandwidth) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could these get types whilst you're here please

Suggested change
const calculateUrls = (url, urls, lowBandwidth) => {
const calculateUrls = (url: string, urls: string[], lowBandwidth: boolean) => {

Expand Down Expand Up @@ -112,6 +114,8 @@ const BaseAvatar = (props: IProps) => {
onClick,
inputRef,
className,
altText = _t("Avatar"),
ariaLabel = _t("Avatar"),
...otherProps
} = props;

Expand Down Expand Up @@ -149,7 +153,7 @@ const BaseAvatar = (props: IProps) => {
if (onClick) {
return (
<AccessibleButton
aria-label={_t("Avatar")}
aria-label={ariaLabel}
{...otherProps}
element="span"
className={classNames("mx_BaseAvatar", className)}
Expand Down Expand Up @@ -188,7 +192,7 @@ const BaseAvatar = (props: IProps) => {
height: toPx(height),
}}
title={title}
alt={_t("Avatar")}
alt={altText}
inputRef={inputRef}
{...otherProps} />
);
Expand Down
8 changes: 5 additions & 3 deletions src/components/views/avatars/MemberAvatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<React.ComponentProps<typeof BaseAvatar>, "name" | "idName" | "url"> {
member: RoomMember;
Expand Down Expand Up @@ -110,7 +110,9 @@ export default class MemberAvatar extends React.Component<IProps, IState> {
title={this.state.title}
idName={userId}
url={this.state.imageUrl}
onClick={onClick} />
onClick={onClick}
altText={_t("Profile picture")}
ariaLabel={_t("Profile picture")} />
);
}
}
7 changes: 5 additions & 2 deletions src/components/views/elements/MemberEventListSummary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -309,8 +309,11 @@ export default class MemberEventListSummary extends React.Component<IProps> {
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)
Expand Down
4 changes: 2 additions & 2 deletions src/components/views/messages/EncryptionEvent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ const EncryptionEvent = forwardRef<HTMLDivElement, IProps>(({ 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 <EventTileBubble
Expand Down
12 changes: 6 additions & 6 deletions src/i18n/strings/en_EN.json
Original file line number Diff line number Diff line change
Expand Up @@ -1965,8 +1965,8 @@
"Download": "Download",
"View Source": "View Source",
"Some encryption parameters have been changed.": "Some encryption parameters have been changed.",
"Messages here are end-to-end encrypted. Verify %(displayName)s in their profile - tap on their avatar.": "Messages here are end-to-end encrypted. Verify %(displayName)s in their profile - tap on their avatar.",
"Messages in this room are end-to-end encrypted. When people join, you can verify them in their profile, just tap on their avatar.": "Messages in this room are end-to-end encrypted. When people join, you can verify them in their profile, just tap on their avatar.",
"Messages here are end-to-end encrypted. Verify %(displayName)s in their profile - tap on their profile picture.": "Messages here are end-to-end encrypted. Verify %(displayName)s in their profile - tap on their profile picture.",
"Messages in this room are end-to-end encrypted. When people join, you can verify them in their profile, just tap on their profile picture.": "Messages in this room are end-to-end encrypted. When people join, you can verify them in their profile, just tap on their profile picture.",
"Encryption enabled": "Encryption enabled",
"Ignored attempt to disable encryption": "Ignored attempt to disable encryption",
"Encryption not enabled": "Encryption not enabled",
Expand Down Expand Up @@ -2143,10 +2143,10 @@
"%(severalUsers)schanged their name %(count)s times|one": "%(severalUsers)schanged their name",
"%(oneUser)schanged their name %(count)s times|other": "%(oneUser)schanged their name %(count)s times",
"%(oneUser)schanged their name %(count)s times|one": "%(oneUser)schanged their name",
"%(severalUsers)schanged their avatar %(count)s times|other": "%(severalUsers)schanged their avatar %(count)s times",
"%(severalUsers)schanged their avatar %(count)s times|one": "%(severalUsers)schanged their avatar",
"%(oneUser)schanged their avatar %(count)s times|other": "%(oneUser)schanged their avatar %(count)s times",
"%(oneUser)schanged their avatar %(count)s times|one": "%(oneUser)schanged their avatar",
"%(severalUsers)schanged their profile picture %(count)s times|other": "%(severalUsers)schanged their profile picture %(count)s times",
"%(severalUsers)schanged their profile picture %(count)s times|one": "%(severalUsers)schanged their profile picture",
"%(oneUser)schanged their profile picture %(count)s times|other": "%(oneUser)schanged their profile picture %(count)s times",
"%(oneUser)schanged their profile picture %(count)s times|one": "%(oneUser)schanged their profile picture",
"%(severalUsers)smade no changes %(count)s times|other": "%(severalUsers)smade no changes %(count)s times",
"%(severalUsers)smade no changes %(count)s times|one": "%(severalUsers)smade no changes",
"%(oneUser)smade no changes %(count)s times|other": "%(oneUser)smade no changes %(count)s times",
Expand Down