diff --git a/app/soapbox/components/sidebar-menu.tsx b/app/soapbox/components/sidebar-menu.tsx index 466e5ca16..21703caa0 100644 --- a/app/soapbox/components/sidebar-menu.tsx +++ b/app/soapbox/components/sidebar-menu.tsx @@ -38,6 +38,7 @@ const messages = defineMessages({ developers: { id: 'navigation.developers', defaultMessage: 'Developers' }, addAccount: { id: 'profile_dropdown.add_account', defaultMessage: 'Add an existing account' }, followRequests: { id: 'navigation_bar.follow_requests', defaultMessage: 'Follow requests' }, + close: { id: 'lightbox.close', defaultMessage: 'Close' }, }); interface ISidebarLink { @@ -148,7 +149,7 @@ const SidebarMenu: React.FC = (): JSX.Element | null => { onClick={handleClose} > = ({ account }) => { )} diff --git a/app/soapbox/features/auth-login/components/password-reset-confirm.tsx b/app/soapbox/features/auth-login/components/password-reset-confirm.tsx index fb20ab06d..f0a4d1c31 100644 --- a/app/soapbox/features/auth-login/components/password-reset-confirm.tsx +++ b/app/soapbox/features/auth-login/components/password-reset-confirm.tsx @@ -11,6 +11,7 @@ const token = new URLSearchParams(window.location.search).get('reset_password_to const messages = defineMessages({ resetPasswordFail: { id: 'reset_password.fail', defaultMessage: 'Expired token, please try again.' }, + passwordPlaceholder: { id: 'reset_password.password.placeholder', defaultMessage: 'Placeholder' }, }); const Statuses = { @@ -66,11 +67,11 @@ const PasswordResetConfirm = () => {
- + } errors={renderErrors()}> diff --git a/app/soapbox/features/chats/components/chat-window.tsx b/app/soapbox/features/chats/components/chat-window.tsx index 3bcb83165..9808dce3f 100644 --- a/app/soapbox/features/chats/components/chat-window.tsx +++ b/app/soapbox/features/chats/components/chat-window.tsx @@ -1,4 +1,5 @@ import React, { useEffect, useRef } from 'react'; +import { defineMessages, useIntl } from 'react-intl'; import { Link } from 'react-router-dom'; import { @@ -18,6 +19,10 @@ import ChatBox from './chat-box'; import type { Account as AccountEntity } from 'soapbox/types/entities'; +const messages = defineMessages({ + close: { id: 'chat_window.close', defaultMessage: 'Close chat' }, +}); + type WindowState = 'open' | 'minimized'; const getChat = makeGetChat(); @@ -33,6 +38,7 @@ interface IChatWindow { /** Floating desktop chat window. */ const ChatWindow: React.FC = ({ idx, chatId, windowState }) => { + const intl = useIntl(); const dispatch = useAppDispatch(); const displayFqn = useAppSelector(getDisplayFqn); @@ -98,7 +104,7 @@ const ChatWindow: React.FC = ({ idx, chatId, windowState }) => { @{getAcct(account, displayFqn)}
- +
diff --git a/app/soapbox/features/developers/settings-store.tsx b/app/soapbox/features/developers/settings-store.tsx index cfddc637e..521ed0dab 100644 --- a/app/soapbox/features/developers/settings-store.tsx +++ b/app/soapbox/features/developers/settings-store.tsx @@ -29,6 +29,7 @@ const isJSONValid = (text: any): boolean => { const messages = defineMessages({ heading: { id: 'column.settings_store', defaultMessage: 'Settings store' }, + advanced: { id: 'developers.settings_store.advanced', defaultMessage: 'Advanced settings' }, hint: { id: 'developers.settings_store.hint', defaultMessage: 'It is possible to directly edit your user settings here. BE CAREFUL! Editing this section can break your account, and you will only be able to recover through the API.' }, }); @@ -98,7 +99,7 @@ const SettingsStore: React.FC = () => { - + diff --git a/app/soapbox/features/onboarding/steps/avatar-selection-step.tsx b/app/soapbox/features/onboarding/steps/avatar-selection-step.tsx index 936b59a51..f5f9f7274 100644 --- a/app/soapbox/features/onboarding/steps/avatar-selection-step.tsx +++ b/app/soapbox/features/onboarding/steps/avatar-selection-step.tsx @@ -1,6 +1,6 @@ import classNames from 'clsx'; import React from 'react'; -import { FormattedMessage } from 'react-intl'; +import { defineMessages, FormattedMessage } from 'react-intl'; import { useDispatch } from 'react-redux'; import { patchMe } from 'soapbox/actions/me'; @@ -11,6 +11,10 @@ import resizeImage from 'soapbox/utils/resize-image'; import type { AxiosError } from 'axios'; +const messages = defineMessages({ + error: { id: 'onboarding.error', defaultMessage: 'An unexpected error occurred. Please try again or skip this step.' }, +}); + /** Default avatar filenames from various backends */ const DEFAULT_AVATARS = [ '/avatars/original/missing.png', // Mastodon @@ -64,7 +68,7 @@ const AvatarSelectionStep = ({ onNext }: { onNext: () => void }) => { if (error.response?.status === 422) { dispatch(snackbar.error((error.response.data as any).error.replace('Validation failed: ', ''))); } else { - dispatch(snackbar.error('An unexpected error occurred. Please try again or skip this step.')); + dispatch(snackbar.error(messages.error)); } }); }).catch(console.error); diff --git a/app/soapbox/features/onboarding/steps/bio-step.tsx b/app/soapbox/features/onboarding/steps/bio-step.tsx index bed69ecbc..38ec425ad 100644 --- a/app/soapbox/features/onboarding/steps/bio-step.tsx +++ b/app/soapbox/features/onboarding/steps/bio-step.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { FormattedMessage } from 'react-intl'; +import { defineMessages, FormattedMessage, useIntl } from 'react-intl'; import { useDispatch } from 'react-redux'; import { patchMe } from 'soapbox/actions/me'; @@ -9,7 +9,13 @@ import { useOwnAccount } from 'soapbox/hooks'; import type { AxiosError } from 'axios'; +const messages = defineMessages({ + bioPlaceholder: { id: 'onboarding.bio.placeholder', defaultMessage: 'Tell the world a little about yourself…' }, + error: { id: 'onboarding.error', defaultMessage: 'An unexpected error occurred. Please try again or skip this step.' }, +}); + const BioStep = ({ onNext }: { onNext: () => void }) => { + const intl = useIntl(); const dispatch = useDispatch(); const account = useOwnAccount(); @@ -32,7 +38,7 @@ const BioStep = ({ onNext }: { onNext: () => void }) => { if (error.response?.status === 422) { setErrors([(error.response.data as any).error.replace('Validation failed: ', '')]); } else { - dispatch(snackbar.error('An unexpected error occurred. Please try again or skip this step.')); + dispatch(snackbar.error(messages.error)); } }); }; @@ -56,13 +62,13 @@ const BioStep = ({ onNext }: { onNext: () => void }) => {
} + labelText={} errors={errors} >