Hacker News new | ask | show | jobs
by LeviticusMB 1442 days ago
Anyone can learn how to call a function, just like they can learn how to splice a parameter into a string. And translators already have to know basic HTML anyway.

MessageFormat is code. It's just not a very powerful language. And it knows nothing about rich text, just plain strings, which means that you have to deal with manual HTML decoding in the application, ensure all translations are actually producing valid HTML and absolutely not forget to encode all string params that could be user input.

Using tagged template literals and JSX in the translations avoids all those problems.

1 comments

It's a tempting argument. By interviewing hundreds of people a different pattern emerged though. Translators don't know how to code. Some companies manually removed quotation marks (") from strings because they confused translators.

What do you think about Mozilla's Fluent format/syntax https://projectfluent.org/?

BTW feel free to reach out via email to me. Look at my profile to find it.