Skip to content

Commit

Permalink
Merge branch 'nodejs:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
RafaelGSS authored Aug 22, 2024
2 parents 1170f67 + 960a3a8 commit 41e5cf6
Show file tree
Hide file tree
Showing 61 changed files with 3,201 additions and 141 deletions.
57 changes: 43 additions & 14 deletions apps/site/app/sitemap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,59 @@ import {
EXTERNAL_LINKS_SITEMAP,
} from '@/next.constants.mjs';
import { dynamicRouter } from '@/next.dynamic.mjs';
import { availableLocaleCodes } from '@/next.locales.mjs';
import { availableLocaleCodes, defaultLocale } from '@/next.locales.mjs';

// This is the combination of the Application Base URL and Base PATH
const baseUrlAndPath = `${BASE_URL}${BASE_PATH}`;

// This allows us to generate a `sitemap.xml` file dynamically based on the needs of the Node.js Website
// Next.js Sitemap Generation doesn't support `alternate` refs yet
// @see https://github.com/vercel/next.js/discussions/55646
const sitemap = async (): Promise<MetadataRoute.Sitemap> => {
const paths: Array<string> = [];
const routes = await dynamicRouter.getRoutesByLanguage(defaultLocale.code);
const paths = [];

for (const locale of availableLocaleCodes) {
const routes = await dynamicRouter.getRoutesByLanguage(locale);
const currentDate = new Date().toISOString();

paths.push(...routes.map(route => `${baseUrlAndPath}/${locale}/${route}`));
}
for (const route of routes) {
const availableLocalesForRoute = [];

const currentDate = new Date().toISOString();
for (const locale of availableLocaleCodes.filter(
locale => locale !== defaultLocale.code
)) {
const markdownFile = await dynamicRouter.getMarkdownFile(locale, route);
const isAvailable = markdownFile.filename !== '';
if (isAvailable) {
availableLocalesForRoute.push(locale);
}
}

const alternatesPaths = availableLocalesForRoute.reduce(
(acc, locale) => ({
...acc,
[locale]: `${baseUrlAndPath}/${locale}/${route}`,
}),
{}
);

paths.push({
url: `${baseUrlAndPath}/${defaultLocale.code}/${route}`,
lastModified: currentDate,
changeFrequency: 'always' as const,
alternates: {
languages: {
...alternatesPaths,
},
},
});
}

return [...paths, ...EXTERNAL_LINKS_SITEMAP].map(route => ({
url: route,
lastModified: currentDate,
changeFrequency: 'always',
}));
return [
...paths,
...EXTERNAL_LINKS_SITEMAP.map(route => ({
url: route,
lastModified: currentDate,
changeFrequency: 'always' as const,
})),
];
};

export default sitemap;
Expand Down
4 changes: 2 additions & 2 deletions apps/site/i18n/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@
"langDir": "ltr",
"dateFormat": "DD.MM.YYYY",
"hrefLang": "uk",
"enabled": false,
"enabled": true,
"default": false
},
{
Expand Down Expand Up @@ -306,7 +306,7 @@
"langDir": "ltr",
"dateFormat": "YYYY/MM/DD",
"hrefLang": "zh-Hant",
"enabled": false,
"enabled": true,
"default": false
}
]
23 changes: 22 additions & 1 deletion apps/site/i18n/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -290,9 +290,30 @@
"platform": "Plateforme"
},
"codeBox": {
"fnmEnvSetup": "configurer l'environnement fnm",
"systemManagerWarning": "n'est pas un gestionnaire de paquets Node.js. Veuillez vous assurer que {packageManager} est déjà installé.",
"communityWarning": "Les gestionnaires de paquets et leurs scripts d'installation ne sont pas maintenus par le projet Node.js.",
"communityWarningReport": "Si vous rencontrez des problèmes, veuillez contacter les responsables du gestionnaire de paquets."
"communityWarningReport": "Si vous rencontrez des problèmes, veuillez contacter les responsables du gestionnaire de paquets.",
"installsNvm": "installe nvm (Gestionnaire de version node)",
"downloadAndInstallNodejsRestartTerminal": "télécharger et installer Node.js (il peut être nécessaire de redémarrer le terminal)",
"verifiesRightNodejsVersion": "vérifie que la bonne version de Node.js est présente dans l'environnement",
"verifiesRightNpmVersion": "vérifie que la bonne version de npm est présente dans l'environnement",
"shouldPrint": "devrait imprimer `{version}`",
"installsFnm": "installe fnm (Fast Node Manager)",
"downloadAndInstallNodejs": "télécharger et installer Node.js",
"activateFNM": "activer le fnm",
"noteWithColon": "NOTE:",
"dockerIsNotNodejsPackageManager": "Docker n'est pas un gestionnaire de paquets Node.js.",
"PleaseEndureAlreadyInstallOnSystem": "Assurez-vous qu'il est déjà installé sur votre système.",
"dockerInstructions": "Suivez les instructions officielles à l'adresse suivante : https://docs.docker.com/desktop/",
"dockerImagesLink": "Les images Docker sont fournies officiellement à l'adresse https://github.com/nodejs/docker-node/",
"pullsNodejsDockerImage": "tire l'image Docker de Node.js",
"homebrewIsNotNodejsPackageManager": "Homebrew n'est pas un gestionnaire de paquets Node.js.",
"homebrewInstructions": "Suivez les instructions officielles à l'adresse suivante : https://brew.sh/",
"homebrewSupportsIntallingMajorNodejsVersion": "Homebrew ne prend en charge que l'installation des versions majeures de Node.js et peut ne pas prendre en charge la dernière version de Node.js de la ligne de publication {version}.",
"chocolateyIsNotNodejsPackageManager": "Chocolatey n'est pas un gestionnaire de paquets Node.js.",
"chocolateyInstructions": "Suivez les instructions officielles à l'adresse suivante : https://chocolatey.org/",
"chocolateyNotMaintanedByNodejs": "Chocolatey n'est pas officiellement maintenu par le projet Node.js et pourrait ne pas supporter la version {version} de Node.js"
}
}
}
Expand Down
23 changes: 22 additions & 1 deletion apps/site/i18n/locales/id.json
Original file line number Diff line number Diff line change
Expand Up @@ -290,9 +290,30 @@
"platform": "Platform"
},
"codeBox": {
"fnmEnvSetup": "konfigurasikan lingkungan fnm",
"systemManagerWarning": "bukan manajer paket Node.js. Pastikan Anda sudah menginstal {packageManager}.",
"communityWarning": "Package manager dan skrip instalasi tidak di kelola oleh Node.js.",
"communityWarningReport": "Jika kamu mengalami masalah, harap hubungi pengelola pengelola paket."
"communityWarningReport": "Jika kamu mengalami masalah, harap hubungi pengelola pengelola paket.",
"installsNvm": "menginstal nvm (Pengelola Versi Node)",
"downloadAndInstallNodejsRestartTerminal": "unduh dan pasang Node.js (anda mungkin perlu memulai ulang terminal)",
"verifiesRightNodejsVersion": "memastikan versi Node.js yang benar ada di lingkungan",
"verifiesRightNpmVersion": "memastikan versi npm yang benar ada di lingkungan",
"shouldPrint": "seharusnya mencetak `{version}`",
"installsFnm": "menginstal fnm (Pengelola Node Cepat)",
"downloadAndInstallNodejs": "unduh dan pasang Node.js",
"activateFNM": "aktifkan fnm",
"noteWithColon": "CATATAN:",
"dockerIsNotNodejsPackageManager": "Docker bukan pengelola paket Node.js.",
"PleaseEndureAlreadyInstallOnSystem": "Silakan pastikan bahwa ia sudah terpasang di sistem Anda.",
"dockerInstructions": "Ikuti instruksi resmi di https://docs.docker.com/desktop/",
"dockerImagesLink": "Gambar Docker disediakan secara resmi di https://github.com/nodejs/docker-node/",
"pullsNodejsDockerImage": "mengambil gambar Docker Node.js",
"homebrewIsNotNodejsPackageManager": "Homebrew bukan pengelola paket Node.js.",
"homebrewInstructions": "Ikuti instruksi resmi di https://brew.sh/",
"homebrewSupportsIntallingMajorNodejsVersion": "Homebrew hanya mendukung pemasangan versi utama Node.js dan mungkin tidak mendukung versi Node.js terbaru dari jalur rilis {version}.",
"chocolateyIsNotNodejsPackageManager": "Chocolatey bukan pengelola paket Node.js.",
"chocolateyInstructions": "Ikuti instruksi resmi di https://chocolatey.org/",
"chocolateyNotMaintanedByNodejs": "Chocolatey tidak secara resmi dikelola oleh proyek Node.js dan mungkin tidak mendukung versi {version} dari Node.js"
}
}
}
Expand Down
25 changes: 23 additions & 2 deletions apps/site/i18n/locales/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@
},
"search": {
"searchBox": {
"placeholder": "Digitar..."
"placeholder": "Pesquisar..."
},
"seeAll": {
"text": "Ver todos os {count} resultados"
Expand Down Expand Up @@ -290,9 +290,30 @@
"platform": "Plataforma"
},
"codeBox": {
"fnmEnvSetup": "configurar o ambiente da fnm",
"systemManagerWarning": "não é um gestor de pacote da Node.js. Devemos certificar-nos de que já temos {packageManager} instalado.",
"communityWarning": "Os gestores de pacotes e os seus programas de instalação não são mantidos pelo projeto Node.js.",
"communityWarningReport": "Se encontrarmos problemas, devemos dirigir-nos aos responsáveis do gestor de pacote."
"communityWarningReport": "Se encontrarmos problemas, devemos dirigir-nos aos responsáveis do gestor de pacote.",
"installsNvm": "instala a nvm (Node Version Manager, ou Gestor de Pacote de Node)",
"downloadAndInstallNodejsRestartTerminal": "descarregar e instalar a Node.js (podemos precisar de reiniciar o terminal)",
"verifiesRightNodejsVersion": "verifica se a versão correta da Node.js está no ambiente",
"verifiesRightNpmVersion": "verifica se a versão correta da npm está no ambiente",
"shouldPrint": "deve imprimir `{version}`",
"installsFnm": "instala a fnm (Fast Node Manager, ou Gestor Rápido de Node)",
"downloadAndInstallNodejs": "decarregar e instalar a Node.js",
"activateFNM": "ativar a fnm",
"noteWithColon": "NOTA:",
"dockerIsNotNodejsPackageManager": "Docker não é um gestor de pacote da Node.js.",
"PleaseEndureAlreadyInstallOnSystem": "Precisamos de certificar-nos de que já instalada no nosso sistema.",
"dockerInstructions": "Seguir as instruções oficiais em https://docs.docker.com/desktop/",
"dockerImagesLink": "As imagens da Docker são fornecidas oficialmente em https://github.com/nodejs/docker-node/",
"pullsNodejsDockerImage": "puxa a imagem de Docker da Node.js",
"homebrewIsNotNodejsPackageManager": "Homebrew não é um gestor de pacote da Node.js.",
"homebrewInstructions": "Seguir as instruções oficiais em https://brew.sh/",
"homebrewSupportsIntallingMajorNodejsVersion": "Homebrew só suporta instalar versões principais da Node.js e pode não suportar a versão mais recente da Node.js da linha de lançamento {version}.",
"chocolateyIsNotNodejsPackageManager": "Chocolatey não é um gestor de pacote da Node.js.",
"chocolateyInstructions": "Seguir as instruções oficiais em https://chocolatey.org/",
"chocolateyNotMaintanedByNodejs": "Chocolatey não é oficialmente mantida pelo projeto Node.js e pode não suportar a versão {version} da Node.js"
}
}
}
Expand Down
Loading

0 comments on commit 41e5cf6

Please sign in to comment.