Wuchale is a compile-time internationalization toolkit that requires no alterations to existing code. It automatically extracts and replaces translatable strings during build time, allowing for smooth integration into projects. With optional AI translation and minimal dependencies, wuchale makes internationalization effortless, and provids the smallest, keyless catalogs - something like Protobuf.
wuchale is an innovative compile-time internationalization (i18n) toolkit designed for seamless integration into existing codebases without the need for code modifications. With wuchale, developers can write components in their natural syntax while the toolkit automatically handles the extraction and replacement of translatable strings during the build process.
wuchale ensures functionality without additional annotations.node_modules folder lean.Traditional i18n solutions often necessitate wrapping translatable strings in function calls or components. wuchale simplifies this process:
Traditional Example:
<p>{t('Hello')}</p>
<p><Trans>Welcome {userName}</Trans></p>
With wuchale:
<p>Hello</p>
<p>Welcome {userName}</p>
wuchale can be leveraged in various ways depending on the project structure:
Once configured, components are written naturally:
// src/components/Welcome.jsx
function Welcome({ name }) {
return (
<div>
<h1>Welcome to our app!</h1>
<p>Hello, {name}! How are you today?</p>
<button>Get started</button>
</div>
)
}
Run the following command to automatically extract translatable strings:
npx wuchale
This command generates .po files containing all translatable strings, ready for localization.
wuchale employs static Abstract Syntax Tree (AST) analysis to:
Welcome {userName}, you have {count} messages.<p>Visit our <a href="/help">help page</a> for more info</p>.For further information, including examples and in-depth usage, visit the official documentation at wuchale.dev. Join the community for support and discussion on Discord or explore practical examples at wuchalejs/examples.
Contributions are encouraged, and sponsorship opportunities are available to support ongoing development.
No comments yet.
Sign in to be the first to comment.