add translateable strings and allow overriding of english strings (#158)

This commit is contained in:
Ricky Vetter 2017-10-23 15:01:26 -07:00 committed by Joel Marcey
parent 65a5e02ec2
commit 58613545b6
2 changed files with 35 additions and 2 deletions

View file

@ -8,6 +8,15 @@
const React = require("react");
const Marked = require("./Marked.js");
const translate = require("../server/translate.js").translate;
const editThisDoc = translate(
"Edit this Doc|recruitment message asking to edit the doc source"
);
const translateThisDoc = translate(
"Translate this Doc|recruitment message asking to translate the docs"
);
// inner doc component for article itself
class Doc extends React.Component {
render() {
@ -17,7 +26,7 @@ class Doc extends React.Component {
className="edit-page-link button"
href={this.props.config.editUrl + this.props.source}
target="_blank">
Edit this Doc
{editThisDoc}
</a>
);
if (this.props.language != "en") {
@ -31,7 +40,7 @@ class Doc extends React.Component {
this.props.language
}
target="_blank">
Translate this Doc
{translateThisDoc}
</a>
);
}