Skip to content
parlajsPublic

About

Type-safe i18n for React, Solid, Svelte and Vue: typed messages and loading, lazy per locale, ICU and MessageFormat 2

Topics

Resources

Contributing

Security policy

Stars

2 stars

Watchers

1 watching

Forks

Latest commit

 

History

183 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Parla

Type-safe i18n: one API, per-locale lazy loading, ICU and MessageFormat 2.

Documentation · Showcase · Benchmarks

CI npm version license

Parla (/ˈparla/, "PAR-lah") is Italian for "speaks", from the verb parlare, "to speak".

Status: experimental (0.x).

  • Typed loading: t has only the namespaces you loaded.
  • Params from the message: plurals, selects per branch, rich text.
  • Lazy per locale: one chunk per locale and namespace; switchLocale loads, then switches.
  • ICU and MF2, formatted with Intl: no locale data to ship.
import { checkout } from './parla/namespaces/checkout.js';

const { t } = useParla([checkout]);

t.checkout.title(); // "Checkout"
t.checkout.cart.items({ count: 3 }); // "3 items"; count: number, required
t.checkout.terms({ link: (c) => <a href="/terms">{c}</a> });

Start

pnpm add -D @parlajs/compiler
pnpm parla init   # config, catalogs, .gitignore; prints what is left

Packages

Core

Package Version
@parlajs/core npm Runtime: locale state, loading, Intl
@parlajs/compiler npm CLI and Vite plugin: catalogs → modules

Format adapters

Package Version
@parlajs/format-icu npm ICU, for the compiler's formats
@parlajs/format-mf2 npm MessageFormat 2, likewise

Framework adapters

Package Version
@parlajs/react npm React 19: useParla, useLocale
@parlajs/solid npm Solid 2, likewise
@parlajs/svelte npm Svelte 5, likewise
@parlajs/vue npm Vue 3, likewise

Tooling

Package Version
@parlajs/x18n-plugin npm x18n plugin

Development

pnpm install && pnpm validate

Parla is built with the help of AI coding tools.

License

MIT

About

Type-safe i18n for React, Solid, Svelte and Vue: typed messages and loading, lazy per locale, ICU and MessageFormat 2

Topics

Resources

Contributing

Security policy

Stars

2 stars

Watchers

1 watching

Forks

Releases

Contributors

Languages