Add localization for teams-related strings in home component
Support for internationalization was added to the account components related to teams. This includes localizing messages prompting a user to create a team which were previously hardcoded. Additionally, `Trans` components from '@kit/ui/trans' has been imported and used to enable this.
This commit is contained in:
@@ -8,6 +8,7 @@ import {
|
|||||||
CardButtonTitle,
|
CardButtonTitle,
|
||||||
} from '@kit/ui/card-button';
|
} from '@kit/ui/card-button';
|
||||||
import { Heading } from '@kit/ui/heading';
|
import { Heading } from '@kit/ui/heading';
|
||||||
|
import { Trans } from '@kit/ui/trans';
|
||||||
|
|
||||||
import { loadUserWorkspace } from '../_lib/server/load-user-workspace';
|
import { loadUserWorkspace } from '../_lib/server/load-user-workspace';
|
||||||
import { HomeAddAccountButton } from './home-add-account-button';
|
import { HomeAddAccountButton } from './home-add-account-button';
|
||||||
@@ -40,13 +41,15 @@ function HomeAccountsListEmptyState() {
|
|||||||
return (
|
return (
|
||||||
<div className="flex flex-col items-center justify-center space-y-8 py-24">
|
<div className="flex flex-col items-center justify-center space-y-8 py-24">
|
||||||
<div className="flex flex-col items-center space-y-1">
|
<div className="flex flex-col items-center space-y-1">
|
||||||
<Heading level={2}>You don't have any teams yet.</Heading>
|
<Heading level={2}>
|
||||||
|
<Trans i18nKey={'account:noTeamsYet'} />
|
||||||
|
</Heading>
|
||||||
|
|
||||||
<Heading
|
<Heading
|
||||||
className="font-sans font-medium text-muted-foreground"
|
className="font-sans font-medium text-muted-foreground"
|
||||||
level={4}
|
level={4}
|
||||||
>
|
>
|
||||||
Create a team to get started.
|
<Trans i18nKey={'account:createTeam'} />
|
||||||
</Heading>
|
</Heading>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import { useState } from 'react';
|
|||||||
|
|
||||||
import { CreateTeamAccountDialog } from '@kit/team-accounts/components';
|
import { CreateTeamAccountDialog } from '@kit/team-accounts/components';
|
||||||
import { Button } from '@kit/ui/button';
|
import { Button } from '@kit/ui/button';
|
||||||
|
import { Trans } from '@kit/ui/trans';
|
||||||
|
|
||||||
export function HomeAddAccountButton() {
|
export function HomeAddAccountButton() {
|
||||||
const [isAddingAccount, setIsAddingAccount] = useState(false);
|
const [isAddingAccount, setIsAddingAccount] = useState(false);
|
||||||
@@ -11,7 +12,7 @@ export function HomeAddAccountButton() {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Button size="sm" onClick={() => setIsAddingAccount(true)}>
|
<Button size="sm" onClick={() => setIsAddingAccount(true)}>
|
||||||
Create a new team
|
<Trans i18nKey={'account:createTeamButtonLabel'} />
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
<CreateTeamAccountDialog
|
<CreateTeamAccountDialog
|
||||||
|
|||||||
@@ -108,5 +108,8 @@
|
|||||||
"needsReauthentication": "Reauthentication Required",
|
"needsReauthentication": "Reauthentication Required",
|
||||||
"needsReauthenticationDescription": "You need to reauthenticate to change your password. Please sign out and sign in again to change your password.",
|
"needsReauthenticationDescription": "You need to reauthenticate to change your password. Please sign out and sign in again to change your password.",
|
||||||
"language": "Language",
|
"language": "Language",
|
||||||
"languageDescription": "Choose your preferred language"
|
"languageDescription": "Choose your preferred language",
|
||||||
|
"noTeamsYet": "You don't have any teams yet.",
|
||||||
|
"createTeam": "Create a team to get started.",
|
||||||
|
"createTeamButtonLabel": "Create a Team"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user