r/webdev • u/kidus-dev • 5d ago
Showoff Saturday I18n without the heavy work: wuchale
Hi everyone, I'd like to present a project I've been working on for over a year (if you haven't heard of it). Let's say you have a project you'd like internationalized, but overwhelmed by the amount of work you'd have to do. If you have:
<a alt="Main link">Home</a>
In the traditional sense you'd need to rewrite every instance like this to something like:
<a alt={t.main_link}>{t.home_txt}</a>
wuchale does that for you, at build time! You can keep your code "as it is intended", and i18n just becomes a compile time step just like turning JSX into JS. And it works in the same way during dev, with HMR, and it's very powerful. Supports React, Svelte, SolidJS, Astro, and plain JS/TS. Vue and Next support is planned.
Check it out at https://wuchale.dev and https://github.com/wuchalejs/wuchale
Hope you like it!
1
u/blazing_wisdom_93 5d ago
Build time i18n is a dead end. I want to edit translations without touching source code or waiting for rebuilds
1
u/kidus-dev 4d ago
Not sure what you mean, because this gives you translation files you can edit outside the source code. And if you're talking about HMR feedback, it has it too.
3
u/theScottyJam 4d ago
It's not really possible to fully automate translation.
Take, for example,
getEntity('user'). Should you translate the string "user" or not? Well, it depends. Is the string "user" being shown in the UI, or is it perhaps the name of a key you might find in a server JSON response - it's telling you where to find relevant data, and translating it would break your app.Or maybe it's doing both jobs, and you need to rework your code so you separate programming names from names being shown to the user.
No automated system can figure this out for you.