Board Thread:Code Review/@comment-11733175-20170212225820

I've made a couple of simple functions to work with an object of translations that seem to be fairly standard here. I'd appreciate it if people more familiar with translation fallbacks had any pointers on how to improve that behaviour. I'm also interested in whether people think it should fallback to wgContentLanguage if wgUserLanguage fails on first try.

Otherwise, feel free to use them in your code :)

Sample usage:  var i18n = { en: { x: 'EN' },   'pt': { x: 'PT' }   'zh-hans': { x: 'ZH-HANS' } };

// assuming a user language of zh-hans msg(i18n, x); // ZH-HANS // assuming a user language of pt-br msg(i18n, x); // PT // assuming a user language of de msg(i18n, x); // EN 