/** * Copyright (c) 2017-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. */ const CWD = process.cwd(); const React = require("react"); const fs = require("fs"); const siteConfig = require(CWD + "/siteConfig.js"); const translation = require("../../server/translation.js"); const ENABLE_TRANSLATION = fs.existsSync(CWD + "/languages.js"); const ENABLE_VERSIONING = fs.existsSync(CWD + "/versions.json"); let versions; if (ENABLE_VERSIONING) { versions = require(CWD + "/versions.json"); } require("../../server/readMetadata.js").generateDocsMetadata(); const Metadata = require("../metadata.js"); // language dropdown nav item for when translations are enabled class LanguageDropDown extends React.Component { render() { const enabledLanguages = []; let currentLanguage = "English"; // add all enabled languages to dropdown translation["languages"].map(lang => { if (lang.tag == this.props.language) { currentLanguage = lang.name; } if (lang.tag == this.props.language) { return; } enabledLanguages.push(