feat: i18n user interface (#40306)

Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
This commit is contained in:
Tom
2020-12-16 02:02:52 -06:00
committed by Mrugesh Mohapatra
parent a60a887e63
commit 3978c6be28
149 changed files with 3408 additions and 1084 deletions

View File

@ -1,14 +1,18 @@
const path = require('path');
require('dotenv').config({ path: path.resolve(__dirname, '../.env') });
const supportedLangs = ['chinese', 'english'];
const {
curriculum: curriculumLangs
} = require('../client/i18n/allLangs').availableLangs;
// const supportedLangs = ['chinese', 'english'];
exports.testedLang = function testedLang() {
if (process.env.LOCALE) {
if (supportedLangs.includes(process.env.LOCALE)) {
return process.env.LOCALE;
if (process.env.CURRICULUM_LOCALE) {
if (curriculumLangs.includes(process.env.CURRICULUM_LOCALE)) {
return process.env.CURRICULUM_LOCALE;
} else {
throw Error(`${process.env.LOCALE} is not a supported language.
throw Error(`${process.env.CURRICULUM_LOCALE} is not a supported language.
Before the site can be built, this language needs to be manually approved`);
}
} else {
@ -16,4 +20,4 @@ exports.testedLang = function testedLang() {
}
};
exports.supportedLangs = supportedLangs;
// exports.supportedLangs = supportedLangs;