Move references to languages and translated strings out of siteConfig.js into new translation.js module

This commit is contained in:
Frank Li 2017-07-11 17:03:27 -07:00
parent 48916d9f39
commit 099a13a264
9 changed files with 52 additions and 112 deletions

View file

@ -11,6 +11,7 @@ const React = require("react");
const HeaderNav = require("./nav/HeaderNav.js");
const Head = require("./Head.js");
const Footer = require(process.cwd() + "/core/Footer.js");
const translation = require("../server/translation.js");
class Site extends React.Component {
/*
@ -48,8 +49,8 @@ class Site extends React.Component {
*/
render() {
const tagline = this.props.config[this.props.language]
? this.props.config[this.props.language]["localized-strings"].tagline
const tagline = translation[this.props.language]
? translation[this.props.language]["localized-strings"].tagline
: this.props.config.tagline;
const title = this.props.title
? this.props.title + " · " + this.props.config.title