mirror of
https://github.com/GenderDysphoria/GenderDysphoria.fyi.git
synced 2025-01-31 07:16:17 +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 { stripHtml } = require('string-strip-html');
|
||||||
|
|
||||||
const markdownIt = require('markdown-it');
|
const markdownIt = require('markdown-it');
|
||||||
const i18n = require('../lang');
|
const i18n = require('./lang');
|
||||||
|
|
||||||
const mAnchor = require('markdown-it-anchor');
|
const mAnchor = require('markdown-it-anchor');
|
||||||
|
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
|
|
||||||
const languages = {
|
const languages = {};
|
||||||
en: require('./en'),
|
|
||||||
es: require('./es'),
|
|
||||||
};
|
|
||||||
|
|
||||||
module.exports = exports = function (lang, key, ...args) {
|
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 (!entry) entry = languages.en[key];
|
||||||
if (typeof entry === 'function') return entry(...args);
|
if (typeof entry === 'function') return entry(...args);
|
||||||
return entry || key;
|
return entry || key;
|
@ -5,7 +5,7 @@ const { map, uniq } = require('lodash');
|
|||||||
const { resolve, ROOT, TYPE } = require('./resolve');
|
const { resolve, ROOT, TYPE } = require('./resolve');
|
||||||
const { siteInfo } = require(resolve('package.json'));
|
const { siteInfo } = require(resolve('package.json'));
|
||||||
const { minify } = require('html-minifier-terser');
|
const { minify } = require('html-minifier-terser');
|
||||||
const i18n = require('../lang');
|
const i18n = require('./lang');
|
||||||
|
|
||||||
const MINIFY_CONFIG = {
|
const MINIFY_CONFIG = {
|
||||||
conservativeCollapse: true,
|
conservativeCollapse: true,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user