Skip to content
Logo

Protobuf-like i18n from plain code

From source code to translated strings, wuchale handles extraction, catalog management, and integration so you can focus on building.

Write plain code

Without any need to do anything different:

<p>Hello world!</p>

Extract and translate

Into PO files and optionally live translate using Gemini

msgid "Hello world!"
msgstr "Hello world!"

Transform

Update your code to access the translations by index

<p>{_w_runtime_.t(0)}</p>

Render

Load the desired compiled catalog, and hand it to your framework

<p>¡Hola Mundo!</p>

Works with your stack!

React Logo
React
Preact Logo
Preact
SolidJS Logo
SolidJS
Svelte Logo
Svelte
JavaScript Logo
JavaScript
TypeScript Logo
TypeScript
Python* Logo
Python*
Golang* Logo
Golang*
INPUT
'use client'
export function Greeting({ username }) {
return (
<div>
<p>Hello!</p>
<p title="Welcome" class="para">
Welcome {username}!
</p>
</div>
)
}
OUTPUT
'use client'
import _w_to_rt_ from 'wuchale/runtime'
import _w_load_rx_, { get as _w_load_ } from "./loader.js"
import W_tx_ from "@wuchale/jsx/runtime.jsx"
export function Greeting({ username }) {
const _w_runtime_ = _w_to_rt_(_w_load_rx_('jsx'))
return (
<div>
<p>{_w_runtime_.t(0)}</p>
<p title={_w_runtime_.t(1)} class="para">
<W_tx_ x={_w_runtime_.cx(2)} a={[username]} />
</p>
</div>
)
}
PO file (for translators)
msgid "Hello!"
msgstr "Hello!"
msgid "Welcome"
msgstr "Welcome"
msgid "Welcome {0}!"
msgstr "Welcome {0}!"
Compiled JS (for runtime)
export let c = [
'Hello!',
'Welcome',
[ 'Welcome ', 0, '!' ],
]
Explore more benefits

Inspiration

This project was inspired by Lingui especially some of its workflow. If you’ve used Lingui before, you’ll find familiar concepts like extraction and compilation.

wuchale takes a different approach: you don’t need to change your code, catalogs compile smaller than any other tool (including Lingui’s), and it integrates with a wider range of frameworks.

Do you also use it in your project? Let us know!