Replace harcoded strings to allow translation

This commit is contained in:
Fernando Palomo
2022-09-19 08:08:16 +00:00
parent 6b9106c975
commit b3e114b2bd
9 changed files with 26 additions and 16 deletions

View File

@@ -39,7 +39,7 @@ export default function AccountManagement() {
<CategoryButton <CategoryButton
icon={<Block size={24} color="var(--error)" />} icon={<Block size={24} color="var(--error)" />}
description={ description={
"Disable your account. You won't be able to access it unless you contact support." <Text id="app.settings.pages.account.manage.disable_long" />
} }
action="chevron" action="chevron"
onClick={callback("disable")}> onClick={callback("disable")}>
@@ -49,7 +49,7 @@ export default function AccountManagement() {
<CategoryButton <CategoryButton
icon={<Trash size={24} color="var(--error)" />} icon={<Trash size={24} color="var(--error)" />}
description={ description={
"Your account will be queued for deletion, a confirmation email will be sent." <Text id="app.settings.pages.account.manage.delete_long" />
} }
action="chevron" action="chevron"
onClick={callback("delete")}> onClick={callback("delete")}>

View File

@@ -198,7 +198,15 @@ export default function MultiFactorAuthentication() {
color={!mfa?.totp_mfa ? "var(--error)" : undefined} color={!mfa?.totp_mfa ? "var(--error)" : undefined}
/> />
} }
description={"Set up time-based one-time password."} description={
<Text
id={`app.settings.pages.account.2fa.${
mfa?.recovery_active
? "remove"
: "add"
}_long`}
/>
}
disabled={!mfa || (!mfa.recovery_active && !mfa.totp_mfa)} disabled={!mfa || (!mfa.recovery_active && !mfa.totp_mfa)}
onClick={totpAction}> onClick={totpAction}>
<Text <Text

View File

@@ -5,6 +5,8 @@ import styled, { css } from "styled-components/macro";
import { useEffect, useMemo, useRef, useState } from "preact/hooks"; import { useEffect, useMemo, useRef, useState } from "preact/hooks";
import { Text } from "preact-i18n";
import { Header, Preloader } from "@revoltchat/ui"; import { Header, Preloader } from "@revoltchat/ui";
import { isTouchscreenDevice } from "../../lib/isTouchscreenDevice"; import { isTouchscreenDevice } from "../../lib/isTouchscreenDevice";
@@ -165,7 +167,7 @@ export default function Discover() {
{isTouchscreenDevice && ( {isTouchscreenDevice && (
<Header palette="primary" withTransparency> <Header palette="primary" withTransparency>
<Compass size={27} /> <Compass size={27} />
Discover <Text id="app.navigation.tabs.discover" />
</Header> </Header>
)} )}
{!loaded && ( {!loaded && (

View File

@@ -226,7 +226,7 @@ export function Audio() {
<hr /> <hr />
<div className={styles.opus}> <div className={styles.opus}>
<img height="20" src={opusSVG} draggable={false} /> <img height="20" src={opusSVG} draggable={false} />
Audio codec powered by Opus <Text id="app.settings.pages.audio.audio_codec" />
</div> </div>
</> </>
); );

View File

@@ -54,8 +54,8 @@ export function Feedback() {
<CategoryButton <CategoryButton
action="chevron" action="chevron"
icon={<Group size={24} />} icon={<Group size={24} />}
description="You can report issues and discuss improvements with us directly here."> description={<Text id="app.home.join-testers_desc" />}>
Join Testers server. <Text id="app.home.join-testers_desc" />
</CategoryButton> </CategoryButton>
</a> </a>
</Link> </Link>

View File

@@ -521,12 +521,12 @@ export const MyBots = observer(() => {
<Text id="app.settings.pages.bots.create_bot" /> <Text id="app.settings.pages.bots.create_bot" />
</CategoryButton> </CategoryButton>
<h5> <h5>
By creating a bot, you are agreeing to the {` `} <Text id="app.settings.pages.bots.usage_policy.a" />{" "}
<a <a
href="https://revolt.chat/aup" href="https://revolt.chat/aup"
target="_blank" target="_blank"
rel="noreferrer"> rel="noreferrer">
Acceptable Usage Policy <Text id="app.settings.pages.bots.usage_policy.b" />
</a> </a>
. .
</h5> </h5>

View File

@@ -175,12 +175,12 @@ export const Profile = observer(() => {
<div className={styles.markdown}> <div className={styles.markdown}>
<Markdown size="24" /> <Markdown size="24" />
<h5> <h5>
Descriptions support Markdown formatting,{" "} <Text id="app.settings.tips.markdown.a" />{" "}
<a <a
href="https://developers.revolt.chat/markdown" href="https://developers.revolt.chat/markdown"
target="_blank" target="_blank"
rel="noreferrer"> rel="noreferrer">
learn more here <Text id="app.settings.tips.markdown.b" />
</a> </a>
. .
</h5> </h5>
@@ -202,9 +202,9 @@ export const Profile = observer(() => {
<LineDivider /> <LineDivider />
<Tip> <Tip>
<span> <span>
Want to change your username?{" "} <Text id="app.settings.tips.profile.a" />{" "}
<a onClick={() => switchPage("account")}> <a onClick={() => switchPage("account")}>
Head over to your account settings. <Text id="app.settings.tips.profile.b" />
</a> </a>
</span> </span>
</Tip> </Tip>

View File

@@ -238,7 +238,7 @@ export function Sessions() {
icon={<LogOut size={24} color={"var(--error)"} />} icon={<LogOut size={24} color={"var(--error)"} />}
action={"chevron"} action={"chevron"}
description={ description={
"Logs you out of all sessions except this device." <Text id="app.settings.pages.sessions.logout_long" />
}> }>
<Text id="app.settings.pages.sessions.logout" /> <Text id="app.settings.pages.sessions.logout" />
</CategoryButton> </CategoryButton>

View File

@@ -96,12 +96,12 @@ export const Overview = observer(({ server }: Props) => {
<div className={styles.markdown}> <div className={styles.markdown}>
<Markdown size="24" /> <Markdown size="24" />
<h5> <h5>
Descriptions support Markdown formatting,{" "} <Text id="app.settings.tips.markdown.a" />{" "}
<a <a
href="https://developers.revolt.chat/markdown" href="https://developers.revolt.chat/markdown"
target="_blank" target="_blank"
rel="noreferrer"> rel="noreferrer">
learn more here <Text id="app.settings.tips.markdown.b" />
</a> </a>
. .
</h5> </h5>