/** * 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 React = require("react"); const siteConfig = require(process.cwd() + "/siteConfig.js"); const translation = require("../../server/translation.js"); class LanguageDropDown extends React.Component { render() { const enabledLanguages = []; let currentLanguage = "English"; translation["languages"].map(lang => { if (lang.tag == this.props.language) { currentLanguage = lang.name; } if (lang.tag == this.props.language) { return; } enabledLanguages.push(
  • {lang.name}
  • ); }); enabledLanguages.push(
  • Help Translate
  • ); if (enabledLanguages.length <= 1) { return null; } return (
  • {currentLanguage}
      {enabledLanguages}