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

Esp participation #7086

Merged
merged 11 commits into from
Oct 18, 2024
23 changes: 21 additions & 2 deletions apps/site/components/Downloads/Release/ReleaseCodeBox.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';

import { useTranslations } from 'next-intl';
import { useTranslations, useLocale } from 'next-intl';
import { useContext, useEffect, useState } from 'react';
import type { FC } from 'react';

Expand All @@ -13,6 +13,7 @@ const memoizedShiki = shikiPromise.then(highlightToHtml);

const ReleaseCodeBox: FC = () => {
const { platform, os, release } = useContext(ReleaseContext);
const locale = useLocale();

const [code, setCode] = useState('');
const t = useTranslations();
Expand All @@ -28,14 +29,32 @@ const ReleaseCodeBox: FC = () => {
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [release.versionWithPrefix, os, platform]);

const parseVersion = () => {
AugustinMauroy marked this conversation as resolved.
Show resolved Hide resolved
const version = release.versionWithPrefix.replace('v', '');
const versionParts = version.split('.');
return {
major: parseInt(versionParts[0]),
minor: parseInt(versionParts[1]),
patch: parseInt(versionParts[2]),
};
};

const codeLanguage = os === 'WIN' ? 'PowerShell' : 'Bash';

return (
<div className="mb-2 mt-6 flex flex-col gap-2">
AugustinMauroy marked this conversation as resolved.
Show resolved Hide resolved
{parseVersion().major < 18 && (
<div
className="border-danger-400 bg-danger-100 relative rounded border px-4 py-3 text-red-700"
AugustinMauroy marked this conversation as resolved.
Show resolved Hide resolved
role="alert"
>
{t('layouts.download.codeBox.unsupportedVersionWarning')}&nbsp;
<a href={`/${locale}/about/previous-releases/`}>Previous Releases</a>
AugustinMauroy marked this conversation as resolved.
Show resolved Hide resolved
</div>
)}
<CodeBox language={codeLanguage} className="min-h-[15.5rem]">
<code dangerouslySetInnerHTML={{ __html: code }} />
</CodeBox>

<span className="text-center text-xs text-neutral-800 dark:text-neutral-200">
{t('layouts.download.codeBox.communityWarning')}
<br />
Expand Down
4 changes: 4 additions & 0 deletions apps/site/navigation.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
"link": "https://nodejs.org/docs/latest/api/",
"label": "components.containers.navBar.links.docs"
},
"support": {
"link": "https://nodejs.org/en/about/previous-releases",
AugustinMauroy marked this conversation as resolved.
Show resolved Hide resolved
"label": "components.containers.navBar.links.support"
},
"certification": {
"link": "https://training.linuxfoundation.org/openjs/",
"label": "components.containers.navBar.links.certification",
Expand Down
4 changes: 4 additions & 0 deletions apps/site/pages/en/about/previous-releases.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ Production applications should only use _Active LTS_ or _Maintenance LTS_ releas

Full details regarding Node.js release schedule are available [on GitHub](https://github.com/nodejs/release#release-schedule).

### Commercial Support

Commercial support for versions past Maintenance phase is available through our OpenJS Ecosystem Sustainability Program partner [HeroDevs](https://herodevs.com/).

## Looking for latest release of a version branch?

<DownloadReleasesTable />
2 changes: 2 additions & 0 deletions packages/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"about": "About",
"download": "Download",
"docs": "Docs",
"support": "Version Support",
"guides": "Guides",
"learn": "Learn",
"security": "Security",
Expand Down Expand Up @@ -298,6 +299,7 @@
"platform": "Platform"
},
"codeBox": {
"unsupportedVersionWarning": "This version is out of maintenance. Find more information here:",
"fnmEnvSetup": "configure fnm environment",
"systemManagerWarning": "is not a Node.js package manager. Please ensure you already have {packageManager} installed.",
"communityWarning": "Package managers and their installation scripts are not maintained by the Node.js project.",
Expand Down
2 changes: 2 additions & 0 deletions packages/i18n/locales/fr.json
AugustinMauroy marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"about": "À propos",
"download": "Téléchargement",
"docs": "Docs",
"support": "Versions",
"guides": "Guides",
"learn": "Apprendre",
"security": "Sécurité",
Expand Down Expand Up @@ -290,6 +291,7 @@
"platform": "Plateforme"
},
"codeBox": {
"unsupportedVersionWarning": "Cette version n'est plus en maintenance. Trouvez plus d’informations ici:",
"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.",
Expand Down
2 changes: 2 additions & 0 deletions packages/i18n/locales/id.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"about": "Tentang",
"download": "Unduh",
"docs": "Dokumentasi",
"support": "Dukungan Versi",
"guides": "Panduan",
"learn": "Pelajari",
"security": "Keamanan",
Expand Down Expand Up @@ -290,6 +291,7 @@
"platform": "Platform"
},
"codeBox": {
"unsupportedVersionWarning": "Versi ini tidak lagi mendapatkan dukungan. Temukan informasi lebih lanjut di sini:",
"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.",
Expand Down
2 changes: 2 additions & 0 deletions packages/i18n/locales/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"about": "Sobre",
"download": "Descarregar",
"docs": "Documentação",
"support": "Suporte de Versão",
"guides": "Guias",
"learn": "Estudar",
"security": "Segurança",
Expand Down Expand Up @@ -290,6 +291,7 @@
"platform": "Plataforma"
},
"codeBox": {
"unsupportedVersionWarning": "Esta versão não é mais suportada. Encontre mais informações aqui:",
"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.",
Expand Down
2 changes: 2 additions & 0 deletions packages/i18n/locales/uk.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"about": "Про Node.js",
"download": "Завантажити",
"docs": "Документація",
"support": "Підтримка версій",
"guides": "Посібники",
"learn": "Навчання",
"security": "Безпека",
Expand Down Expand Up @@ -290,6 +291,7 @@
"platform": "Платформа"
},
"codeBox": {
"unsupportedVersionWarning": "Ця версія не підтримується. Знайдіть більше інформації тут:",
"fnmEnvSetup": "налаштовує середовище fnm",
"systemManagerWarning": "не є менеджером пакетів Node.js. Переконайтеся, що у вас уже встановлено {packageManager}.",
"communityWarning": "Менеджери пакетів та їхні скрипти встановлення не обслуговуються проєктом Node.js.",
Expand Down
2 changes: 2 additions & 0 deletions packages/i18n/locales/zh-cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"about": "关于",
"download": "下载",
"docs": "文档",
"support": "版本支持",
"guides": "指南",
"learn": "学习",
"security": "安全",
Expand Down Expand Up @@ -290,6 +291,7 @@
"platform": "平台"
},
"codeBox": {
"unsupportedVersionWarning": "此版本已停止维护。在此处查找更多信息:",
"systemManagerWarning": "不是一个 Node.js 包管理器。请确保您已安装好 {packageManager}。",
"communityWarning": "包管理器与它们的安装脚本不由 Node.js 项目维护。",
"communityWarningReport": "如果您遇到问题,请联系包管理器的维护者。"
Expand Down
2 changes: 2 additions & 0 deletions packages/i18n/locales/zh-tw.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"about": "關於",
"download": "下載",
"docs": "文件",
"support": "版本支持",
"guides": "指南",
"learn": "學習資源",
"security": "安全性",
Expand Down Expand Up @@ -290,6 +291,7 @@
"platform": "平台"
},
"codeBox": {
"unsupportedVersionWarning": "此版本已停止維護。請在此處尋找更多資訊:",
"fnmEnvSetup": "設定 fnm 環境",
"systemManagerWarning": "不是 Node.js 的套件管理器。請確保你已安裝 {packageManager}。",
"communityWarning": "套件管理器與其安裝腳本並非由 Node.js 專案維護。",
Expand Down