Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(v2): setup for i18n staging deployment #4214

Merged
merged 1 commit into from
Feb 11, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 29 additions & 11 deletions website/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,33 @@ const isBootstrapPreset = process.env.DOCUSAURUS_PRESET === 'bootstrap';

const isVersioningDisabled = !!process.env.DISABLE_VERSIONING;

// Special deployment for staging locales until they get enough translations
// https://app.netlify.com/sites/docusaurus-i18n-staging
// https://docusaurus-i18n-staging.netlify.app/
const isI18nStaging = process.env.I18N_STAGING === 'true';

const LocaleConfigs = isI18nStaging
? // Staging locales (https://docusaurus-i18n-staging.netlify.app/)
{
en: {
label: 'English',
},
'zh-CN': {
label: '简体中文',
},
}
: // Production locales
{
en: {
label: 'English',
},
fr: {
label: 'Français',
},
};

/** @type {import('@docusaurus/types').DocusaurusConfig} */
module.exports = {
(module.exports = {
title: 'Docusaurus',
tagline: 'Build optimized websites quickly, focus on your content',
organizationName: 'facebook',
Expand All @@ -52,15 +77,8 @@ module.exports = {
url: 'https://v2.docusaurus.io',
i18n: {
defaultLocale: 'en',
locales: ['en', 'fr'],
localeConfigs: {
en: {
label: 'English',
},
fr: {
label: 'Français',
},
},
locales: Object.keys(LocaleConfigs),
localeConfigs: LocaleConfigs,
},
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',
Expand Down Expand Up @@ -441,4 +459,4 @@ module.exports = {
copyright: `Copyright © ${new Date().getFullYear()} Facebook, Inc. Built with Docusaurus.`,
},
},
};
});