mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-11-16 23:04:24 +08:00
feat(i18n): add Russian UI and harden localization
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
'use client';
|
||||
|
||||
import { useTranslations } from 'next-intl';
|
||||
import * as React from 'react';
|
||||
import {
|
||||
ChevronLeftIcon,
|
||||
@@ -9,10 +12,12 @@ import { cn } from '@/lib/utils';
|
||||
import { buttonVariants, type Button } from '@/components/ui/button';
|
||||
|
||||
function Pagination({ className, ...props }: React.ComponentProps<'nav'>) {
|
||||
const uiText = useTranslations('runtime');
|
||||
|
||||
return (
|
||||
<nav
|
||||
role='navigation'
|
||||
aria-label='pagination'
|
||||
aria-label={uiText('ui_pagination')}
|
||||
data-slot='pagination'
|
||||
className={cn('mx-auto flex w-full justify-center', className)}
|
||||
{...props}
|
||||
@@ -69,15 +74,17 @@ function PaginationPrevious({
|
||||
className,
|
||||
...props
|
||||
}: React.ComponentProps<typeof PaginationLink>) {
|
||||
const uiText = useTranslations('runtime');
|
||||
|
||||
return (
|
||||
<PaginationLink
|
||||
aria-label='Go to previous page'
|
||||
aria-label={uiText('ui_previousPage')}
|
||||
size='default'
|
||||
className={cn('gap-1 px-2.5 sm:pl-2.5', className)}
|
||||
{...props}
|
||||
>
|
||||
<ChevronLeftIcon />
|
||||
<span className='hidden sm:block'>Previous</span>
|
||||
<span className='hidden sm:block'>{uiText('ui_previousLabel')}</span>
|
||||
</PaginationLink>
|
||||
);
|
||||
}
|
||||
@@ -86,14 +93,16 @@ function PaginationNext({
|
||||
className,
|
||||
...props
|
||||
}: React.ComponentProps<typeof PaginationLink>) {
|
||||
const uiText = useTranslations('runtime');
|
||||
|
||||
return (
|
||||
<PaginationLink
|
||||
aria-label='Go to next page'
|
||||
aria-label={uiText('ui_nextPage')}
|
||||
size='default'
|
||||
className={cn('gap-1 px-2.5 sm:pr-2.5', className)}
|
||||
{...props}
|
||||
>
|
||||
<span className='hidden sm:block'>Next</span>
|
||||
<span className='hidden sm:block'>{uiText('ui_nextLabel')}</span>
|
||||
<ChevronRightIcon />
|
||||
</PaginationLink>
|
||||
);
|
||||
@@ -103,6 +112,8 @@ function PaginationEllipsis({
|
||||
className,
|
||||
...props
|
||||
}: React.ComponentProps<'span'>) {
|
||||
const uiText = useTranslations('runtime');
|
||||
|
||||
return (
|
||||
<span
|
||||
aria-hidden
|
||||
@@ -111,7 +122,7 @@ function PaginationEllipsis({
|
||||
{...props}
|
||||
>
|
||||
<MoreHorizontalIcon className='size-4' />
|
||||
<span className='sr-only'>More pages</span>
|
||||
<span className='sr-only'>{uiText('ui_morePages')}</span>
|
||||
</span>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user