Hacker News new | ask | show | jobs
by m0llusk 1451 days ago
This idea of localization as code has significant history from Perl: https://perldoc.perl.org/Locale::Maketext::TPJ13

Currently Mozilla Fluent seems like a good compromise implementation. The type checking is maybe not as advanced, but it is intended to be compatible with the tools most often used in localization to enable translators to handle all the data and organize the task. Very straightforward getting generated localized strings to agree in number, tense, gender, and so on.

1 comments

That Perl reference was new to me. Very interesting. Never localized my Perl programs back in the day. But of course I should not be surprised that Perl had a solution to any given problem 20+ years ago ...

I like Fluent. It's just that ... when all the power of modern JavaScript/TypeScript (template literals/JSX/validation/custom functions) and code editors (syntax highlighting/JSDoc/references/usages) are already in place, why not use it instead of introducing a whole new layer of tooling?

I have been thinking about generating types from Fluent files. That would give you most benefits that you as developer seek from translations as code, wouldn't it?