Loading...
Loading...
svintl CLI for i18n — translations, locales, pluralization, mounts, building typed dictionaries. Triggers on `npx intl`, YAML locale files, intl directories, or any translation/i18n work in Svelte projects.
npx skill4agent add temich/svintl svintl*.yamlbuilt.jstypes.tsnpx intlnpx intl hola # init dictionaries (default: src/lib/intl/)
npx intl hola -p ./custom/path # init at custom path
npx intl add key.path "Value" "context" # add new key (errors if exists), context optional
npx intl add key.path "Value" --debug # optional: print OpenAI request before API call
npx intl set key.path "Updated value" # update existing key
npx intl set key.path "Value" --debug # same (--debug on add/set)
npx intl set "mount/key.path" "Value" # set in mount
npx intl const key.path "Same everywhere" # same value across all locales (no translation)
npx intl unit items.count "item" # pluralized entry (auto-generates plural forms)
npx intl move old.key new.key # rename key/branch
npx intl del key.path # delete key/branch
npx intl create es # new locale (BCP 47 tag, auto-translates)
npx intl destroy es # delete locale
npx intl mount foo ./any/path # create mount
npx intl unmount foo # remove mount (keeps files)
npx intl context "Project description" # set project-wide translation guidance
npx intl context --clear # clear project context
npx intl genders true # enable gender-aware translations
npx intl genders false # disable
npx intl sync en # re-translate all from source (EXPENSIVE — avoid)
npx intl sync en key.path # re-translate specific key
npx intl build # rebuild JS/TS from YAMLnative: English
example:
hello: "Hello world"{$dict.example.hello}!jsnpx intl set greeting "Hello, {name}!" # {name} → function param
npx intl set joined "[names] joined {groupName}" # [names] → Intl.ListFormat!jsintl setnpx intl set greeting '!js (count) => `${count || "No"} item${count === 1 ? "" : "s"}`'{$dict.greeting(user.name)}npx intl unitIntl.PluralRulesnpx intl unit items.count "item"items:
count:
- one: item
other: items{$dict.items.count(count)}fewmanynpx intl genders truegender: 'he' | 'she' | 'none'npx intl mount admin ./src/features/admin/intl
npx intl set "admin/dashboard.title" "Admin Dashboard"{mount}/<script lang="ts">
import { dict, locale } from '$lib/intl'
</script>
<h1>{$dict.example.hello}</h1><script lang="ts">
import { dict } from './intl'
</script>
<h1>{$dict.dashboard.title}</h1>intl/index.tsimport { derived } from 'svelte/store'
import { locale } from '$lib/intl'
import { dictionaries } from './built.js'
import type { Locale, Dictionary } from './types'
const dict = derived(locale, ($locale) => dictionaries[$locale])
export { dict, dictionaries, locale }
export type { Locale, Dictionary }npx intl set app.welcome "Welcome" "greeting shown on homepage"
npx intl context "B2B SaaS for enterprise users"context.yamlnpx intl set/unit/constnpx intl builddict$dict.key.pathnpx intl syncen-USespt-BR