From 8b4390681bc57c7ee9811fc11b60af64331d53fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Sat, 26 Nov 2022 14:09:28 +0100 Subject: [PATCH 1/4] Make some strings localizable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- app/soapbox/components/sidebar-menu.tsx | 3 +- .../components/password-reset-confirm.tsx | 5 ++-- .../features/chats/components/chat-window.tsx | 8 +++++- .../features/developers/settings-store.tsx | 3 +- .../features/onboarding/steps/bio-step.tsx | 13 ++++++--- .../steps/cover-photo-selection-step.tsx | 6 +++- .../onboarding/steps/display-name-step.tsx | 17 ++++++++--- .../public-layout/components/header.tsx | 3 +- .../ui/components/modals/boost-modal.tsx | 2 +- .../ui/components/modals/verify-sms-modal.tsx | 2 +- .../features/verification/registration.tsx | 28 ++++++------------- .../verification/steps/age-verification.tsx | 16 ++++++++--- .../verification/steps/email-verification.tsx | 7 +++-- .../verification/steps/sms-verification.tsx | 11 +++++--- .../features/verification/waitlist-page.tsx | 15 ++++++---- 15 files changed, 88 insertions(+), 51 deletions(-) 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} > {
- + } 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/bio-step.tsx b/app/soapbox/features/onboarding/steps/bio-step.tsx index bed69ecbc..77205b001 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,12 @@ 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…' }, +}); + const BioStep = ({ onNext }: { onNext: () => void }) => { + const intl = useIntl(); const dispatch = useDispatch(); const account = useOwnAccount(); @@ -56,13 +61,13 @@ const BioStep = ({ onNext }: { onNext: () => void }) => {
} + labelText={} errors={errors} >