一键导入
i18n
Bilingual EN/ES system (useI18n, localePath, locale files). Use when adding UI strings, localized routes, or keys in app/locales/*.json.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Bilingual EN/ES system (useI18n, localePath, locale files). Use when adding UI strings, localized routes, or keys in app/locales/*.json.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Global Pinia store (useAppStore) for theme and language with cookie persistence. Use when changing theme or language, or touching app/stores/app.ts.
Create/edit blog articles in EN/ES - frontmatter, collections, images, Markdown features. Use when writing content under content/{en,es}/blog/.
Auto-imported global and content components plus layouts (default/blog). Use when using/creating components or working with ContentRenderer.
Project composables - useBlog, usePageSeo, useEnterAnimations, useBlogScroll, useGsapAnimations. Use when consuming blog/SEO/animation logic.
CSS custom properties, utility classes and theme colors. Use when editing styles, working in app/assets/styles/*, writing <style scoped>, or touching colors, spacing or typography.
Static data - contact.ts, projects.ts, sidebar-items.ts. Use when displaying contact/projects info or adding navigation items.
| name | i18n |
| description | Bilingual EN/ES system (useI18n, localePath, locale files). Use when adding UI strings, localized routes, or keys in app/locales/*.json. |
Bilingual EN/ES system with @nuxtjs/i18n v10. Strategy prefix_except_default.
app/locales/en.json - English translations (base language)app/locales/es.json - Spanish translationsnuxt.config.ts - configuration (i18n: section)/, /about, /projects, /blog, /blog/[slug]/es prefix): /es/, /es/about, /es/projects, /es/blog, /es/blog/[slug]const { t, tm, rt, locale, setLocale } = useI18n()
const localePath = useLocalePath()
const switchLocalePath = useSwitchLocalePath()
// Simple string
t('navigation.items.home') // 'Home'
t('blog.post.author') // 'Author'
// Array or object (returns AST, not strings)
const raw = tm('hero.techStack')
const items = raw.map(item => ({ name: rt(item.name) })) // rt() resolves to a string
// Current locale
locale.value // 'en' | 'es'
// Change language
setLocale('es') // also update appStore.setLanguage('es')
// Localized route
localePath('/about') // '/about' or '/es/about'
localePath('/blog/my-article') // '/blog/my-article' or '/es/blog/my-article'
localePath({ name: 'blog-slug', params: { slug: 'my-slug' } })
// Route to the same content in another language
switchLocalePath('es') // '/es/about' if on '/about'
navigation.* - menu, brand, toggles, social links
errors.* - error messages and actions
seo.* - site SEO, defaults, pages
blog.* - blog section texts (eyebrow, title, post.*, toc.*, pagination.*, nav.*)
footer.* - footer
hero.* - landing page hero
overview.* - overview cards on the landing
about.* - about page
projects.* - projects page
resources.* - resources page
loader.* - loading messages
const { locale } = useI18n()
const { getPosts } = useBlog()
const { data: posts } = await useAsyncData(
() => `blog-index-${locale.value}`,
() => getPosts(),
{ watch: [locale] }
)
<!-- Template -->
<NuxtLink :to="localePath('/blog')">Blog</NuxtLink>
<NuxtLink :to="localePath(`/blog/${post.slug}`)">{{ post.title }}</NuxtLink>
// Script
navigateTo(localePath('/about'))
t()tm() returns AST (not strings); use rt() to resolve each element$router.push('/path') without localePath()setLocale() + appStore.setLanguage() (see the app-store skill)