1
0
mirror of https://github.com/GenderDysphoria/GenderDysphoria.fyi.git synced 2025-11-25 20:42:40 +00:00

Adding more internationalization support

This commit is contained in:
Jocelyn Badgley (Twipped)
2021-08-11 11:23:59 -07:00
parent 84133bd212
commit 59e4380906
10 changed files with 115 additions and 78 deletions

12
lang/index.js Normal file
View File

@@ -0,0 +1,12 @@
const languages = {
en: require('./en'),
es: require('./es'),
};
module.exports = exports = function (lang, key, ...args) {
var entry = languages[lang] && languages[lang][key];
if (!entry) entry = languages.en[key];
if (typeof entry === 'function') return entry(...args);
return entry || key;
};