mirror of
https://github.com/GenderDysphoria/GenderDysphoria.fyi.git
synced 2025-01-30 23:06:18 +00:00
Moved the i18n strings into their respective folders
This commit is contained in:
parent
cfd40a85d8
commit
a49d9bf21c
@ -12,7 +12,7 @@ const slugify = require('./lib/slugify');
|
||||
const { stripHtml } = require('string-strip-html');
|
||||
|
||||
const markdownIt = require('markdown-it');
|
||||
const i18n = require('../lang');
|
||||
const i18n = require('./lang');
|
||||
|
||||
const mAnchor = require('markdown-it-anchor');
|
||||
|
||||
|
@ -1,11 +1,12 @@
|
||||
|
||||
const languages = {
|
||||
en: require('./en'),
|
||||
es: require('./es'),
|
||||
};
|
||||
const languages = {};
|
||||
|
||||
module.exports = exports = function (lang, key, ...args) {
|
||||
var entry = languages[lang] && languages[lang][key];
|
||||
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;
|
@ -5,7 +5,7 @@ const { map, uniq } = require('lodash');
|
||||
const { resolve, ROOT, TYPE } = require('./resolve');
|
||||
const { siteInfo } = require(resolve('package.json'));
|
||||
const { minify } = require('html-minifier-terser');
|
||||
const i18n = require('../lang');
|
||||
const i18n = require('./lang');
|
||||
|
||||
const MINIFY_CONFIG = {
|
||||
conservativeCollapse: true,
|
||||
|
Loading…
x
Reference in New Issue
Block a user