mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-11 08:07:26 +02:00
Move references to languages and translated strings out of siteConfig.js into new translation.js module
This commit is contained in:
parent
48916d9f39
commit
099a13a264
9 changed files with 52 additions and 112 deletions
|
@ -9,7 +9,6 @@
|
|||
|
||||
function execute(port) {
|
||||
const translation = require("./translation.js");
|
||||
translation();
|
||||
const CWD = process.cwd();
|
||||
const express = require("express");
|
||||
const React = require("react");
|
||||
|
@ -282,8 +281,8 @@ function execute(port) {
|
|||
const match = regexLang.exec(req.path);
|
||||
const parts = match[1].split("/");
|
||||
const enabledLangTags = [];
|
||||
for (let i = 0; i < siteConfig["languages"].length; i++) {
|
||||
enabledLangTags.push(siteConfig["languages"][i].tag);
|
||||
for (let i = 0; i < translation["languages"].length; i++) {
|
||||
enabledLangTags.push(translation["languages"][i].tag);
|
||||
}
|
||||
for (let i = 0; i < parts.length; i++) {
|
||||
if (enabledLangTags.indexOf(parts[i]) !== -1) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue