Fully migrate to ICU

This commit is contained in:
Jamie Kyle 2023-03-29 17:03:25 -07:00 committed by GitHub
parent d4e7177ba6
commit 5e647c55d1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
274 changed files with 7948 additions and 1944 deletions

View file

@ -132,15 +132,15 @@ export const BaseConversationListItem: FunctionComponent<PropsType> =
} else if (isCheckbox) {
let ariaLabel: string;
if (disabled) {
ariaLabel = i18n('cannotSelectContact', {
ariaLabel = i18n('icu:cannotSelectContact', {
name: title,
});
} else if (checked) {
ariaLabel = i18n('deselectContact', {
ariaLabel = i18n('icu:deselectContact', {
name: title,
});
} else {
ariaLabel = i18n('selectContact', {
ariaLabel = i18n('icu:selectContact', {
name: title,
});
}
@ -250,7 +250,9 @@ export const BaseConversationListItem: FunctionComponent<PropsType> =
if (onClick) {
return (
<button
aria-label={i18n('BaseConversationListItem__aria-label', { title })}
aria-label={i18n('icu:BaseConversationListItem__aria-label', {
title,
})}
className={classNames(
commonClassNames,
`${BASE_CLASS_NAME}--is-button`

View file

@ -78,7 +78,7 @@ export const ContactCheckbox: FunctionComponent<PropsType> = React.memo(
const headerName = isMe ? (
<ContactName
module={HEADER_CONTACT_NAME_CLASS_NAME}
title={i18n('noteToSelf')}
title={i18n('icu:noteToSelf')}
isMe={isMe}
/>
) : (
@ -87,7 +87,7 @@ export const ContactCheckbox: FunctionComponent<PropsType> = React.memo(
let messageText: undefined | string | JSX.Element;
if (disabledReason === ContactCheckboxDisabledReason.AlreadyAdded) {
messageText = i18n('alreadyAMember');
messageText = i18n('icu:alreadyAMember');
} else if (about) {
messageText = <About className="" text={about} />;
}

View file

@ -71,7 +71,7 @@ export const ContactListItem: FunctionComponent<PropsType> = React.memo(
<ContactName
isMe={isMe}
module={HEADER_CONTACT_NAME_CLASS_NAME}
title={i18n('noteToSelf')}
title={i18n('icu:noteToSelf')}
/>
) : (
<ContactName

View file

@ -109,7 +109,7 @@ export const ConversationListItem: FunctionComponent<Props> = React.memo(
<ContactName
module={HEADER_CONTACT_NAME_CLASS_NAME}
isMe={isMe}
title={i18n('noteToSelf')}
title={i18n('icu:noteToSelf')}
/>
) : (
<ContactName
@ -128,7 +128,7 @@ export const ConversationListItem: FunctionComponent<Props> = React.memo(
if (!acceptedMessageRequest) {
messageText = (
<span className={`${MESSAGE_TEXT_CLASS_NAME}__message-request`}>
{i18n('ConversationListItem--message-request')}
{i18n('icu:ConversationListItem--message-request')}
</span>
);
} else if (typingContactId) {
@ -137,7 +137,7 @@ export const ConversationListItem: FunctionComponent<Props> = React.memo(
messageText = (
<>
<span className={`${MESSAGE_TEXT_CLASS_NAME}__draft-prefix`}>
{i18n('ConversationListItem--draft-prefix')}
{i18n('icu:ConversationListItem--draft-prefix')}
</span>
<MessageBody
text={truncateMessageText(draftPreview)}
@ -150,7 +150,7 @@ export const ConversationListItem: FunctionComponent<Props> = React.memo(
} else if (lastMessage?.deletedForEveryone) {
messageText = (
<span className={`${MESSAGE_TEXT_CLASS_NAME}__deleted-for-everyone`}>
{i18n('message--deletedForEveryone')}
{i18n('icu:message--deletedForEveryone')}
</span>
);
} else if (lastMessage) {

View file

@ -15,7 +15,7 @@ type PropsType = {
export const CreateNewGroupButton: FunctionComponent<PropsType> = React.memo(
function CreateNewGroupButton({ i18n, onClick }) {
const title = i18n('createNewGroupButton');
const title = i18n('icu:createNewGroupButton');
return (
<ListTile

View file

@ -40,13 +40,13 @@ export function GroupListItem({
let messageText: string;
switch (group.disabledReason) {
case DisabledReason.AlreadyMember:
messageText = i18n('GroupListItem__message-already-member');
messageText = i18n('icu:GroupListItem__message-already-member');
break;
case DisabledReason.Pending:
messageText = i18n('GroupListItem__message-pending');
messageText = i18n('icu:GroupListItem__message-pending');
break;
default:
messageText = i18n('GroupListItem__message-default', {
messageText = i18n('icu:GroupListItem__message-default', {
count: group.membersCount,
});
}

View file

@ -71,7 +71,7 @@ const renderPerson = (
title: string;
}>
): ReactNode =>
person.isMe ? i18n('you') : <ContactName title={person.title} />;
person.isMe ? i18n('icu:you') : <ContactName title={person.title} />;
// This function exists because bodyRanges tells us the character position
// where the at-mention starts at according to the full body text. The snippet
@ -162,7 +162,7 @@ export const MessageSearchResult: FunctionComponent<PropsType> = React.memo(
let headerName: ReactNode;
if (isNoteToSelf) {
headerName = i18n('noteToSelf');
headerName = i18n('icu:noteToSelf');
} else if (from.isMe) {
if (to.type === 'group') {
headerName = (

View file

@ -79,12 +79,12 @@ export const PhoneNumberCheckbox: FunctionComponent<PropsType> = React.memo(
modal = (
<ConfirmationDialog
dialogName="PhoneNumberCheckbox.invalidPhoneNumber"
cancelText={i18n('ok')}
cancelText={i18n('icu:ok')}
cancelButtonVariant={ButtonVariant.Secondary}
i18n={i18n}
onClose={() => setIsModalVisible(false)}
>
{i18n('startConversation--phone-number-not-valid', {
{i18n('icu:startConversation--phone-number-not-valid', {
phoneNumber: phoneNumber.userInput,
})}
</ConfirmationDialog>

View file

@ -76,12 +76,12 @@ export const StartNewConversation: FunctionComponent<Props> = React.memo(
modal = (
<ConfirmationDialog
dialogName="StartNewConversation.invalidPhoneNumber"
cancelText={i18n('ok')}
cancelText={i18n('icu:ok')}
cancelButtonVariant={ButtonVariant.Secondary}
i18n={i18n}
onClose={() => setIsModalVisible(false)}
>
{i18n('startConversation--phone-number-not-valid', {
{i18n('icu:startConversation--phone-number-not-valid', {
phoneNumber: phoneNumber.userInput,
})}
</ConfirmationDialog>