Hm... doing a search for "JavaScript gettext", all I was able to find were ways to do it server-side. That would be perfect for Web pages, but for a JavaScript application, that would be
SaaSS. It would also prevent users from downloading and running the application locally (though I don't know how practical that currently is).
I suppose one thing you could do is have a JavaScript file assigning all translatable strings to variables that has to be "compiled" with some sort of script which uses gettext (e.g. Python). So you do that once for each language, save them as e.g. "translations-en.js", and then let the user choose which one to use. That way, you wouldn't have to have the server translate on-demand, there would be no SaaSS elements, and it would not hinder the possibility of running the game on a local machine.