Skip to content

Commit

Permalink
setup for i18n staging deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
slorber committed Feb 11, 2021
1 parent 7f6c4be commit 63b3854
Showing 1 changed file with 29 additions and 11 deletions.
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.`,
},
},
};
});

0 comments on commit 63b3854

Please sign in to comment.