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

Moved the i18n strings into their respective folders

This commit is contained in:
Jocelyn Badgley (Twipped)
2021-08-11 13:48:29 -07:00
parent cfd40a85d8
commit a49d9bf21c
5 changed files with 8 additions and 7 deletions

13
build/lang.js Normal file
View File

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