Skip to content

wuchalejs/examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📜wuchale Examples🪶

This repo contains fully working examples of wuchale, the modern, normal code based internationalization toolkit for JavaScript, TypeScript, and Svelte projects.

Each example demonstrates a different use case and integration strategy — from minimal setups to advanced per-file catalog loading, including server-side support.

🔰 Examples Overview

1. vanilla

Vanilla TS example on StackBlitz

  • Uses only wuchale core and the builtin adapter-vanilla
  • Works directly with the DOM
  • Uses a single catalog per locale

2. react

React example on StackBlitz

  • Shows how to use wuchale in a basic React app
  • Great for client-only React projects
  • Uses a single catalog per locale

3. svelte

Svelte example on StackBlitz

  • Shows how to use wuchale in a basic Svelte app (no routing)
  • Great for client-only Svelte projects
  • Uses a single catalog per locale

4. sveltekit

SvelteKit TS example on StackBlitz

  • Basic SvelteKit integration with locale inside query parameters /?locale=en
  • Supports SSR so it works even without JavaScript
  • Uses a single catalog per locale

5. sveltekit-advanced

Advanced SvelteKit example on StackBlitz

  • Routes directly as URL parameters like /en
  • Supports SSR so it works even without JavaScript
  • Uses multiple adapters and that means multiple catalogs for different parts of the application
  • Some of the adapters divide the compiled catalogs into smaller parts for granular loading
  • Supports server generated messages using the builtin adapter-vanilla
  • Ideal for production-grade apps with large or modular UIs

6. solidjs

SolidJS example on StackBlitz

  • Shows how to use wuchale in a basic SolidJS app
  • Great for client-only SolidJS projects
  • Uses a single catalog per locale

6. server

Server example on StackBlitz

  • Uses the write files functionality to work in the absense of Vite
  • Uses only the builtin vanilla adapter
  • Uses Express as the framework
  • Shows how to use wuchale with server-only projects

🚀 Getting Started

  1. Clone the repo and go to one of the examples.
    git clone https://github.com/wuchalejs/examples.git
    cd examples/sveltekit
  2. Install dependencies
    pnpm install
    # or
    npm install
  3. Start the dev server
    pnpm dev
    # or
    npm run dev

🐦 Follow development

If you find this helpful, give it a ⭐ on GitHub and share your feedback or feature ideas!

About

Examples for using wuchale: Protobuf-like i18n from normal code

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published