All skills
skilld-dev avatar

/vue-i18n-skilld

@b9c39cb

Use when writing or debugging code that imports vue-i18n (Vue 3 internationalization). Covers createI18n, useI18n, message syntax, i18n-t/i18n-n/i18n-d components, pluralization, datetime and number formatting, TypeScript schemas, lazy loading, bundle optimization, and v10/v11/v12 migration.

Use this Skill: https://skilld.dev/gh/skilld-dev/vue-ecosystem-skills/vue-i18n-skilld

This session only. Nothing lands on disk.

referencesformats.md

≈447 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Datetime and number formatting

Formatting wraps Intl.DateTimeFormat and Intl.NumberFormat and re-rends reactively on locale change.

Composer functions

const { d, n } = useI18n()

d(value, key?, locale?)   // value: Date | number
n(value, key?, locale?)   // value: number

Overloads accept a format options object directly: d(date, { dateStyle: 'long' }), n(0.5, { style: 'percent' }).

$d and $n are available in templates when globalInjection: true.

Named formats

Define named option sets per locale:

createI18n({
  legacy: false,
  datetimeFormats: {
    en: { long: { dateStyle: 'long', timeStyle: 'short' } },
    ja: { long: { dateStyle: 'full' } }
  },
  numberFormats: {
    en: { currency: { style: 'currency', currency: 'USD' } },
    ja: { currency: { style: 'currency', currency: 'JPY' } }
  },
  ...
})

Then d(date, 'long') and n(price, 'currency') resolve per active locale. The Composer exposes getDateTimeFormat / setDateTimeFormat / mergeDateTimeFormat and the number equivalents for runtime updates (dist/vue-i18n.d.ts:403-473).

Component usage

<i18n-d :value="date" format="long"> and <i18n-n :value="n" format="currency">; see components.

Part options

Both d and n accept a parts option (true, or an array of part types) so formatting functions return part arrays for custom assembly; supported for $n and $d since v11.1.4 (dist/vue-i18n.d.ts:562, 623).

Fallback behavior

If the key or locale is missing, formatting falls back through fallbackLocale. If no named format matches, the bare Intl default for the locale applies.

Docs: https://vue-i18n.intlify.dev/guide/essentials/datetime.html, https://vue-i18n.intlify.dev/guide/essentials/number.html

Source: SKILL.md on GitHub

No alerts9d3 checks · Risk SAFE
  • Gen Agent Trust Hub9d

    The skill is a comprehensive documentation set for the vue-i18n (Vue 3) internationalization library. It provides correct usage guidelines, migration paths, and security advice regarding XSS prevention when handling HTML in translations. No malicious patterns, obfuscation, or unauthorized access attempts were found.

  • Socket9d

    No alerts

  • Snyk9d

    Risk: LOW · No issues

Signed by skilld at b9c39cb. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub last week.

Activeupdated last week

README badge

README badge for skilld-dev/vue-ecosystem-skills/vue-i18n-skilld