diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js index 1dca647ed..65f054b54 100644 --- a/website/docusaurus.config.js +++ b/website/docusaurus.config.js @@ -18,7 +18,7 @@ const lgnMapping = { const progress = translations; const limitLngIncluded = 80; console.log('limit translation is on %s%', limitLngIncluded); -const isDeployPreview = process.env.CONTEXT === 'deploy-preview'; + const isProductionDeployment = process.env.CONTEXT === 'production'; const filterByProgress = (items) => { const originLng = Object.keys(translations); @@ -32,7 +32,9 @@ const filterByProgress = (items) => { return false; } - if (translations[_lgn].approvalProgress <= limitLngIncluded) { + // console.log('_lgn', _lgn); + // console.log('translations---->', translations[_lgn]); + if (translations[_lgn].translationProgress <= limitLngIncluded) { console.log( 'language %s is being excluded due does not met limit of translation, current: %s%', _lgn, @@ -45,27 +47,29 @@ const filterByProgress = (items) => { }); }; +const locales = filterByProgress([ + 'en', + 'cs-CZ', + 'de-DE', + 'es-ES', + 'fr-FR', + 'it-IT', + 'ga-IE', + 'pl-PL', + 'pt-BR', + 'ru-RU', + 'sr-CS', + 'vi-VN', + 'yo-NG', + 'zh-TW', + 'zh-CN', +]); + +console.log('locales', locales); + const i18nConfig = { defaultLocale: 'en', - locales: isDeployPreview - ? ['en'] - : filterByProgress([ - 'en', - 'cs-CZ', - 'de-DE', - 'es-ES', - 'fr-FR', - 'it-IT', - 'ga-IE', - 'pl-PL', - 'pt-BR', - 'ru-RU', - 'sr-CS', - 'vi-VN', - 'yo-NG', - 'zh-TW', - 'zh-CN', - ]), + locales, localeConfigs: { en: { label: 'English' }, 'it-IT': { label: `Italiano (${progress['it'].translationProgress}%)` },