feat: translate gallery

This commit is contained in:
tresabhi committed 2025-01-07 13:00:43 -06:00
1 parent 9de41529d1
commit 6b2dda0f9d
8 files changed
+52 -38

No files matched your search

@@ -3,14 +3,32 @@ import { Callout, Flex } from '@radix-ui/themes';
import { GalleryList, type Avatar } from '../../../../components/Gallery/List';
import { GallerySearch } from '../../../../components/Gallery/Search';
import { PageWrapper } from '../../../../components/PageWrapper';
import { literals } from '../../../../core/i18n/literals';
import {
LocaleProvider,
useLocale,
type LocaleAcceptorProps,
} from '../../../../hooks/useLocale';
import { GalleryEphemeral } from '../../../../stores/galleryEphemeral';
interface PageProps {
interface ContentProps {
avatars: Avatar[];
lastUpdated: string;
}
export function Page({ avatars, lastUpdated }: PageProps) {
type PageProps = ContentProps & LocaleAcceptorProps;
export function Page({ locale, ...props }: PageProps) {
return (
<LocaleProvider locale={locale}>
<Content {...props} />
</LocaleProvider>
);
}
function Content({ avatars, lastUpdated }: ContentProps) {
const { strings } = useLocale();
return (
<PageWrapper maxWidth="80rem" color="gold">
<Flex justify="center">
@@ -18,7 +36,11 @@ export function Page({ avatars, lastUpdated }: PageProps) {
<Callout.Icon>
<CalendarIcon />
</Callout.Icon>
<Callout.Text>Last updated on {lastUpdated}</Callout.Text>
<Callout.Text>
{literals(strings.website.tools.gallery.last_updated, [
lastUpdated,
])}
</Callout.Text>
</Callout.Root>
</Flex>