百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
W

wuchale

> 前端框架
开源

编译时 i18n 工具包,不需要修改任何代码,可生成最小的包。支持 React、Svelte、SolidJS、Astro 等

398 stars0 点赞3 次浏览
访问官网GitHub

工具介绍

编译时 i18n 工具包,不需要修改任何代码,可生成最小的包。支持 React、Svelte、SolidJS、Astro 等

wuchale

wuchale (pronounced /wʊtʃɑleɪ/ or wuh-'CHAH-lay) is a compile-time internationalization toolkit that requires no code changes. Write your components naturally, and wuchale automatically extracts and replaces translatable messages at build time.

  • No extra syntax! - Your normal code is enough, your codebase stays clean
  • Tiny catalogs to bundle - Text catalogs are just arrays, no keys necessary, like Protobuf
  • Zero-effort integration - Add i18n to existing projects without rewriting code
  • Framework agnostic - Works with React, Preact, Svelte(Kit), SolidJS, Astro, and plain JS/TS
  • Full URLs support - E.g. /about to /de/uber-uns
  • LLM translation support - Configurable integration for automatic on-the-fly translations
  • Full, granular HMR - Live updates during development, including LLM translation
  • Tiny footprint - Very few (less than 5) additional dependencies, no bloated node_modules
  • Smart extraction - Uses AST analysis to handle nested markup, conditionals, loops, and complex interpolations
  • Storage agnostic - Standard PO files by default, storage interface to store translations anywhere

A taste

With traditional i18n:

svelte

{t('Hello')}

Welcome {userName}

With wuchale:

svelte

Hello

Welcome {userName}

No imports, no special components, no annotations. wuchale handles everything at compile time by analyzing your code and automatically extracting translatable strings.

Getting started

See the Getting Started guide for instructions specific to your project type.

How it works

  1. Scans your source code using AST and identify translatable text content
  2. Extracts strings into standard .po translation files (or custom storage) for translators
  3. Compiles catalogs into compact modules which export arrays
  4. Replaces strings with translation function calls that access messages by indices from the arrays

Your original code stays clean and readable, while the build output is automatically internationalized.

Example

Let's say you have:

javascript
// src/components/Welcome.jsx
function Welcome({ user }) {
  return (
    

  )
}

The messages are extracted into a .po file. for Spanish for example, after translation, it looks like:

po
#~ src/components/Welcome.jsx
msgid "Hello, {0}, and welcome!"
msgstr "Hola, {0}, y ¡bienvenido!"

#~ src/components/Welcome.jsx
msgid "Get started"
msgstr "Comenzar"

Then they are compiled into a compact form optimized for loading (just an array):

javascript
export let c = [[[0, "Hola, ", 0], ", y ¡bienvenido!"], "Comenzar"]

And your code is transformed into a version that accesses them by index:

javascript
// src/components/Welcome.jsx
import W_tx_ from "@wuchale/jsx/runtime.jsx"

function Welcome({ user }) {
  const _w_runtime_ = _w_load_rx_();
  return (
    

  )
}

Notice the automatic handling of the nested ``, that's wuchale's full supported for indefinite nesting at play. You can nest as deep as you want, and it still makes it work for i18n. That gives the translator freedom to even reorder placeholders and it gets rendered accordingly.

Check out full working examples for different setups at wuchalejs/examples to see wuchale in action with different frameworks.

Repository structure

This is a monorepo that houses these packages:

Package Description Latest
wuchale Core + CLI + Vanilla adapter
@wuchale/jsx JSX adapter (for React and SolidJS)
@wuchale/svelte Svelte adapter
@wuchale/astro Astro adapter
@wuchale/json JSON storage

Contributing

Contributions are welcome! Please check out the test suites located inside each package for examples of supported scenarios.

Note: The tests are also written in TypeScript and therefore you should have Node 22+ to run them.

Sponsors

This project is supported by the community. Become a sponsor and get your name or logo listed on the README and the website! Sponsors: Special thanks to our supporters: And one private donor .

License

MIT

Issues· 7 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

TypeScriptai-translationastastrogettext

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类前端框架
定价开源

> 相关工具

R
React
用于构建用户界面的 JavaScript 库
V
Vue.js
渐进式 JavaScript 框架
N
Next.js
基于 React 的全栈 Web 框架