Enable Translations for docusaurus.io (#548)

There are some translations for Spanish for Docusaurus -- not complete, but still a good start to enable for our site.
I figure it is time to enable all the crucial features that the project provides for its main site, huh? 😄
This commit is contained in:
Joel Marcey 2018-04-12 08:10:41 -07:00 committed by GitHub
parent 2779bf3d0f
commit 4f669ccca2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 70 additions and 58 deletions

View file

@ -10,29 +10,34 @@ const CompLibrary = require("../../core/CompLibrary.js");
const Container = CompLibrary.Container;
const GridBlock = CompLibrary.GridBlock;
const siteConfig = require(process.cwd() + "/siteConfig.js");
const translate = require("../../server/translate.js").translate;
class Help extends React.Component {
render() {
const supportLinks = [
{
title: "Browse the docs",
content:
`Learn more about Docusaurus using the [official documentation](${siteConfig.baseUrl}docs/${this.props.language}/installation.html).`,
title: <translate>Browse the docs</translate>,
content: (
`Learn more about Docusaurus using the [official documentation](${siteConfig.baseUrl}docs/${this.props.language}/installation.html).`
),
},
{
title: "Discord",
content:
"You can join the conversation on [Discord](https://discord.gg/docusaurus) on one of our two text channels: #docusaurus-users for user help and #docusaurus-dev for contributing help."
title: <translate>Discord</translate>,
content: (
"You can join the conversation on [Discord](https://discord.gg/docusaurus) on one of our two text channels: #docusaurus-users for user help and #docusaurus-dev for contributing help."
),
},
{
title: "Twitter",
content:
"You can follow and contact us on [Twitter](https://twitter.com/docusaurus)."
title: <translate>Twitter</translate>,
content: (
"You can follow and contact us on [Twitter](https://twitter.com/docusaurus)."
),
},
{
title: "GitHub",
content:
"At our [GitHub repo](https://github.com/facebook/docusaurus) Browse and submit [issues](https://github.com/facebook/Docusaurus/issues) or [pull requests](https://github.com/facebook/Docusaurus/pulls) for bugs you find or any new features you may want implemented. Be sure to also check out our [contributing information](https://github.com/facebook/Docusaurus/blob/master/CONTRIBUTING.md)."
title: <translate>GitHub</translate>,
content: (
"At our [GitHub repo](https://github.com/facebook/docusaurus) Browse and submit [issues](https://github.com/facebook/Docusaurus/issues) or [pull requests](https://github.com/facebook/Docusaurus/pulls) for bugs you find or any new features you may want implemented. Be sure to also check out our [contributing information](https://github.com/facebook/Docusaurus/blob/master/CONTRIBUTING.md)."
),
}
];
@ -41,10 +46,12 @@ class Help extends React.Component {
<Container className="mainContainer documentContainer postContainer">
<div className="post">
<header className="postHeader">
<h2>Need help?</h2>
<h2><translate>Need help?</translate></h2>
</header>
<p>
If you need help with Docusaurus, you can try one of the mechanisms below.
<translate desc="statement made to reader">
If you need help with Docusaurus, you can try one of the mechanisms below.
</translate>
</p>
<GridBlock contents={supportLinks} layout="fourColumn" />
</div>