mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
replace t` with msg` to fix labels not being translated correctly
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { Trans, t } from "@lingui/macro"
|
||||
import { Trans, msg } from "@lingui/macro"
|
||||
import { useLingui } from "@lingui/react"
|
||||
import { Anchor, Box, Button, Center, Container, Group, Paper, PasswordInput, Stack, TextInput, Title } from "@mantine/core"
|
||||
import { useForm } from "@mantine/form"
|
||||
import { client, errorToStrings } from "app/client"
|
||||
@@ -13,6 +14,7 @@ import { Link } from "react-router-dom"
|
||||
export function LoginPage() {
|
||||
const serverInfos = useAppSelector(state => state.server.serverInfos)
|
||||
const dispatch = useAppDispatch()
|
||||
const { _ } = useLingui()
|
||||
|
||||
const form = useForm<LoginRequest>({
|
||||
initialValues: {
|
||||
@@ -43,7 +45,7 @@ export function LoginPage() {
|
||||
<Stack>
|
||||
<TextInput
|
||||
label={<Trans>User Name or E-mail</Trans>}
|
||||
placeholder={t`User Name or E-mail`}
|
||||
placeholder={_(msg`User Name or E-mail`)}
|
||||
{...form.getInputProps("name")}
|
||||
description={
|
||||
serverInfos?.demoAccountEnabled ? <Trans>Try out CommaFeed with the demo account: demo/demo</Trans> : ""
|
||||
@@ -54,7 +56,7 @@ export function LoginPage() {
|
||||
/>
|
||||
<PasswordInput
|
||||
label={<Trans>Password</Trans>}
|
||||
placeholder={t`Password`}
|
||||
placeholder={_(msg`Password`)}
|
||||
{...form.getInputProps("password")}
|
||||
size="md"
|
||||
required
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { Trans, t } from "@lingui/macro"
|
||||
import { Trans, msg } from "@lingui/macro"
|
||||
import { useLingui } from "@lingui/react"
|
||||
import { Anchor, Box, Button, Center, Container, Group, Paper, Stack, TextInput, Title } from "@mantine/core"
|
||||
import { useForm } from "@mantine/form"
|
||||
import { client, errorToStrings } from "app/client"
|
||||
@@ -11,6 +12,7 @@ import { Link } from "react-router-dom"
|
||||
|
||||
export function PasswordRecoveryPage() {
|
||||
const [message, setMessage] = useState("")
|
||||
const { _ } = useLingui()
|
||||
|
||||
const form = useForm<PasswordResetRequest>({
|
||||
initialValues: {
|
||||
@@ -20,7 +22,7 @@ export function PasswordRecoveryPage() {
|
||||
|
||||
const recoverPassword = useAsyncCallback(client.user.passwordReset, {
|
||||
onSuccess: () => {
|
||||
setMessage(t`An email has been sent if this address was registered. Check your inbox.`)
|
||||
setMessage(_(msg`An email has been sent if this address was registered. Check your inbox.`))
|
||||
},
|
||||
})
|
||||
|
||||
@@ -54,7 +56,7 @@ export function PasswordRecoveryPage() {
|
||||
<TextInput
|
||||
type="email"
|
||||
label={<Trans>E-mail</Trans>}
|
||||
placeholder={t`E-mail`}
|
||||
placeholder={_(msg`E-mail`)}
|
||||
{...form.getInputProps("email")}
|
||||
size="md"
|
||||
required
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { Trans, t } from "@lingui/macro"
|
||||
import { Trans, msg } from "@lingui/macro"
|
||||
import { useLingui } from "@lingui/react"
|
||||
import { Anchor, Box, Button, Center, Container, Group, Paper, PasswordInput, Stack, TextInput, Title } from "@mantine/core"
|
||||
import { useForm } from "@mantine/form"
|
||||
import { client, errorToStrings } from "app/client"
|
||||
@@ -13,6 +14,7 @@ import { Link } from "react-router-dom"
|
||||
export function RegistrationPage() {
|
||||
const serverInfos = useAppSelector(state => state.server.serverInfos)
|
||||
const dispatch = useAppDispatch()
|
||||
const { _ } = useLingui()
|
||||
|
||||
const form = useForm<RegistrationRequest>({
|
||||
initialValues: {
|
||||
@@ -37,7 +39,7 @@ export function RegistrationPage() {
|
||||
</Title>
|
||||
{serverInfos && !serverInfos.allowRegistrations && (
|
||||
<Box mb="md">
|
||||
<Alert messages={[t`Registrations are closed on this CommaFeed instance`]} />
|
||||
<Alert messages={[_(msg`Registrations are closed on this CommaFeed instance`)]} />
|
||||
</Box>
|
||||
)}
|
||||
{serverInfos?.allowRegistrations && (
|
||||
@@ -54,14 +56,14 @@ export function RegistrationPage() {
|
||||
<TextInput
|
||||
type="email"
|
||||
label={<Trans>E-mail address</Trans>}
|
||||
placeholder={t`E-mail address`}
|
||||
placeholder={_(msg`E-mail address`)}
|
||||
{...form.getInputProps("email")}
|
||||
size="md"
|
||||
required
|
||||
/>
|
||||
<PasswordInput
|
||||
label={<Trans>Password</Trans>}
|
||||
placeholder={t`Password`}
|
||||
placeholder={_(msg`Password`)}
|
||||
{...form.getInputProps("password")}
|
||||
size="md"
|
||||
required
|
||||
|
||||
Reference in New Issue
Block a user