ChronicStone/nuxt-ui-tools / skills/consumer/i18n
nuxt-ui-tools-i18n
VerifiedUse this skill when wiring nuxt-ui-tools translations in an app. Covers UiToolsProvider, locale objects, lazy schema text, and how package-owned UI copy differs from schema-owned text.
nuxt-ui-tools I18n
Use this skill for package-consumer tasks involving:
UiToolsProvider- custom
ui-toolslocale objects - Nuxt UI locale syncing
- schema-friendly translation keys with
() => t('...') - translating table and form package surfaces
Read This Skill With
skills/consumer/package/SKILL.mdskills/consumer/table/SKILL.mdskills/consumer/form/SKILL.md
Root Setup
Package-owned ui-tools copy should come from the ui-tools locale layer, not from repeating those strings in every schema.
Typical app shell:
<script setup lang="ts">
import * as locales from '@nuxt/ui/locale'
import * as uiToolsLocales from '#ui-tools/i18n/locales'
const { locale } = useI18n()
</script>
<template>
<UApp :locale="locales[locale]">
<UiToolsProvider :locale="uiToolsLocales[locale]">
<NuxtPage />
</UiToolsProvider>
</UApp>
</template>
If uiToolsLocales[locale] is undefined, ui-tools falls back to English.
Use a custom locale object when you want to override only part of the package copy:
const locale = defineUiToolsLocale({
code: 'fr',
name: 'Français',
messages: {
table: {
footer: {
rowsPerPage: 'Lignes par page',
},
},
},
})
What Belongs In The Provider Locale
Use the provider locale for package-owned UI such as:
- table footer labels
- filter operator labels
- column panel labels
- form action labels and validation messages
- empty states, built-in buttons, and built-in prompts
That copy belongs to the package and should be translated once through the locale object.
What Belongs In Your Schema
Use lazy translation values for schema-owned text such as:
- column labels
- filter labels
- filter placeholders
- preset labels and descriptions
- row action labels
- form field labels, descriptions, and placeholders
- option labels you provide from app data
Preferred pattern:
const { t } = useI18n()
const schema = defineTableSchema({
filters: {
search: {
fields: ['fullName'],
placeholder: () => t('employees.search.placeholder'),
},
ui: (filter) => [
filter.text('fullName', {
label: () => t('employees.filters.name'),
editor: {
placeholder: () => t('employees.filters.searchName'),
},
}),
],
},
table: {
columns: (column) => [
column.field('fullName', {
label: () => t('employees.columns.fullName'),
}),
],
},
})
Important Rule
Do not rebuild the whole schema in computed(() => defineTableSchema(...)) just to make translations reactive.
Instead:
- keep the schema shape stable
- pass lazy text values like
() => t('...') - let
ui-toolsresolve them at render time
Form Example
const { t } = useI18n()
const schema = defineFormSchema({
fields: [
{
key: 'firstName',
type: 'text',
label: () => t('users.fields.firstName.label'),
placeholder: () => t('users.fields.firstName.placeholder'),
},
],
})
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation). | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK). | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |