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:
giancarlo
2024-05-13 14:17:25 +07:00
parent c5f255d002
commit f7be3e84f4
3 changed files with 11 additions and 4 deletions

View File

@@ -8,6 +8,7 @@ import {
CardButtonTitle,
} from '@kit/ui/card-button';
import { Heading } from '@kit/ui/heading';
import { Trans } from '@kit/ui/trans';
import { loadUserWorkspace } from '../_lib/server/load-user-workspace';
import { HomeAddAccountButton } from './home-add-account-button';
@@ -40,13 +41,15 @@ function HomeAccountsListEmptyState() {
return (
<div className="flex flex-col items-center justify-center space-y-8 py-24">
<div className="flex flex-col items-center space-y-1">
<Heading level={2}>You don&apos;t have any teams yet.</Heading>
<Heading level={2}>
<Trans i18nKey={'account:noTeamsYet'} />
</Heading>
<Heading
className="font-sans font-medium text-muted-foreground"
level={4}
>
Create a team to get started.
<Trans i18nKey={'account:createTeam'} />
</Heading>
</div>

View File

@@ -4,6 +4,7 @@ import { useState } from 'react';
import { CreateTeamAccountDialog } from '@kit/team-accounts/components';
import { Button } from '@kit/ui/button';
import { Trans } from '@kit/ui/trans';
export function HomeAddAccountButton() {
const [isAddingAccount, setIsAddingAccount] = useState(false);
@@ -11,7 +12,7 @@ export function HomeAddAccountButton() {
return (
<>
<Button size="sm" onClick={() => setIsAddingAccount(true)}>
Create a new team
<Trans i18nKey={'account:createTeamButtonLabel'} />
</Button>
<CreateTeamAccountDialog

View File

@@ -108,5 +108,8 @@
"needsReauthentication": "Reauthentication Required",
"needsReauthenticationDescription": "You need to reauthenticate to change your password. Please sign out and sign in again to change your password.",
"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"
}