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:
13
build/lang.js
Normal file
13
build/lang.js
Normal 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;
|
||||
};
|
||||
Reference in New Issue
Block a user