wuchale  by wuchalejs

Compile-time i18n toolkit for web apps

Created 1 year ago
390 stars

Top 73.3% on SourcePulse

GitHubView on GitHub
1 Expert Loves This Project
Project Summary

<2-3 sentences summarising what the project addresses and solves, the target audience, and the benefit.> wuchale addresses the complexity and overhead of traditional internationalization (i18n) in web applications. It offers a compile-time toolkit that automatically extracts translatable strings from source code without requiring any modifications to existing components or syntax. This approach benefits developers using frameworks like React, Svelte, SolidJS, and Astro by simplifying i18n integration, maintaining codebase cleanliness, and producing exceptionally small translation bundles.

How It Works

The toolkit employs Abstract Syntax Tree (AST) analysis to scan source code and identify translatable text segments, including those within nested markup and complex interpolations. These strings are extracted into standard .po files for translation. During the build process, wuchale compiles these translations into compact JavaScript modules that export simple arrays. The original code is then transformed to reference these translations by index, ensuring a clean developer experience and highly optimized runtime performance with minimal dependencies.

Quick Start & Requirements

  • Primary install / run command: Specific instructions vary by project type; consult the official "Getting Started" guide.
  • Non-default prerequisites and dependencies: Node.js 22+ is required to run the project's test suites.
  • Links: Full working examples for various setups are available at wuchalejs/examples.

Highlighted Details

  • Zero Code Changes: Integrates seamlessly without requiring special imports, components, or annotations in source code.
  • Framework Agnostic: Broad compatibility with React, Preact, Svelte(Kit), SolidJS, Astro, and plain JavaScript/TypeScript.
  • LLM Translation Support: Features configurable integration for automatic, on-the-fly translations.
  • Smart Extraction: Robust AST analysis handles nested markup, conditionals, loops, and complex interpolations.
  • Tiny Footprint: Adds fewer than five additional dependencies to the project.
  • Storage Agnostic: Supports standard PO files by default, with an extensible storage interface.
  • Full URLs Support: Enables internationalization of URLs (e.g., /about to /de/uber-uns).
  • Granular HMR: Provides live, granular Hot Module Replacement during development.

Maintenance & Community

This project is supported by its community and sponsors. Specific community channels (like Discord or Slack) are not detailed in the provided README.

Licensing & Compatibility

The project is licensed under the permissive MIT license, which is generally suitable for commercial use and integration into closed-source projects without significant restrictions.

Limitations & Caveats

Contributors or users verifying the build process locally must use Node.js 22+ due to test suite requirements. While framework-agnostic, detailed setup guidance is project-type specific and found in the "Getting Started" documentation.

Health Check
Last Commit

1 day ago

Responsiveness

Inactive

Pull Requests (30d)
17
Issues (30d)
10
Star History
31 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.