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