mirror of
https://github.com/GenderDysphoria/GenderDysphoria.fyi.git
synced 2025-01-30 23:06:18 +00:00
14 lines
341 B
JavaScript
14 lines
341 B
JavaScript
|
|
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;
|
|
};
|