0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-12-16 21:56:25 -05:00

Update docusaurus.config.js

This commit is contained in:
Juan Picado 2024-08-06 19:49:23 +02:00
parent 97947ebb3d
commit c63655b6f2

View file

@ -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,11 +47,7 @@ const filterByProgress = (items) => {
});
};
const i18nConfig = {
defaultLocale: 'en',
locales: isDeployPreview
? ['en']
: filterByProgress([
const locales = filterByProgress([
'en',
'cs-CZ',
'de-DE',
@ -65,7 +63,13 @@ const i18nConfig = {
'yo-NG',
'zh-TW',
'zh-CN',
]),
]);
console.log('locales', locales);
const i18nConfig = {
defaultLocale: 'en',
locales,
localeConfigs: {
en: { label: 'English' },
'it-IT': { label: `Italiano (${progress['it'].translationProgress}%)` },