@fernando.mema/sv-wuchale
v0.1.1
Published
<a id="readme-top"></a>
Maintainers
Readme
View Wuchale Docs · Report Bug · Request Feature
About
This addon sets up Wuchale i18n in your SvelteKit project with:
- Multi-locale configuration (10 languages supported)
- Svelte reactive adapter for components
- Vanilla JS adapter for TypeScript files
- AI-powered translation via OpenCode API (DeepSeek V4 Flash)
- Vite plugin integration
- Translation extraction scripts
Installation
npx sv add @fernandomema/sv-wuchaleOptions
| Option | Type | Default | Description |
|--------|------|---------|-------------|
| locales | multiselect | ['en', 'es'] | Locales to support: en, es, ca, pt, fr, de, it, zh, ja, ar |
| adapters | multiselect | ['svelte'] | Adapters: Svelte (reactive) and/or Vanilla JS |
| ai | boolean | true | Enable AI-powered translation via OpenCode |
What It Does
Files Created
| File | Purpose |
|------|---------|
| wuchale.config.js | Wuchale configuration with locales, adapters, and AI settings |
| src/lib/locales/main.loader.svelte.js | Svelte reactive loader (if Svelte adapter selected) |
| src/lib/locales/main.loader.server.svelte.js | Svelte server loader (if Svelte adapter selected) |
| src/lib/locales/js.loader.js | Vanilla JS loader (if Vanilla adapter selected) |
| src/lib/locales/js.loader.server.js | Vanilla JS server loader (if Vanilla adapter selected) |
Files Modified
| File | Changes |
|------|---------|
| .gitignore | Adds .wuchale directory |
| .env | Adds OPENCODE_API_KEY (if AI enabled) |
| .env.example | Adds OPENCODE_API_KEY template |
| vite.config.ts | Adds Wuchale Vite plugin |
| package.json | Adds i18n and i18n:extract scripts |
Environment Variables
| Variable | Description |
|----------|-------------|
| OPENCODE_API_KEY | OpenCode API key for AI translations (if AI enabled) |
Next Steps
After installation:
- Set
OPENCODE_API_KEYin.envfor AI translations - Run
npx wuchaleto extract and translate strings - Use
npx wuchale --extract-onlyto extract without translating - Name your Svelte files with
.svelte.tsextension for automatic string extraction
Contributing
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
License
Distributed under the MIT License. See LICENSE.txt for more information.
Contact
Fernando - @fernandomema
Project Link: https://github.com/fernandomema/sv-addons
Acknowledgments
- Wuchale - i18n framework with AI translations
- OpenCode - AI translation API
- Svelte CLI - Official Svelte tooling
- Best README Template - README template
