Suggested approach for i18n

Hi all,

based on your experience, how would you approach internationalization (i18n) for a full-stack project that needs to display the same contents translated in many different languages?

The project has a Play backend but mostly focused on API without localized content.
The bulk of the localization happens in the scala -> scala.js frontends.

I am familiar with and I quite like gettext, it has a good ecosystem, with tools and editors that can be used by non-coders as well. But I don’t seem to find rock-solid examples or libraries for plugging it effortlessly in Scala; found this and this but I wanted to have a check before taking a decision. Maybe there are overall better alternatives.

Any suggestion?

Thank you in advance,


You would probably want Play’s i18n support, especially Messages and Lang.

As a rule of thumb, JavaScript libraries can usually be used pretty easily from Scala.js. You might have to create a “facade” – a strongly-typed description of the parts of the API that you are using – if one doesn’t already exist, but that’s not terribly hard (especially if you already know the library well), and then you can just use the stuff you already like

But in my case the Play solution would need to be extended also to the frontend code.

I have seen libraries that target the issue, like so I guess it is not straightforward. Or am I wrong?

And what is not clear to me: does the Play solution sits on top of the native Java internationalization mechanism, namely ResourceBundles?

Ok, just for context, gettext is not Javascript, I think it was originally developed in C and it comes with a Java implementation, see Which is fine, I could use that.

But in my case the Play solution would need to be extended also to the frontend code.

In my company, we’ve used quite a lot for that, and it seems to work fine. It basically generates some Javascript code that exposes the same translation data available on the server. I don’t know if there is a Scala.js facade, but it should be trivial to write your own if needed.