From 66d454e6c663e871ac79309670a52348b3b9d728 Mon Sep 17 00:00:00 2001 From: Fernando Palomo Date: Mon, 19 Sep 2022 15:36:26 +0000 Subject: [PATCH] Implement the new strings into the client --- .../messaging/bars/MessageOverlayBar.tsx | 19 +++++++++++-------- src/components/common/user/UserBadges.tsx | 4 ++-- src/components/markdown/plugins/Codeblock.tsx | 4 +++- .../settings/account/AccountManagement.tsx | 6 +++--- .../account/MultiFactorAuthentication.tsx | 12 ++++++++++-- src/pages/channels/voice/VoiceHeader.tsx | 10 +++++----- src/pages/discover/Discover.tsx | 12 ++++-------- src/pages/friends/Friends.tsx | 4 ++-- src/pages/home/Home.tsx | 1 + src/pages/login/ConfirmDelete.tsx | 19 ++++++++++++------- src/pages/login/forms/CaptchaBlock.tsx | 2 +- src/pages/settings/panes/Audio.tsx | 4 ++-- src/pages/settings/panes/Feedback.tsx | 6 +++--- src/pages/settings/panes/MyBots.tsx | 7 +++---- src/pages/settings/panes/Profile.tsx | 10 +++++----- src/pages/settings/panes/Sessions.tsx | 4 ++-- src/pages/settings/server/Overview.tsx | 6 +++--- 17 files changed, 72 insertions(+), 58 deletions(-) diff --git a/src/components/common/messaging/bars/MessageOverlayBar.tsx b/src/components/common/messaging/bars/MessageOverlayBar.tsx index f17dcbfd..36a8f48e 100644 --- a/src/components/common/messaging/bars/MessageOverlayBar.tsx +++ b/src/components/common/messaging/bars/MessageOverlayBar.tsx @@ -11,6 +11,7 @@ import { observer } from "mobx-react-lite"; import { Message as MessageObject } from "revolt.js"; import styled from "styled-components"; +import { Text } from "preact-i18n"; import { openContextMenu } from "preact-context-menu"; import { useEffect, useState } from "preact/hooks"; @@ -109,7 +110,7 @@ export const MessageOverlayBar = observer( return ( {message.channel?.havePermission("SendMessage") && ( - + }> internalEmit("ReplyBar", "add", message) @@ -125,7 +126,7 @@ export const MessageOverlayBar = observer( open={reactionsOpen} setOpen={setReactionsOpen} message={message}> - + }> @@ -134,7 +135,7 @@ export const MessageOverlayBar = observer( )} {isAuthor && ( - + }> internalEmit( @@ -150,7 +151,7 @@ export const MessageOverlayBar = observer( {isAuthor || (message.channel && message.channel.havePermission("ManageMessages")) ? ( - + }> e.shiftKey @@ -164,7 +165,7 @@ export const MessageOverlayBar = observer( ) : undefined} - + }> openContextMenu("Menu", { @@ -179,7 +180,7 @@ export const MessageOverlayBar = observer( {extraActions && ( <> - + }> { // ! FIXME: deduplicate this code with ctx menu @@ -207,7 +208,7 @@ export const MessageOverlayBar = observer( } hideOnClick={false}> + } hideOnClick={false}> { diff --git a/src/components/common/user/UserBadges.tsx b/src/components/common/user/UserBadges.tsx index b14d8c6a..38775542 100644 --- a/src/components/common/user/UserBadges.tsx +++ b/src/components/common/user/UserBadges.tsx @@ -130,14 +130,14 @@ export default function UserBadges({ badges, uid }: Props) { <> )} {badges & Badges.ReservedRelevantJokeBadge1 ? ( - + }> ) : ( <> )} {badges & Badges.ReservedRelevantJokeBadge2 ? ( - + }> ) : ( diff --git a/src/components/markdown/plugins/Codeblock.tsx b/src/components/markdown/plugins/Codeblock.tsx index 85f27ece..0b25f45d 100644 --- a/src/components/markdown/plugins/Codeblock.tsx +++ b/src/components/markdown/plugins/Codeblock.tsx @@ -2,6 +2,8 @@ import styled from "styled-components"; import { useCallback, useRef } from "preact/hooks"; +import { Localizer, Text } from "preact-i18n"; + import { Tooltip } from "@revoltchat/ui"; import { modalController } from "../../../controllers/modals/ModalController"; @@ -66,7 +68,7 @@ export const RenderCodeblock: React.FC<{ class: string }> = ({ return ( - + } placement="top"> {/** // @ts-expect-error Preact-React */} {text} diff --git a/src/components/settings/account/AccountManagement.tsx b/src/components/settings/account/AccountManagement.tsx index 6c9c5310..9ebe23c3 100644 --- a/src/components/settings/account/AccountManagement.tsx +++ b/src/components/settings/account/AccountManagement.tsx @@ -39,7 +39,7 @@ export default function AccountManagement() { } description={ - "Disable your account. You won't be able to access it unless you contact support." + } action="chevron" onClick={callback("disable")}> @@ -49,7 +49,7 @@ export default function AccountManagement() { } description={ - "Your account will be queued for deletion, a confirmation email will be sent." + } action="chevron" onClick={callback("delete")}> @@ -57,4 +57,4 @@ export default function AccountManagement() { ); -} +} \ No newline at end of file diff --git a/src/components/settings/account/MultiFactorAuthentication.tsx b/src/components/settings/account/MultiFactorAuthentication.tsx index 8341f756..3f68594a 100644 --- a/src/components/settings/account/MultiFactorAuthentication.tsx +++ b/src/components/settings/account/MultiFactorAuthentication.tsx @@ -198,7 +198,15 @@ export default function MultiFactorAuthentication() { color={!mfa?.totp_mfa ? "var(--error)" : undefined} /> } - description={"Set up time-based one-time password."} + description={ + + } disabled={!mfa || (!mfa.recovery_active && !mfa.totp_mfa)} onClick={totpAction}> ); -} +} \ No newline at end of file diff --git a/src/pages/channels/voice/VoiceHeader.tsx b/src/pages/channels/voice/VoiceHeader.tsx index 618baaa2..ef5bf418 100644 --- a/src/pages/channels/voice/VoiceHeader.tsx +++ b/src/pages/channels/voice/VoiceHeader.tsx @@ -141,20 +141,20 @@ export default observer(({ id }: Props) => { )}
- + } placement={"top"}> {voiceState.isProducing("audio") ? ( - + } placement={"top"}> ) : ( - + } placement={"top"}> ) : ( - + } placement={"top"}> diff --git a/src/pages/discover/Discover.tsx b/src/pages/discover/Discover.tsx index 666daeed..5f456afa 100644 --- a/src/pages/discover/Discover.tsx +++ b/src/pages/discover/Discover.tsx @@ -5,6 +5,8 @@ import styled, { css } from "styled-components/macro"; import { useEffect, useMemo, useRef, useState } from "preact/hooks"; +import { Text } from "preact-i18n"; + import { Header, Preloader } from "@revoltchat/ui"; import { isTouchscreenDevice } from "../../lib/isTouchscreenDevice"; @@ -19,7 +21,6 @@ const Container = styled.div` flex-grow: 1; display: flex; flex-direction: column; - ${() => isTouchscreenDevice ? css` @@ -28,7 +29,6 @@ const Container = styled.div` width: 100%; height: 100%; position: fixed; - padding-bottom: 50px; background: var(--background); ` @@ -39,7 +39,6 @@ const Container = styled.div` const Frame = styled.iframe<{ loaded: boolean }>` border: none; - ${() => !isTouchscreenDevice && css` @@ -47,13 +46,11 @@ const Frame = styled.iframe<{ loaded: boolean }>` border-start-start-radius: 8px; border-end-start-radius: 8px; `} - ${() => isTouchscreenDevice && css` padding-top: 56px; `} - ${(props) => props.loaded ? css` @@ -66,7 +63,6 @@ const Frame = styled.iframe<{ loaded: boolean }>` const Loader = styled.div` flex-grow: 1; - ${() => !isTouchscreenDevice && css` @@ -165,7 +161,7 @@ export default function Discover() { {isTouchscreenDevice && (
- Discover +
)} {!loaded && ( @@ -182,4 +178,4 @@ export default function Discover() { /> ); -} +} \ No newline at end of file diff --git a/src/pages/friends/Friends.tsx b/src/pages/friends/Friends.tsx index e4374a26..b3ad14b2 100644 --- a/src/pages/friends/Friends.tsx +++ b/src/pages/friends/Friends.tsx @@ -78,7 +78,7 @@ export default observer(() => {
*/} - + } placement="bottom"> modalController.push({ @@ -88,7 +88,7 @@ export default observer(() => { - + } placement="bottom"> modalController.push({ diff --git a/src/pages/home/Home.tsx b/src/pages/home/Home.tsx index 75609150..fab6cf2b 100644 --- a/src/pages/home/Home.tsx +++ b/src/pages/home/Home.tsx @@ -182,6 +182,7 @@ export default observer(() => {
+ {/* TODO: TRANSLATE */} {isDecember && ( Turn {seasonalTheme ? "off" : "on"} homescreen diff --git a/src/pages/login/ConfirmDelete.tsx b/src/pages/login/ConfirmDelete.tsx index 37560e11..dc2a77f7 100644 --- a/src/pages/login/ConfirmDelete.tsx +++ b/src/pages/login/ConfirmDelete.tsx @@ -2,6 +2,7 @@ import { Check } from "@styled-icons/boxicons-regular"; import { useParams } from "react-router-dom"; import styled from "styled-components"; +import { Text } from "preact-i18n"; import { useEffect, useState } from "preact/hooks"; import { Modal, Preloader } from "@revoltchat/ui"; @@ -24,20 +25,24 @@ export default function ConfirmDelete() { return ( + } description={ deleted ? ( <> - Your account will be deleted in 7 days. -
- You may contact{" "} + {" "}
- Revolt support + {" "} - to cancel the request if you wish. + ) : ( - "Contacting the server." + ) } nonDismissable> diff --git a/src/pages/login/forms/CaptchaBlock.tsx b/src/pages/login/forms/CaptchaBlock.tsx index c91d75e1..51a7c343 100644 --- a/src/pages/login/forms/CaptchaBlock.tsx +++ b/src/pages/login/forms/CaptchaBlock.tsx @@ -28,7 +28,7 @@ export const CaptchaBlock = observer((props: CaptchaProps) => { return (
-
Are you human?
+
- Audio codec powered by Opus +
); @@ -242,4 +242,4 @@ function changeAudioDevice(deviceId: string, deviceType: string) { } else if (deviceType === "output") { window.localStorage.setItem("audioOutputDevice", deviceId); } -} +} \ No newline at end of file diff --git a/src/pages/settings/panes/Feedback.tsx b/src/pages/settings/panes/Feedback.tsx index 66125beb..4ec7a7b5 100644 --- a/src/pages/settings/panes/Feedback.tsx +++ b/src/pages/settings/panes/Feedback.tsx @@ -54,11 +54,11 @@ export function Feedback() { } - description="You can report issues and discuss improvements with us directly here."> - Join Testers server. + description={}> +
); -} +} \ No newline at end of file diff --git a/src/pages/settings/panes/MyBots.tsx b/src/pages/settings/panes/MyBots.tsx index 03af49c0..9b512984 100644 --- a/src/pages/settings/panes/MyBots.tsx +++ b/src/pages/settings/panes/MyBots.tsx @@ -56,7 +56,6 @@ const BotBadge = styled.div` user-select: none; margin-inline-start: 2px; text-transform: uppercase; - color: var(--accent-contrast); background: var(--accent); border-radius: calc(var(--border-radius) / 2); @@ -521,12 +520,12 @@ export const MyBots = observer(() => {
- By creating a bot, you are agreeing to the {` `} + {" "} - Acceptable Usage Policy + .
@@ -573,4 +572,4 @@ export const MyBots = observer(() => {
); -}); +}); \ No newline at end of file diff --git a/src/pages/settings/panes/Profile.tsx b/src/pages/settings/panes/Profile.tsx index 76f68e37..0298ea9c 100644 --- a/src/pages/settings/panes/Profile.tsx +++ b/src/pages/settings/panes/Profile.tsx @@ -175,12 +175,12 @@ export const Profile = observer(() => {
- Descriptions support Markdown formatting,{" "} + {" "} - learn more here + .
@@ -202,12 +202,12 @@ export const Profile = observer(() => { - Want to change your username?{" "} + {" "} switchPage("account")}> - Head over to your account settings. +
); -}); +}); \ No newline at end of file diff --git a/src/pages/settings/panes/Sessions.tsx b/src/pages/settings/panes/Sessions.tsx index b937686b..0197ee1d 100644 --- a/src/pages/settings/panes/Sessions.tsx +++ b/src/pages/settings/panes/Sessions.tsx @@ -238,7 +238,7 @@ export function Sessions() { icon={} action={"chevron"} description={ - "Logs you out of all sessions except this device." + }>
@@ -254,4 +254,4 @@ export function Sessions() { ); -} +} \ No newline at end of file diff --git a/src/pages/settings/server/Overview.tsx b/src/pages/settings/server/Overview.tsx index 7dc56c39..f4a10119 100644 --- a/src/pages/settings/server/Overview.tsx +++ b/src/pages/settings/server/Overview.tsx @@ -96,12 +96,12 @@ export const Overview = observer(({ server }: Props) => {
- Descriptions support Markdown formatting,{" "} + {" "} - learn more here + .
@@ -186,4 +186,4 @@ export const Overview = observer(({ server }: Props) => {

); -}); +}); \ No newline at end of file