improve i18n

This commit is contained in:
pa
2026-01-19 11:49:41 +09:00
parent 7303cd0b33
commit 1e25255ac5
34 changed files with 179 additions and 65 deletions

View File

@@ -3,6 +3,7 @@
import { PaginationEllipsis } from 'reka-ui';
import { cn } from '@/lib/utils';
import { reactiveOmit } from '@vueuse/core';
import { useI18n } from 'vue-i18n';
const props = defineProps({
asChild: { type: Boolean, required: false },
@@ -10,6 +11,8 @@
class: { type: null, required: false }
});
const { t } = useI18n();
const delegatedProps = reactiveOmit(props, 'class');
</script>
@@ -20,7 +23,9 @@
:class="cn('flex size-9 items-center justify-center text-[13px]', props.class)">
<slot>
<MoreHorizontal class="size-4" />
<span class="sr-only">More pages</span>
<span class="sr-only">
{{ t('table.pagination.more_pages') }}
</span>
</slot>
</PaginationEllipsis>
</template>

View File

@@ -4,6 +4,7 @@
import { buttonVariants } from '@/components/ui/button';
import { cn } from '@/lib/utils';
import { reactiveOmit } from '@vueuse/core';
import { useI18n } from 'vue-i18n';
const props = defineProps({
asChild: { type: Boolean, required: false },
@@ -12,6 +13,8 @@
class: { type: null, required: false }
});
const { t } = useI18n();
const delegatedProps = reactiveOmit(props, 'class', 'size');
const forwarded = useForwardProps(delegatedProps);
</script>
@@ -23,7 +26,9 @@
v-bind="forwarded">
<slot>
<ChevronLeftIcon />
<span class="hidden sm:block">First</span>
<span class="hidden sm:block">
{{ t('table.pagination.first') }}
</span>
</slot>
</PaginationFirst>
</template>

View File

@@ -4,6 +4,7 @@
import { buttonVariants } from '@/components/ui/button';
import { cn } from '@/lib/utils';
import { reactiveOmit } from '@vueuse/core';
import { useI18n } from 'vue-i18n';
const props = defineProps({
asChild: { type: Boolean, required: false },
@@ -12,6 +13,8 @@
class: { type: null, required: false }
});
const { t } = useI18n();
const delegatedProps = reactiveOmit(props, 'class', 'size');
const forwarded = useForwardProps(delegatedProps);
</script>
@@ -22,7 +25,9 @@
:class="cn(buttonVariants({ variant: 'ghost', size }), 'text-[13px] gap-1 px-2.5 sm:pr-2.5', props.class)"
v-bind="forwarded">
<slot>
<span class="hidden sm:block">Last</span>
<span class="hidden sm:block">
{{ t('table.pagination.last') }}
</span>
<ChevronRightIcon />
</slot>
</PaginationLast>

View File

@@ -4,6 +4,7 @@
import { buttonVariants } from '@/components/ui/button';
import { cn } from '@/lib/utils';
import { reactiveOmit } from '@vueuse/core';
import { useI18n } from 'vue-i18n';
const props = defineProps({
asChild: { type: Boolean, required: false },
@@ -12,6 +13,8 @@
class: { type: null, required: false }
});
const { t } = useI18n();
const delegatedProps = reactiveOmit(props, 'class', 'size');
const forwarded = useForwardProps(delegatedProps);
</script>
@@ -22,7 +25,9 @@
:class="cn(buttonVariants({ variant: 'ghost', size }), 'text-[13px] gap-1 px-2.5 sm:pr-2.5', props.class)"
v-bind="forwarded">
<slot>
<span class="hidden sm:block">Next</span>
<span class="hidden sm:block">
{{ t('table.pagination.next') }}
</span>
<ChevronRightIcon />
</slot>
</PaginationNext>

View File

@@ -4,6 +4,7 @@
import { buttonVariants } from '@/components/ui/button';
import { cn } from '@/lib/utils';
import { reactiveOmit } from '@vueuse/core';
import { useI18n } from 'vue-i18n';
const props = defineProps({
asChild: { type: Boolean, required: false },
@@ -12,6 +13,8 @@
class: { type: null, required: false }
});
const { t } = useI18n();
const delegatedProps = reactiveOmit(props, 'class', 'size');
const forwarded = useForwardProps(delegatedProps);
</script>
@@ -23,7 +26,9 @@
v-bind="forwarded">
<slot>
<ChevronLeftIcon />
<span class="hidden sm:block">Previous</span>
<span class="hidden sm:block">
{{ t('table.pagination.previous') }}
</span>
</slot>
</PaginationPrev>
</template>