From 7e0b40c49a369b878655e6336d823c907b468981 Mon Sep 17 00:00:00 2001 From: George Adams Date: Fri, 6 Nov 2026 14:57:50 +0000 Subject: [PATCH 1/2] Modernize pages and localize shared UI Refresh product, community, news and statistics layouts, tidy release notes, and translate navigation and calls to action across supported locales. Preserve forms and downloads, and stabilize statistics tab navigation and loading layouts. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- locales/de.json | 245 ++++ locales/en.json | 245 ++++ locales/es.json | 245 ++++ locales/fr.json | 245 ++++ locales/ja.json | 245 ++++ locales/pt-BR.json | 245 ++++ locales/zh-CN.json | 245 ++++ .../__snapshots__/page.test.tsx.snap | 6 +- .../BecomeSustainerClient.tsx | 97 +- .../__tests__/BecomeSustainerClient.test.tsx | 69 + .../__snapshots__/page.test.tsx.snap | 227 +++- .../__snapshots__/page.test.tsx.snap | 1124 +++++++++++++++-- .../business-benefits/__tests__/page.test.tsx | 135 +- src/app/[locale]/business-benefits/page.tsx | 85 +- .../__snapshots__/page.test.tsx.snap | 360 +++--- src/app/[locale]/events/page.tsx | 57 +- .../__snapshots__/page.test.tsx.snap | 238 +++- src/app/[locale]/join/__tests__/page.test.tsx | 114 +- src/app/[locale]/join/page.tsx | 101 +- .../__snapshots__/page.test.tsx.snap | 75 +- src/app/[locale]/news/__tests__/page.test.tsx | 15 +- .../__snapshots__/page.test.tsx.snap | 105 +- .../author/[author]/__tests__/page.test.tsx | 11 + .../[locale]/news/author/[author]/page.tsx | 10 +- .../__snapshots__/page.test.tsx.snap | 109 +- .../page/[page]/__tests__/page.test.tsx | 11 + .../news/author/[author]/page/[page]/page.tsx | 10 +- src/app/[locale]/news/page.tsx | 12 +- .../__snapshots__/page.test.tsx.snap | 75 +- .../news/page/[page]/__tests__/page.test.tsx | 15 +- src/app/[locale]/news/page/[page]/page.tsx | 12 +- .../__snapshots__/page.test.tsx.snap | 107 +- .../news/tag/[tag]/__tests__/page.test.tsx | 18 +- src/app/[locale]/news/tag/[tag]/page.tsx | 12 +- .../__snapshots__/page.test.tsx.snap | 111 +- .../[tag]/page/[page]/__tests__/page.test.tsx | 18 +- .../news/tag/[tag]/page/[page]/page.tsx | 12 +- .../__snapshots__/page.test.tsx.snap | 214 ++-- src/app/[locale]/slack/page.tsx | 84 +- .../[locale]/stats/__tests__/layout.test.tsx | 36 + src/app/[locale]/stats/download/page.tsx | 81 +- src/app/[locale]/stats/layout.tsx | 26 + .../trends/__tests__/trends-client.test.tsx | 127 ++ .../[locale]/stats/trends/trends-client.tsx | 873 ++++++++----- .../__snapshots__/page.test.tsx.snap | 360 +++--- src/app/[locale]/supported-platforms/page.tsx | 58 +- .../__snapshots__/page.test.tsx.snap | 704 ++++++----- .../[locale]/temurin/__tests__/page.test.tsx | 10 + .../nightly/TemurinNightlyPageClient.tsx | 121 +- .../__snapshots__/page.test.tsx.snap | 422 +++---- src/app/[locale]/temurin/page.tsx | 44 +- .../release-notes/ReleaseNotesPageClient.tsx | 73 +- .../__snapshots__/page.test.tsx.snap | 75 +- .../release-notes/__tests__/page.test.tsx | 60 +- .../[locale]/temurin/release-notes/page.tsx | 8 +- .../__tests__/UsingTemurin.test.tsx | 51 +- .../__snapshots__/UsingTemurin.test.tsx.snap | 155 ++- src/components/About/UsingTemurin/index.tsx | 72 +- .../Middle/__tests__/BannerMiddle.test.tsx | 42 + src/components/Banner/Middle/announcements.ts | 4 + src/components/Banner/Middle/index.tsx | 24 +- .../__tests__/ReleaseNotesRender.test.tsx | 59 +- .../ReleaseNotesRender.test.tsx.snap | 242 ++-- src/components/Content/ReleaseNotes/index.tsx | 139 +- .../Content/ReleaseNotes/styles.css | 197 +-- .../ReleaseNotesVersionSelector.test.tsx | 30 +- .../ReleaseNotesVersionSelector/index.tsx | 168 +-- .../Contributors/__tests__/home.test.tsx | 33 + src/components/Contributors/home.tsx | 2 +- .../__snapshots__/index.test.tsx.snap | 15 +- .../Dashboard/Nav/__tests__/index.test.tsx | 59 +- src/components/Dashboard/Nav/index.tsx | 61 +- src/components/Download/GuideCard/index.tsx | 107 +- .../Calendar/__tests__/Calendar.test.tsx | 68 +- .../__snapshots__/Calendar.test.tsx.snap | 187 ++- src/components/Events/Calendar/index.tsx | 108 +- .../Events/EventCard/__tests__/index.test.tsx | 11 +- src/components/Events/EventCard/index.tsx | 8 +- .../Events/Timeline/ClientPagination.tsx | 131 +- .../__tests__/ClientPagination.test.tsx | 100 +- .../__snapshots__/timeline.test.tsx.snap | 334 +++-- .../Timeline/__tests__/timeline.test.tsx | 95 +- src/components/Events/Timeline/index.tsx | 224 ++-- .../NavBar/__tests__/NavBar.test.tsx | 54 + .../__snapshots__/NavBar.test.tsx.snap | 8 +- src/components/NavBar/index.tsx | 45 +- .../NewsCardList/__tests__/index.test.tsx | 22 +- src/components/News/NewsCardList/index.tsx | 49 +- .../NewsEmptyState/__tests__/index.test.tsx | 14 +- src/components/News/NewsEmptyState/index.tsx | 21 +- .../News/NewsFilters/FilterSelect/index.tsx | 22 +- .../__tests__/NewsFilters.test.tsx | 58 + src/components/News/NewsFilters/index.tsx | 113 +- .../Pagination/__tests__/Pagination.test.tsx | 12 +- src/components/News/Pagination/index.tsx | 29 +- .../PowerOfTemurin.test.tsx.snap | 332 ++--- src/components/PowerOfTemurin/index.tsx | 63 +- .../__tests__/PlatformMatrix.test.tsx | 15 +- .../Support/PlatformMatrix/index.tsx | 436 +++---- .../TemurinNightlyTable.test.tsx.snap | 5 +- src/components/Temurin/NightlyTable/index.tsx | 7 +- .../Temurin/NightlyVersionSelector/index.tsx | 138 +- 102 files changed, 8270 insertions(+), 4341 deletions(-) create mode 100644 src/app/[locale]/become-a-sustainer/__tests__/BecomeSustainerClient.test.tsx create mode 100644 src/app/[locale]/stats/__tests__/layout.test.tsx create mode 100644 src/app/[locale]/stats/layout.tsx create mode 100644 src/app/[locale]/stats/trends/__tests__/trends-client.test.tsx create mode 100644 src/components/Contributors/__tests__/home.test.tsx create mode 100644 src/components/News/NewsFilters/__tests__/NewsFilters.test.tsx diff --git a/locales/de.json b/locales/de.json index 4c8910cd..04e82521 100644 --- a/locales/de.json +++ b/locales/de.json @@ -40,6 +40,99 @@ "title": "Entschuldigung, wir konnten diese Seite nicht finden", "back-to-home": "Zurück zur Startseite" }, + "BusinessBenefits": { + "support": { + "title": "Benötigen Sie Hilfe mit Temurin?", + "description": "Eclipse Temurin wird von einer engagierten Community aus Entwicklern und Anwendern unterstützt. Wenn Sie Hilfe benötigen, kontaktieren Sie uns.", + "cta": "Hilfe erhalten" + }, + "contact": { + "title": "Erfahren Sie, wie Temurin Ihrem Unternehmen helfen kann", + "description": "Möchten Sie mitmachen? Füllen Sie unser Mitgliedschaftsformular aus und gestalten Sie die Zukunft von Adoptium mit.", + "cta": "Kontakt" + }, + "usage": { + "title": "Wie andere Unternehmen Temurin nutzen", + "description": "Erfahren Sie, wie führende Unternehmen Temurin einsetzen, um die Leistung zu verbessern und Innovationen in ihren Entwicklungsprozessen voranzutreiben." + }, + "adopters": { + "title": "Unternehmen, die Eclipse Temurin® nutzen", + "description": "Unternehmen, die Eclipse Temurin im Produktivbetrieb einsetzen." + }, + "header": { + "title": "Wie Eclipse Temurin® Ihrem Unternehmen helfen kann", + "subtitle": "Vorteile für Unternehmen", + "description": "Eclipse Temurin bietet leistungsstarke, plattformübergreifende Open-Source-Java-Laufzeitumgebungen, die für den Unternehmenseinsatz geeignet und mit dem Java SE TCK für die allgemeine Nutzung im Java-Ökosystem getestet sind.", + "contact": "Kontakt" + } + }, + "JoinPage": { + "title": "Der Arbeitsgruppe beitreten", + "subtitle": "Treten Sie der Eclipse Adoptium®-Arbeitsgruppe bei", + "form-title": "Kontakt aufnehmen", + "form-description": "Erzählen Sie uns von Ihrer Organisation und wie Sie sich bei Eclipse Adoptium engagieren möchten.", + "options-title": "Möglichkeiten zum Mitmachen", + "options-description": "Erfahren Sie mehr über Mitgliedschaft, Förderung und Beiträge zu unseren Projekten." + }, + "SupportingAnnouncement": { + "brand": "ECLIPSE ADOPTIUM", + "member": { + "title": "Werden Sie Adoptium-Mitglied", + "description": "Treten Sie der Adoptium-Arbeitsgruppe bei und unterstützen Sie die Zukunft von Open-Source-Java. Entdecken Sie unsere Mitgliedschaftsoptionen und Vorteile.", + "cta": "Mehr erfahren" + }, + "sustainer": { + "title": "Werden Sie Unterstützer", + "description": "Unterstützen Sie Eclipse Temurin, das am schnellsten wachsende Open-Source-JDK, über das Sustainer-Programm. Ihr Beitrag fördert stärkere Sicherheit, schnellere Veröffentlichungen, einsatzbereite Builds, Qualitätstests und die Weiterentwicklung der Community.", + "cta": "Mehr erfahren" + }, + "bloomberg": { + "title": "Fallstudie: Bloombergs Wechsel zu Open-Source-Java", + "description": "Erfahren Sie, wie Eclipse Temurin die globale Finanzinfrastruktur unterstützt.", + "cta": "Fallstudie lesen" + } + }, + "NavBar": { + "Join Us": "Mitmachen", + "Become a Member": "Mitglied werden", + "Our Members": "Unsere Mitglieder", + "Become an Individual Sustainer": "Als Privatperson unterstützen", + "Become a Corporate Sustainer": "Als Unternehmen unterstützen", + "Our Sustainers": "Unsere Unterstützer", + "Contribute to Adoptium": "Zu Adoptium beitragen", + "Become an Adopter": "Nutzung bekannt machen", + "Our Adopters": "Unsere Anwender", + "Latest Releases": "Aktuelle Versionen", + "Marketplace": "Marketplace", + "Projects": "Projekte", + "What We Do": "Was wir tun", + "Eclipse Temurin": "Eclipse Temurin", + "Eclipse AQAvit": "Eclipse AQAvit", + "Eclipse Mission Control": "Eclipse Mission Control", + "Eclipse Migration Toolkit": "Eclipse Migration Toolkit", + "Resources": "Ressourcen", + "Status": "Dienststatus", + "Release Notes": "Versionshinweise", + "Installation Guide": "Installationsanleitung", + "Documentation": "Dokumentation", + "FAQs": "Häufige Fragen", + "Brand & Promotion": "Marke und Öffentlichkeitsarbeit", + "Community": "Community", + "Support": "Hilfe", + "News": "Neuigkeiten", + "Events": "Veranstaltungen", + "Slack": "Slack", + "Membership": "Mitgliedschaft", + "Sponsorship": "Förderung", + "Contribute": "Beitragen", + "Adopt": "Einsetzen", + "Join Us Overview": "Mitmachen im Überblick", + "Global": "Hauptnavigation", + "Adoptium Logo": "Adoptium-Logo", + "notifications": "Benachrichtigungen", + "Open main menu": "Hauptmenü öffnen", + "Close menu": "Menü schließen" + }, "WhatWeDo": { "mission": "Offenes Java, gemeinsam entwickelt", "community": "Zusammenarbeit aus der Community", @@ -121,6 +214,7 @@ } }, "RandomContributors": { + "become-contributor": "Mitwirken", "thank-you": "Danke an unsere 300+ Mitwirkenden", "thank-you-mobile": "Danke an unsere 300+ Mitwirkenden" }, @@ -328,5 +422,156 @@ }, "Byline": { "reading-time": "{minutes} Min. Lesezeit" + }, + "ModernPages": { + "common": { + "learn-more": "Mehr erfahren", + "loading": "Wird geladen…", + "all": "Alle", + "previous": "Zurück", + "next": "Weiter" + }, + "temurin": { + "resources-title": "Erste Schritte mit Temurin", + "resources-description": "Installieren Sie Temurin, erkunden Sie die Dokumentation oder helfen Sie, das Projekt langfristig zu sichern.", + "install-description": "Hier finden Sie Installationsanleitungen für Ihr Betriebssystem und Ihre Entwicklungswerkzeuge.", + "docs-description": "Entdecken Sie Anleitungen zur Konfiguration und Nutzung von Eclipse Temurin.", + "sponsor-title": "Unterstützen Sie das Projekt", + "sponsor-description": "Beiträge finanzieren die Infrastruktur und die Community hinter Eclipse Temurin.", + "contact-title": "Setzen Sie Temurin in Ihrem Unternehmen ein", + "contact-description": "Entdecken Sie mit unserer Community Möglichkeiten zur Kostensenkung, kommerziellen Support und Sicherheit in der Softwarelieferkette.", + "contact": "Kontaktieren Sie uns", + "community": "Sprechen Sie mit der Community" + }, + "platforms": { + "title": "Unterstützte Plattformen", + "description": "Informieren Sie sich über die Betriebssystemkompatibilität der neuesten Eclipse Temurin-Versionen.", + "intro": "Klappen Sie ein Betriebssystem auf, um JDK-Versionen und die Verfügbarkeit von Docker zu vergleichen.", + "supported": "Unterstützt", + "unsupported": "Nicht unterstützt", + "docker": "Docker verfügbar", + "community-title": "Brauchen Sie Hilfe bei der Plattformwahl?", + "community-description": "Besprechen Sie Ihre Umgebung mit der Adoptium-Community.", + "community-cta": "Diskutieren Sie mit" + }, + "sustainer": { + "title": "Werden Sie Unternehmensförderer", + "subtitle": "Unterstützen Sie Eclipse Temurin", + "description": "Helfen Sie, die Infrastruktur, Tests und Bereitstellung zu sichern, die Eclipse Temurin für alle zugänglich machen.", + "form-title": "Kommen Sie mit uns ins Gespräch", + "form-description": "Erzählen Sie uns von Ihrer Organisation. Unser Team hilft Ihnen, die passende Unterstützungsmöglichkeit für Temurin zu finden.", + "thanks-title": "Vielen Dank für Ihre Unterstützung", + "thanks-description": "Wir haben Ihre Anfrage erhalten. Unser Team wird sich zum Thema Unternehmensförderung bei Ihnen melden.", + "options-title": "Entdecken Sie Ihre Möglichkeiten", + "options-description": "Erfahren Sie mehr über Vorteile für Förderer, die Mitgliedschaft und weitere Möglichkeiten zur Beteiligung." + }, + "slack": { + "title": "Diskutieren Sie mit", + "subtitle": "Adoptium-Community", + "description": "Vernetzen Sie sich auf Slack mit Nutzern, Mitwirkenden und Verantwortlichen von Eclipse Adoptium.", + "card-title": "Eine Community rund um Open-Source-Java", + "card-description": "Stellen Sie Fragen, teilen Sie Ihre Erfahrungen und arbeiten Sie an Eclipse Temurin und anderen Adoptium-Projekten mit.", + "cta": "Slack beitreten", + "hint": "Öffnet die Einladung zum Adoptium-Slack in einem neuen Tab.", + "support": "Suchen Sie Hilfe zu Temurin?", + "support-description": "Entdecken Sie Hilfsangebote der Community und kommerzielle Supportmöglichkeiten.", + "support-cta": "Support erhalten" + }, + "events": { + "title": "Lernen Sie die Community kennen", + "subtitle": "Veranstaltungen & Community", + "description": "Finden Sie Community-Treffen von Adoptium und Veranstaltungen der Eclipse Foundation – online und weltweit.", + "upcoming": "Veranstaltungen der Eclipse Foundation", + "calendar-title": "Kalender der Adoptium-Community", + "calendar-description": "Bleiben Sie über Community-Treffen informiert, lernen Sie andere Mitwirkende kennen und stellen Sie Ihre laufenden Arbeiten vor.", + "view-calendar": "Kalender ansehen", + "subscribe": "iCal abonnieren", + "calendar-hint": "Community-Treffen, Besprechungen zu Sicherheit, AQAvit und der Website, Veröffentlichungstermine und weitere Online-Treffen.", + "all-events": "Alle Veranstaltungen der Eclipse Foundation ansehen", + "submit": "Veranstaltung einreichen", + "empty": "Derzeit sind keine Veranstaltungen verfügbar. Community-Treffen finden Sie im Kalender." + }, + "news": { + "title": "Neuigkeiten & Updates", + "subtitle": "Aus der Adoptium-Community", + "description": "Projektankündigungen, Neuigkeiten zu Veröffentlichungen und Beiträge aus dem Java-Ökosystem.", + "filters": "Entdecken Sie die neuesten Beiträge", + "sources": "Alle Quellen", + "tags": "Alle Schlagwörter", + "authors": "Alle Autoren", + "remove-tag": "Schlagwort entfernen: {tag}", + "read-more": "Weiterlesen", + "read-article": "Artikel lesen", + "tag-title": "Beiträge mit dem Schlagwort {tag}", + "tag": "Schlagwort", + "source": "Quelle", + "author": "Autor", + "submit": "Neuigkeit einreichen", + "empty": "Keine Beiträge entsprechen Ihren Filtern.", + "empty-description": "Versuchen Sie, Ihre Filter anzupassen oder zurückzusetzen.", + "no-results": "Keine Ergebnisse gefunden" + }, + "stats": { + "title": "Adoptium-Downloadstatistiken", + "subtitle": "Projekteinblicke", + "description": "Erkunden Sie Eclipse Temurin-Downloads und Docker-Pulls nach Version und Plattform.", + "trends-title": "Downloadtrends", + "trends-description": "Vergleichen Sie Downloads und Docker-Pulls im Zeitverlauf.", + "downloads": "Downloads", + "trends": "Trends", + "total": "Downloads insgesamt", + "github": "GitHub-Downloads", + "docker": "Docker-Pulls", + "popular": "Beliebteste JDK-Versionen", + "github-version": "GitHub-Downloads nach Version", + "daily": "Tägliche Downloads", + "monthly": "Monatliche Downloads", + "version": "JDK-Version", + "source": "Quelle", + "visible": "Datenreihen anzeigen", + "type": "Typ", + "days": "Tage", + "series": "Datenreihe {number}", + "daily-label": "Täglich", + "monthly-label": "Monatlich", + "total-label": "Gesamt", + "docker-note": "Die Filter für JDK-Versionen berücksichtigen keine Ergebnisse aus dem offiziellen Docker-Repository.", + "by-source": "Downloads nach Quelle", + "drilldown": "Downloads nach Veröffentlichung erkunden" + }, + "release-notes": { + "description": "Entdecken Sie Änderungen, Fehlerbehebungen und Verbesserungen in Eclipse Temurin-Versionen.", + "lts": "Langzeitunterstützung", + "features": "Funktionsversionen", + "back": "Alle Versionen", + "loading": "Versionshinweise werden geladen…", + "filters": "Änderungen filtern", + "export": "CSV exportieren", + "rows": "Zeilen pro Seite", + "priority": "Priorität", + "type": "Typ", + "component": "Komponente", + "issue": "Problem", + "summary": "Zusammenfassung", + "all-priorities": "Alle Prioritäten", + "all-types": "Alle Typen", + "all-components": "Alle Komponenten", + "empty": "Keine Änderungen entsprechen diesen Filtern.", + "results": "{count} Änderungen", + "page": "Seite {page} von {total}", + "p1": "{count} kritische Probleme", + "sort": "Nach Priorität sortieren", + "view": "Versionshinweise ansehen", + "hidden": "Nicht öffentlich einsehbar", + "priority-1": "Blockiert die Entwicklung oder Tests; der Produktivbetrieb ist nicht möglich.", + "priority-2": "Abstürze, Datenverlust oder schwerwiegende Speicherlecks.", + "priority-3": "Erhebliche Funktionseinschränkung.", + "priority-4": "Geringfügige Funktionseinschränkung oder ein Problem mit einer einfachen Umgehungslösung.", + "priority-5": "Kosmetische Probleme wie Rechtschreib- oder Ausrichtungsfehler.", + "priority-6": "Dieses Problem ist nicht öffentlich einsehbar." + }, + "nightly": { + "filter-title": "Vorabversion finden" + } } } diff --git a/locales/en.json b/locales/en.json index afc9294d..1790b24a 100644 --- a/locales/en.json +++ b/locales/en.json @@ -40,6 +40,99 @@ "title": "Sorry, we couldn't find this page", "back-to-home": "Back to Home" }, + "BusinessBenefits": { + "support": { + "title": "Need support with Temurin?", + "description": "Eclipse Temurin is supported by a vibrant community of developers and users. If you need help, please reach out to us.", + "cta": "Get Support" + }, + "contact": { + "title": "Contact us about how Temurin can help your business", + "description": "Ready to get involved? Fill out our membership form and take the first step in shaping the future of Adoptium.", + "cta": "Contact Us" + }, + "usage": { + "title": "How other companies are using Temurin", + "description": "Discover how industry leaders leverage Temurin to enhance performance and drive innovation in their development processes." + }, + "adopters": { + "title": "Eclipse Temurin® Adopters", + "description": "Companies that use Eclipse Temurin in production." + }, + "header": { + "title": "How Eclipse Temurin® can benefit your business", + "subtitle": "Business Benefits", + "description": "Eclipse Temurin offers high-performance, cross-platform, open-source Java runtime binaries that are enterprise-ready and Java SE TCK-tested for general use in the Java ecosystem.", + "contact": "Contact Us" + } + }, + "JoinPage": { + "title": "Joining the Working Group", + "subtitle": "Join the Eclipse Adoptium® Working Group", + "form-title": "Get in touch", + "form-description": "Tell us about your organisation and how you would like to get involved with Eclipse Adoptium.", + "options-title": "Explore ways to get involved", + "options-description": "Learn more about membership, sponsorship and contributing to our projects." + }, + "SupportingAnnouncement": { + "brand": "ECLIPSE ADOPTIUM", + "member": { + "title": "Become an Adoptium member", + "description": "Join the Adoptium Working Group and support the future of open source Java. Explore our membership options and benefits.", + "cta": "Learn more" + }, + "sustainer": { + "title": "Become a sustainer", + "description": "Join the Eclipse Temurin Sustainer Program to support Eclipse Temurin, the fastest-growing open source JDK. Your support fuels stronger security, faster releases, ready-to-deploy builds, quality testing and community development.", + "cta": "Learn more" + }, + "bloomberg": { + "title": "Case Study: Bloomberg’s shift to Open Source Java", + "description": "Discover how Eclipse Temurin helps power global financial infrastructure.", + "cta": "Read the Case Study" + } + }, + "NavBar": { + "Join Us": "Join Us", + "Become a Member": "Become a Member", + "Our Members": "Our Members", + "Become an Individual Sustainer": "Become an Individual Sustainer", + "Become a Corporate Sustainer": "Become a Corporate Sustainer", + "Our Sustainers": "Our Sustainers", + "Contribute to Adoptium": "Contribute to Adoptium", + "Become an Adopter": "Become an Adopter", + "Our Adopters": "Our Adopters", + "Latest Releases": "Latest Releases", + "Marketplace": "Marketplace", + "Projects": "Projects", + "What We Do": "What We Do", + "Eclipse Temurin": "Eclipse Temurin", + "Eclipse AQAvit": "Eclipse AQAvit", + "Eclipse Mission Control": "Eclipse Mission Control", + "Eclipse Migration Toolkit": "Eclipse Migration Toolkit", + "Resources": "Resources", + "Status": "Status", + "Release Notes": "Release Notes", + "Installation Guide": "Installation Guide", + "Documentation": "Documentation", + "FAQs": "FAQs", + "Brand & Promotion": "Brand & Promotion", + "Community": "Community", + "Support": "Support", + "News": "News", + "Events": "Events", + "Slack": "Slack", + "Membership": "Membership", + "Sponsorship": "Sponsorship", + "Contribute": "Contribute", + "Adopt": "Adopt", + "Join Us Overview": "Join Us Overview", + "Global": "Global", + "Adoptium Logo": "Adoptium Logo", + "notifications": "notifications", + "Open main menu": "Open main menu", + "Close menu": "Close menu" + }, "WhatWeDo": { "mission": "Open Java, built together", "community": "Community-led collaboration", @@ -121,6 +214,7 @@ } }, "RandomContributors": { + "become-contributor": "Become a Contributor", "thank-you": "Thank you to our 300+ contributors", "thank-you-mobile": "Thank you to our 300+ contributors" }, @@ -328,5 +422,156 @@ }, "Byline": { "reading-time": "{minutes} min read" + }, + "ModernPages": { + "common": { + "learn-more": "Learn more", + "loading": "Loading…", + "all": "All", + "previous": "Previous", + "next": "Next" + }, + "temurin": { + "resources-title": "Get started with Temurin", + "resources-description": "Install Temurin, explore the documentation, or help sustain the project.", + "install-description": "Find installation instructions for your operating system and development tools.", + "docs-description": "Explore guides for configuring and using Eclipse Temurin.", + "sponsor-title": "Support the project", + "sponsor-description": "Contributions fund the infrastructure and community behind Eclipse Temurin.", + "contact-title": "Put Temurin to work for your business", + "contact-description": "Explore cost savings, commercial support and software supply chain security with our community.", + "contact": "Contact us", + "community": "Talk to the community" + }, + "platforms": { + "title": "Supported platforms", + "description": "Explore operating system compatibility for the latest Eclipse Temurin releases.", + "intro": "Expand an operating system to compare JDK versions and Docker availability.", + "supported": "Supported", + "unsupported": "Not supported", + "docker": "Docker available", + "community-title": "Need help choosing a platform?", + "community-description": "Discuss your environment with the Adoptium community.", + "community-cta": "Join the conversation" + }, + "sustainer": { + "title": "Become a Corporate Sustainer", + "subtitle": "Support Eclipse Temurin", + "description": "Help sustain the infrastructure, testing and distribution that make Eclipse Temurin available to everyone.", + "form-title": "Start a conversation", + "form-description": "Tell us about your organisation and our team will help you find the right way to support Temurin.", + "thanks-title": "Thank you for your support", + "thanks-description": "We’ve received your enquiry. Our team will be in touch about becoming a Corporate Sustainer.", + "options-title": "Explore your options", + "options-description": "Learn about sustainer benefits, membership and other ways to get involved." + }, + "slack": { + "title": "Join the conversation", + "subtitle": "Adoptium community", + "description": "Connect with Eclipse Adoptium users, contributors and maintainers on Slack.", + "card-title": "A community built around open source Java", + "card-description": "Ask questions, share your experience and collaborate on Eclipse Temurin and other Adoptium projects.", + "cta": "Join Slack", + "hint": "Opens the Adoptium Slack invitation in a new tab.", + "support": "Looking for help with Temurin?", + "support-description": "Explore community help and commercial support options.", + "support-cta": "Get support" + }, + "events": { + "title": "Meet the community", + "subtitle": "Events & community", + "description": "Find Adoptium community calls and Eclipse Foundation events, online and around the world.", + "upcoming": "Eclipse Foundation events", + "calendar-title": "Adoptium community calendar", + "calendar-description": "Stay up to date with community meetings, meet other contributors and share your work in progress.", + "view-calendar": "View calendar", + "subscribe": "Subscribe to iCal", + "calendar-hint": "Community calls, security, AQAvit and website meetings, release dates and other online gatherings.", + "all-events": "View all Eclipse Foundation events", + "submit": "Submit an event", + "empty": "No events are available right now. Check the calendar for community meetings." + }, + "news": { + "title": "News & updates", + "subtitle": "From the Adoptium community", + "description": "Project announcements, release news and stories from across the Java ecosystem.", + "filters": "Explore the latest stories", + "sources": "All sources", + "tags": "All tags", + "authors": "All authors", + "remove-tag": "Remove tag: {tag}", + "read-more": "Read more", + "read-article": "Read article", + "tag-title": "Stories tagged with {tag}", + "tag": "Tag", + "source": "Source", + "author": "Author", + "submit": "Submit news", + "empty": "No stories match your filters.", + "empty-description": "Try adjusting or clearing your filters.", + "no-results": "No results found" + }, + "stats": { + "title": "Adoptium download statistics", + "subtitle": "Project insights", + "description": "Explore Eclipse Temurin downloads and Docker pulls across versions and platforms.", + "trends-title": "Download trends", + "trends-description": "Compare downloads and Docker pulls over time.", + "downloads": "Downloads", + "trends": "Trends", + "total": "Total downloads", + "github": "GitHub downloads", + "docker": "Docker pulls", + "popular": "Most popular JDK versions", + "github-version": "GitHub downloads by version", + "daily": "Daily downloads", + "monthly": "Monthly downloads", + "version": "JDK version", + "source": "Source", + "visible": "Show series", + "type": "Type", + "days": "Days", + "series": "Series {number}", + "daily-label": "Daily", + "monthly-label": "Monthly", + "total-label": "Total", + "docker-note": "JDK version filters do not include results from the Official Docker repository.", + "by-source": "Downloads by source", + "drilldown": "Explore downloads by release" + }, + "release-notes": { + "description": "Explore changes, fixes and improvements in Eclipse Temurin releases.", + "lts": "Long-term support", + "features": "Feature releases", + "back": "All versions", + "loading": "Loading release notes…", + "filters": "Filter changes", + "export": "Export CSV", + "rows": "Rows per page", + "priority": "Priority", + "type": "Type", + "component": "Component", + "issue": "Issue", + "summary": "Summary", + "all-priorities": "All priorities", + "all-types": "All types", + "all-components": "All components", + "empty": "No changes match these filters.", + "results": "{count} changes", + "page": "Page {page} of {total}", + "p1": "{count} critical issues", + "sort": "Sort by priority", + "view": "View release notes", + "hidden": "Not publicly visible", + "priority-1": "Blocks development or testing; production cannot run.", + "priority-2": "Crashes, data loss or severe memory leaks.", + "priority-3": "Major loss of function.", + "priority-4": "Minor loss of function, or a problem with an easy workaround.", + "priority-5": "Cosmetic problems such as spelling or alignment.", + "priority-6": "This issue is not publicly visible." + }, + "nightly": { + "filter-title": "Find an early-access build" + } } } diff --git a/locales/es.json b/locales/es.json index d9ff35e2..2dd177d3 100644 --- a/locales/es.json +++ b/locales/es.json @@ -40,6 +40,99 @@ "title": "Lo sentimos, no pudimos encontrar esta página", "back-to-home": "Volver a la página principal" }, + "BusinessBenefits": { + "support": { + "title": "¿Necesitas ayuda con Temurin?", + "description": "Eclipse Temurin cuenta con el apoyo de una comunidad activa de desarrolladores y usuarios. Si necesitas ayuda, contáctanos.", + "cta": "Obtener ayuda" + }, + "contact": { + "title": "Contáctanos para saber cómo Temurin puede ayudar a tu empresa", + "description": "¿Quieres participar? Rellena nuestro formulario de membresía y da el primer paso para dar forma al futuro de Adoptium.", + "cta": "Contáctanos" + }, + "usage": { + "title": "Cómo utilizan Temurin otras empresas", + "description": "Descubre cómo los líderes del sector aprovechan Temurin para mejorar el rendimiento e impulsar la innovación en sus procesos de desarrollo." + }, + "adopters": { + "title": "Empresas que usan Eclipse Temurin®", + "description": "Empresas que utilizan Eclipse Temurin en producción." + }, + "header": { + "title": "Cómo Eclipse Temurin® puede beneficiar a tu empresa", + "subtitle": "Ventajas para empresas", + "description": "Eclipse Temurin ofrece binarios de entornos de ejecución Java de código abierto, multiplataforma y de alto rendimiento, preparados para empresas y probados con el TCK de Java SE para uso general en el ecosistema Java.", + "contact": "Contáctanos" + } + }, + "JoinPage": { + "title": "Únete al grupo de trabajo", + "subtitle": "Únete al grupo de trabajo Eclipse Adoptium®", + "form-title": "Ponte en contacto", + "form-description": "Cuéntanos sobre tu organización y cómo te gustaría participar en Eclipse Adoptium.", + "options-title": "Descubre cómo participar", + "options-description": "Conoce las opciones de membresía, patrocinio y contribución a nuestros proyectos." + }, + "SupportingAnnouncement": { + "brand": "ECLIPSE ADOPTIUM", + "member": { + "title": "Hazte miembro de Adoptium", + "description": "Únete al grupo de trabajo Adoptium y apoya el futuro de Java de código abierto. Descubre nuestras opciones de membresía y sus ventajas.", + "cta": "Más información" + }, + "sustainer": { + "title": "Conviértete en patrocinador", + "description": "Únete al programa de apoyo de Eclipse Temurin, el JDK de código abierto de más rápido crecimiento. Tu apoyo refuerza la seguridad y permite versiones más rápidas, compilaciones listas para usar, pruebas de calidad y desarrollo de la comunidad.", + "cta": "Más información" + }, + "bloomberg": { + "title": "Caso de estudio: Bloomberg migra a Java de código abierto", + "description": "Descubre cómo Eclipse Temurin ayuda a impulsar la infraestructura financiera global.", + "cta": "Leer el caso de estudio" + } + }, + "NavBar": { + "Join Us": "Participa", + "Become a Member": "Hazte miembro", + "Our Members": "Nuestros miembros", + "Become an Individual Sustainer": "Apoya como particular", + "Become a Corporate Sustainer": "Apoya como empresa", + "Our Sustainers": "Nuestros patrocinadores", + "Contribute to Adoptium": "Contribuye a Adoptium", + "Become an Adopter": "Da a conocer tu adopción", + "Our Adopters": "Nuestros usuarios", + "Latest Releases": "Últimas versiones", + "Marketplace": "Marketplace", + "Projects": "Proyectos", + "What We Do": "Qué hacemos", + "Eclipse Temurin": "Eclipse Temurin", + "Eclipse AQAvit": "Eclipse AQAvit", + "Eclipse Mission Control": "Eclipse Mission Control", + "Eclipse Migration Toolkit": "Eclipse Migration Toolkit", + "Resources": "Recursos", + "Status": "Estado del servicio", + "Release Notes": "Notas de versión", + "Installation Guide": "Guía de instalación", + "Documentation": "Documentación", + "FAQs": "Preguntas frecuentes", + "Brand & Promotion": "Marca y promoción", + "Community": "Comunidad", + "Support": "Ayuda", + "News": "Noticias", + "Events": "Eventos", + "Slack": "Slack", + "Membership": "Membresía", + "Sponsorship": "Patrocinio", + "Contribute": "Contribuir", + "Adopt": "Adoptar", + "Join Us Overview": "Cómo participar", + "Global": "Navegación principal", + "Adoptium Logo": "Logotipo de Adoptium", + "notifications": "notificaciones", + "Open main menu": "Abrir menú principal", + "Close menu": "Cerrar menú" + }, "WhatWeDo": { "mission": "Java abierto, construido en comunidad", "community": "Colaboración impulsada por la comunidad", @@ -121,6 +214,7 @@ } }, "RandomContributors": { + "become-contributor": "Conviértete en colaborador", "thank-you": "Gracias a nuestros 300+ colaboradores", "thank-you-mobile": "Gracias a nuestros 300+ colaboradores" }, @@ -328,5 +422,156 @@ }, "Byline": { "reading-time": "{minutes} min de lectura" + }, + "ModernPages": { + "common": { + "learn-more": "Más información", + "loading": "Cargando…", + "all": "Todos", + "previous": "Anterior", + "next": "Siguiente" + }, + "temurin": { + "resources-title": "Primeros pasos con Temurin", + "resources-description": "Instala Temurin, consulta la documentación o ayuda a mantener el proyecto.", + "install-description": "Encuentra instrucciones de instalación para tu sistema operativo y tus herramientas de desarrollo.", + "docs-description": "Consulta las guías de configuración y uso de Eclipse Temurin.", + "sponsor-title": "Apoya el proyecto", + "sponsor-description": "Las contribuciones financian la infraestructura y la comunidad que hacen posible Eclipse Temurin.", + "contact-title": "Pon Temurin al servicio de tu empresa", + "contact-description": "Explora con nuestra comunidad cómo reducir costes, obtener soporte comercial y proteger la cadena de suministro de software.", + "contact": "Contáctanos", + "community": "Habla con la comunidad" + }, + "platforms": { + "title": "Plataformas compatibles", + "description": "Consulta la compatibilidad con los sistemas operativos de las últimas versiones de Eclipse Temurin.", + "intro": "Despliega un sistema operativo para comparar las versiones del JDK y la disponibilidad de Docker.", + "supported": "Compatible", + "unsupported": "No compatible", + "docker": "Docker disponible", + "community-title": "¿Necesitas ayuda para elegir una plataforma?", + "community-description": "Comenta tu entorno con la comunidad de Adoptium.", + "community-cta": "Únete a la conversación" + }, + "sustainer": { + "title": "Conviértete en patrocinador corporativo", + "subtitle": "Apoya Eclipse Temurin", + "description": "Ayuda a mantener la infraestructura, las pruebas y la distribución que hacen que Eclipse Temurin esté disponible para todos.", + "form-title": "Inicia una conversación", + "form-description": "Háblanos de tu organización y nuestro equipo te ayudará a encontrar la mejor forma de apoyar Temurin.", + "thanks-title": "Gracias por tu apoyo", + "thanks-description": "Hemos recibido tu consulta. Nuestro equipo se pondrá en contacto contigo para hablar sobre el patrocinio corporativo.", + "options-title": "Explora tus opciones", + "options-description": "Conoce las ventajas del patrocinio, la membresía y otras formas de participar." + }, + "slack": { + "title": "Únete a la conversación", + "subtitle": "Comunidad de Adoptium", + "description": "Conecta con usuarios, colaboradores y responsables de mantenimiento de Eclipse Adoptium en Slack.", + "card-title": "Una comunidad en torno a Java de código abierto", + "card-description": "Haz preguntas, comparte tu experiencia y colabora en Eclipse Temurin y otros proyectos de Adoptium.", + "cta": "Unirse a Slack", + "hint": "Abre la invitación al Slack de Adoptium en una pestaña nueva.", + "support": "¿Buscas ayuda con Temurin?", + "support-description": "Explora las opciones de ayuda de la comunidad y de soporte comercial.", + "support-cta": "Obtener soporte" + }, + "events": { + "title": "Conoce a la comunidad", + "subtitle": "Eventos y comunidad", + "description": "Encuentra reuniones de la comunidad de Adoptium y eventos de Eclipse Foundation, en línea y en todo el mundo.", + "upcoming": "Eventos de Eclipse Foundation", + "calendar-title": "Calendario de la comunidad de Adoptium", + "calendar-description": "Mantente al día de las reuniones de la comunidad, conoce a otros colaboradores y comparte tus proyectos en curso.", + "view-calendar": "Ver calendario", + "subscribe": "Suscribirse a iCal", + "calendar-hint": "Reuniones de la comunidad, de seguridad, de AQAvit y del sitio web, fechas de lanzamiento y otros encuentros en línea.", + "all-events": "Ver todos los eventos de Eclipse Foundation", + "submit": "Proponer un evento", + "empty": "No hay eventos disponibles en este momento. Consulta el calendario para ver las reuniones de la comunidad." + }, + "news": { + "title": "Noticias y novedades", + "subtitle": "Desde la comunidad de Adoptium", + "description": "Anuncios del proyecto, noticias sobre lanzamientos e historias de todo el ecosistema Java.", + "filters": "Descubre las últimas noticias", + "sources": "Todas las fuentes", + "tags": "Todas las etiquetas", + "authors": "Todos los autores", + "remove-tag": "Eliminar etiqueta: {tag}", + "read-more": "Leer más", + "read-article": "Leer artículo", + "tag-title": "Artículos con la etiqueta {tag}", + "tag": "Etiqueta", + "source": "Fuente", + "author": "Autor", + "submit": "Enviar una noticia", + "empty": "Ningún artículo coincide con tus filtros.", + "empty-description": "Prueba a ajustar o borrar los filtros.", + "no-results": "No se han encontrado resultados" + }, + "stats": { + "title": "Estadísticas de descargas de Adoptium", + "subtitle": "Datos del proyecto", + "description": "Explora las descargas de Eclipse Temurin y de imágenes de Docker por versión y plataforma.", + "trends-title": "Tendencias de descargas", + "trends-description": "Compara las descargas y las obtenciones de imágenes de Docker a lo largo del tiempo.", + "downloads": "Descargas", + "trends": "Tendencias", + "total": "Descargas totales", + "github": "Descargas de GitHub", + "docker": "Descargas de imágenes de Docker", + "popular": "Versiones del JDK más populares", + "github-version": "Descargas de GitHub por versión", + "daily": "Descargas diarias", + "monthly": "Descargas mensuales", + "version": "Versión del JDK", + "source": "Fuente", + "visible": "Mostrar series", + "type": "Tipo", + "days": "Días", + "series": "Serie {number}", + "daily-label": "Diario", + "monthly-label": "Mensual", + "total-label": "Total", + "docker-note": "Los filtros de versión del JDK no incluyen resultados del repositorio oficial de Docker.", + "by-source": "Descargas por fuente", + "drilldown": "Explorar descargas por lanzamiento" + }, + "release-notes": { + "description": "Explora los cambios, las correcciones y las mejoras de las versiones de Eclipse Temurin.", + "lts": "Soporte a largo plazo", + "features": "Versiones con nuevas funcionalidades", + "back": "Todas las versiones", + "loading": "Cargando notas de la versión…", + "filters": "Filtrar cambios", + "export": "Exportar CSV", + "rows": "Filas por página", + "priority": "Prioridad", + "type": "Tipo", + "component": "Componente", + "issue": "Incidencia", + "summary": "Resumen", + "all-priorities": "Todas las prioridades", + "all-types": "Todos los tipos", + "all-components": "Todos los componentes", + "empty": "Ningún cambio coincide con estos filtros.", + "results": "{count} cambios", + "page": "Página {page} de {total}", + "p1": "{count} incidencias críticas", + "sort": "Ordenar por prioridad", + "view": "Ver notas de la versión", + "hidden": "No visible públicamente", + "priority-1": "Bloquea el desarrollo o las pruebas; el entorno de producción no puede funcionar.", + "priority-2": "Fallos, pérdida de datos o fugas graves de memoria.", + "priority-3": "Pérdida importante de funcionalidad.", + "priority-4": "Pérdida menor de funcionalidad o un problema con una solución alternativa sencilla.", + "priority-5": "Problemas estéticos, como errores de ortografía o alineación.", + "priority-6": "Esta incidencia no es visible públicamente." + }, + "nightly": { + "filter-title": "Busca una compilación de acceso anticipado" + } } } diff --git a/locales/fr.json b/locales/fr.json index d2577ab2..0ff24bb7 100644 --- a/locales/fr.json +++ b/locales/fr.json @@ -40,6 +40,99 @@ "title": "Désolé, nous n'avons pas pu trouver cette page", "back-to-home": "Retour à l'accueil" }, + "BusinessBenefits": { + "support": { + "title": "Besoin d'aide avec Temurin ?", + "description": "Eclipse Temurin est soutenu par une communauté dynamique de développeurs et d'utilisateurs. Si vous avez besoin d'aide, contactez-nous.", + "cta": "Obtenir de l'aide" + }, + "contact": { + "title": "Contactez-nous pour découvrir les avantages de Temurin pour votre entreprise", + "description": "Prêt à participer ? Remplissez notre formulaire d'adhésion et faites un premier pas pour façonner l'avenir d'Adoptium.", + "cta": "Contactez-nous" + }, + "usage": { + "title": "Comment les entreprises utilisent Temurin", + "description": "Découvrez comment les leaders du secteur utilisent Temurin pour améliorer les performances et stimuler l'innovation dans leurs processus de développement." + }, + "adopters": { + "title": "Ils utilisent Eclipse Temurin®", + "description": "Des entreprises qui utilisent Eclipse Temurin en production." + }, + "header": { + "title": "Les avantages d'Eclipse Temurin® pour votre entreprise", + "subtitle": "Avantages pour les entreprises", + "description": "Eclipse Temurin propose des binaires d'environnements d'exécution Java open source, multiplateformes et hautes performances, adaptés aux entreprises et testés avec le TCK Java SE pour une utilisation générale dans l'écosystème Java.", + "contact": "Contactez-nous" + } + }, + "JoinPage": { + "title": "Rejoindre le groupe de travail", + "subtitle": "Rejoignez le groupe de travail Eclipse Adoptium®", + "form-title": "Contactez-nous", + "form-description": "Présentez votre organisation et dites-nous comment vous souhaitez participer à Eclipse Adoptium.", + "options-title": "Découvrez comment participer", + "options-description": "Découvrez l'adhésion, le soutien financier et les contributions à nos projets." + }, + "SupportingAnnouncement": { + "brand": "ECLIPSE ADOPTIUM", + "member": { + "title": "Devenez membre d'Adoptium", + "description": "Rejoignez le groupe de travail Adoptium et soutenez l'avenir de Java open source. Découvrez nos options d'adhésion et leurs avantages.", + "cta": "En savoir plus" + }, + "sustainer": { + "title": "Devenez un soutien", + "description": "Rejoignez le programme de soutien Eclipse Temurin pour soutenir le JDK open source à la croissance la plus rapide. Votre soutien renforce la sécurité, accélère les versions et finance les distributions prêtes à déployer, les tests de qualité et le développement de la communauté.", + "cta": "En savoir plus" + }, + "bloomberg": { + "title": "Étude de cas : Bloomberg passe à Java open source", + "description": "Découvrez comment Eclipse Temurin contribue au fonctionnement des infrastructures financières mondiales.", + "cta": "Lire l'étude de cas" + } + }, + "NavBar": { + "Join Us": "Nous rejoindre", + "Become a Member": "Devenir membre", + "Our Members": "Nos membres", + "Become an Individual Sustainer": "Devenir soutien individuel", + "Become a Corporate Sustainer": "Devenir entreprise de soutien", + "Our Sustainers": "Nos soutiens", + "Contribute to Adoptium": "Contribuer à Adoptium", + "Become an Adopter": "Faire connaître votre adoption", + "Our Adopters": "Nos utilisateurs", + "Latest Releases": "Dernières versions", + "Marketplace": "Marketplace", + "Projects": "Projets", + "What We Do": "Nos activités", + "Eclipse Temurin": "Eclipse Temurin", + "Eclipse AQAvit": "Eclipse AQAvit", + "Eclipse Mission Control": "Eclipse Mission Control", + "Eclipse Migration Toolkit": "Eclipse Migration Toolkit", + "Resources": "Ressources", + "Status": "État des services", + "Release Notes": "Notes de version", + "Installation Guide": "Guide d'installation", + "Documentation": "Documentation", + "FAQs": "FAQ", + "Brand & Promotion": "Identité et promotion", + "Community": "Communauté", + "Support": "Assistance", + "News": "Actualités", + "Events": "Événements", + "Slack": "Slack", + "Membership": "Adhésion", + "Sponsorship": "Soutien financier", + "Contribute": "Contribuer", + "Adopt": "Adopter", + "Join Us Overview": "Comment nous rejoindre", + "Global": "Navigation principale", + "Adoptium Logo": "Logo Adoptium", + "notifications": "notifications", + "Open main menu": "Ouvrir le menu principal", + "Close menu": "Fermer le menu" + }, "WhatWeDo": { "mission": "Un Java ouvert, développé ensemble", "community": "Une collaboration portée par la communauté", @@ -121,6 +214,7 @@ } }, "RandomContributors": { + "become-contributor": "Devenir contributeur", "thank-you": "Merci à nos 300+ contributeurs", "thank-you-mobile": "Merci à nos 300+ contributeurs" }, @@ -328,5 +422,156 @@ }, "Byline": { "reading-time": "{minutes} min de lecture" + }, + "ModernPages": { + "common": { + "learn-more": "En savoir plus", + "loading": "Chargement…", + "all": "Tous", + "previous": "Précédent", + "next": "Suivant" + }, + "temurin": { + "resources-title": "Premiers pas avec Temurin", + "resources-description": "Installez Temurin, consultez la documentation ou contribuez à la pérennité du projet.", + "install-description": "Trouvez les instructions d’installation pour votre système d’exploitation et vos outils de développement.", + "docs-description": "Consultez les guides de configuration et d’utilisation d’Eclipse Temurin.", + "sponsor-title": "Soutenez le projet", + "sponsor-description": "Les contributions financent l’infrastructure et la communauté qui font vivre Eclipse Temurin.", + "contact-title": "Mettez Temurin au service de votre entreprise", + "contact-description": "Découvrez avec notre communauté comment réduire vos coûts, bénéficier d’un support commercial et sécuriser votre chaîne d’approvisionnement logicielle.", + "contact": "Contactez-nous", + "community": "Échangez avec la communauté" + }, + "platforms": { + "title": "Plateformes prises en charge", + "description": "Découvrez la compatibilité des dernières versions d’Eclipse Temurin avec les systèmes d’exploitation.", + "intro": "Dépliez un système d’exploitation pour comparer les versions du JDK et la disponibilité de Docker.", + "supported": "Pris en charge", + "unsupported": "Non pris en charge", + "docker": "Docker disponible", + "community-title": "Besoin d’aide pour choisir une plateforme ?", + "community-description": "Discutez de votre environnement avec la communauté Adoptium.", + "community-cta": "Rejoignez la discussion" + }, + "sustainer": { + "title": "Devenez entreprise mécène", + "subtitle": "Soutenez Eclipse Temurin", + "description": "Contribuez à pérenniser l’infrastructure, les tests et la distribution qui rendent Eclipse Temurin accessible à tous.", + "form-title": "Engagez la discussion", + "form-description": "Présentez-nous votre organisation et notre équipe vous aidera à trouver la meilleure façon de soutenir Temurin.", + "thanks-title": "Merci pour votre soutien", + "thanks-description": "Nous avons bien reçu votre demande. Notre équipe vous contactera pour vous accompagner dans votre démarche de mécénat d’entreprise.", + "options-title": "Découvrez vos possibilités", + "options-description": "Découvrez les avantages du mécénat, l’adhésion et les autres façons de participer." + }, + "slack": { + "title": "Rejoignez la discussion", + "subtitle": "Communauté Adoptium", + "description": "Échangez avec les utilisateurs, les contributeurs et les responsables de la maintenance d’Eclipse Adoptium sur Slack.", + "card-title": "Une communauté autour de Java open source", + "card-description": "Posez vos questions, partagez votre expérience et collaborez sur Eclipse Temurin et les autres projets Adoptium.", + "cta": "Rejoindre Slack", + "hint": "Ouvre l’invitation au Slack d’Adoptium dans un nouvel onglet.", + "support": "Besoin d’aide avec Temurin ?", + "support-description": "Découvrez les possibilités d’entraide communautaire et de support commercial.", + "support-cta": "Obtenir de l’aide" + }, + "events": { + "title": "Rencontrez la communauté", + "subtitle": "Événements et communauté", + "description": "Retrouvez les réunions de la communauté Adoptium et les événements de la Fondation Eclipse, en ligne et dans le monde entier.", + "upcoming": "Événements de la Fondation Eclipse", + "calendar-title": "Calendrier de la communauté Adoptium", + "calendar-description": "Suivez les réunions de la communauté, rencontrez d’autres contributeurs et partagez vos travaux en cours.", + "view-calendar": "Voir le calendrier", + "subscribe": "S’abonner au calendrier iCal", + "calendar-hint": "Réunions de la communauté, sur la sécurité, AQAvit et le site web, dates de publication et autres rencontres en ligne.", + "all-events": "Voir tous les événements de la Fondation Eclipse", + "submit": "Proposer un événement", + "empty": "Aucun événement n’est disponible pour le moment. Consultez le calendrier pour retrouver les réunions de la communauté." + }, + "news": { + "title": "Actualités et nouveautés", + "subtitle": "La communauté Adoptium vous informe", + "description": "Annonces du projet, nouvelles versions et articles de l’ensemble de l’écosystème Java.", + "filters": "Découvrez les derniers articles", + "sources": "Toutes les sources", + "tags": "Toutes les étiquettes", + "authors": "Tous les auteurs", + "remove-tag": "Retirer l’étiquette : {tag}", + "read-more": "Lire la suite", + "read-article": "Lire l’article", + "tag-title": "Articles portant l’étiquette {tag}", + "tag": "Étiquette", + "source": "Source", + "author": "Auteur", + "submit": "Proposer une actualité", + "empty": "Aucun article ne correspond à vos filtres.", + "empty-description": "Essayez de modifier ou de réinitialiser vos filtres.", + "no-results": "Aucun résultat trouvé" + }, + "stats": { + "title": "Statistiques de téléchargement d’Adoptium", + "subtitle": "Le projet en chiffres", + "description": "Explorez les téléchargements d’Eclipse Temurin et d’images Docker par version et par plateforme.", + "trends-title": "Tendances des téléchargements", + "trends-description": "Comparez les téléchargements et les récupérations d’images Docker au fil du temps.", + "downloads": "Téléchargements", + "trends": "Tendances", + "total": "Total des téléchargements", + "github": "Téléchargements GitHub", + "docker": "Téléchargements d’images Docker", + "popular": "Versions du JDK les plus populaires", + "github-version": "Téléchargements GitHub par version", + "daily": "Téléchargements quotidiens", + "monthly": "Téléchargements mensuels", + "version": "Version du JDK", + "source": "Source", + "visible": "Afficher les séries", + "type": "Type", + "days": "Jours", + "series": "Série {number}", + "daily-label": "Quotidien", + "monthly-label": "Mensuel", + "total-label": "Total", + "docker-note": "Les filtres de version du JDK n’incluent pas les résultats du dépôt officiel Docker.", + "by-source": "Téléchargements par source", + "drilldown": "Explorer les téléchargements par version publiée" + }, + "release-notes": { + "description": "Découvrez les changements, les correctifs et les améliorations des versions d’Eclipse Temurin.", + "lts": "Support à long terme", + "features": "Versions fonctionnelles", + "back": "Toutes les versions", + "loading": "Chargement des notes de version…", + "filters": "Filtrer les changements", + "export": "Exporter au format CSV", + "rows": "Lignes par page", + "priority": "Priorité", + "type": "Type", + "component": "Composant", + "issue": "Problème", + "summary": "Résumé", + "all-priorities": "Toutes les priorités", + "all-types": "Tous les types", + "all-components": "Tous les composants", + "empty": "Aucun changement ne correspond à ces filtres.", + "results": "{count} changements", + "page": "Page {page} sur {total}", + "p1": "{count} problèmes critiques", + "sort": "Trier par priorité", + "view": "Voir les notes de version", + "hidden": "Non visible publiquement", + "priority-1": "Bloque le développement ou les tests ; l’environnement de production ne peut pas fonctionner.", + "priority-2": "Plantages, pertes de données ou fuites de mémoire importantes.", + "priority-3": "Perte majeure de fonctionnalités.", + "priority-4": "Perte mineure de fonctionnalités ou problème avec une solution de contournement simple.", + "priority-5": "Problèmes esthétiques, tels que des erreurs d’orthographe ou d’alignement.", + "priority-6": "Ce problème n’est pas visible publiquement." + }, + "nightly": { + "filter-title": "Trouver une compilation en accès anticipé" + } } } diff --git a/locales/ja.json b/locales/ja.json index c4080cde..b72c9dea 100644 --- a/locales/ja.json +++ b/locales/ja.json @@ -40,6 +40,99 @@ "title": "申し訳ありません。このページは見つかりませんでした", "back-to-home": "ホームに戻る" }, + "BusinessBenefits": { + "support": { + "title": "Temurinのサポートが必要ですか?", + "description": "Eclipse Temurinは、活発な開発者とユーザーのコミュニティに支えられています。サポートが必要な場合はお問い合わせください。", + "cta": "サポートを受ける" + }, + "contact": { + "title": "Temurinのビジネス活用についてお問い合わせください", + "description": "参加しませんか?メンバーシップフォームにご記入のうえ、Adoptiumの未来を共に築く第一歩を踏み出しましょう。", + "cta": "お問い合わせ" + }, + "usage": { + "title": "企業におけるTemurinの活用", + "description": "業界をリードする企業がTemurinを活用し、開発プロセスの性能向上とイノベーションを実現する方法をご紹介します。" + }, + "adopters": { + "title": "Eclipse Temurin® 導入企業", + "description": "本番環境で Eclipse Temurin を利用している企業。" + }, + "header": { + "title": "Eclipse Temurin® がビジネスにもたらすメリット", + "subtitle": "ビジネス上のメリット", + "description": "Eclipse Temurin は、高性能でクロスプラットフォームに対応したオープンソースの Java ランタイムバイナリを提供します。企業での利用に適しており、Java エコシステム全般での利用に向けて Java SE TCK によるテストを実施しています。", + "contact": "お問い合わせ" + } + }, + "JoinPage": { + "title": "ワーキンググループへの参加", + "subtitle": "Eclipse Adoptium®ワーキンググループに参加する", + "form-title": "お問い合わせ", + "form-description": "ご所属の組織と、Eclipse Adoptiumへの参加方法についてお知らせください。", + "options-title": "参加方法を探す", + "options-description": "メンバーシップ、スポンサーシップ、プロジェクトへの貢献についてご覧ください。" + }, + "SupportingAnnouncement": { + "brand": "ECLIPSE ADOPTIUM", + "member": { + "title": "Adoptiumのメンバーになる", + "description": "Adoptiumワーキンググループに参加し、オープンソースJavaの未来を支えましょう。メンバーシップの選択肢と特典をご覧ください。", + "cta": "詳しく見る" + }, + "sustainer": { + "title": "支援者になる", + "description": "急成長するオープンソースJDK、Eclipse Temurinの支援プログラムに参加しませんか。皆様の支援がセキュリティ強化、迅速なリリース、導入可能なビルド、品質テスト、コミュニティの発展を支えます。", + "cta": "詳しく見る" + }, + "bloomberg": { + "title": "導入事例:BloombergのオープンソースJavaへの移行", + "description": "Eclipse Temurinが世界の金融インフラをどのように支えているかをご紹介します。", + "cta": "導入事例を読む" + } + }, + "NavBar": { + "Join Us": "参加する", + "Become a Member": "メンバーになる", + "Our Members": "メンバー一覧", + "Become an Individual Sustainer": "個人として支援する", + "Become a Corporate Sustainer": "企業として支援する", + "Our Sustainers": "支援者一覧", + "Contribute to Adoptium": "Adoptium に貢献する", + "Become an Adopter": "導入事例を登録する", + "Our Adopters": "導入企業一覧", + "Latest Releases": "最新リリース", + "Marketplace": "マーケットプレイス", + "Projects": "プロジェクト", + "What We Do": "活動内容", + "Eclipse Temurin": "Eclipse Temurin", + "Eclipse AQAvit": "Eclipse AQAvit", + "Eclipse Mission Control": "Eclipse Mission Control", + "Eclipse Migration Toolkit": "Eclipse Migration Toolkit", + "Resources": "リソース", + "Status": "サービス稼働状況", + "Release Notes": "リリースノート", + "Installation Guide": "インストールガイド", + "Documentation": "ドキュメント", + "FAQs": "よくある質問", + "Brand & Promotion": "ブランドと広報", + "Community": "コミュニティ", + "Support": "サポート", + "News": "ニュース", + "Events": "イベント", + "Slack": "Slack", + "Membership": "メンバーシップ", + "Sponsorship": "スポンサーシップ", + "Contribute": "貢献する", + "Adopt": "導入する", + "Join Us Overview": "参加方法", + "Global": "メインナビゲーション", + "Adoptium Logo": "Adoptium ロゴ", + "notifications": "お知らせ", + "Open main menu": "メインメニューを開く", + "Close menu": "メニューを閉じる" + }, "WhatWeDo": { "mission": "共に築く、オープンなJava", "community": "コミュニティ主導の協力", @@ -121,6 +214,7 @@ } }, "RandomContributors": { + "become-contributor": "コントリビューターになる", "thank-you": "300人以上のコントリビューターに感謝します", "thank-you-mobile": "300人以上のコントリビューターに感謝します" }, @@ -328,5 +422,156 @@ }, "Byline": { "reading-time": "{minutes}分で読めます" + }, + "ModernPages": { + "common": { + "learn-more": "詳しく見る", + "loading": "読み込み中…", + "all": "すべて", + "previous": "前へ", + "next": "次へ" + }, + "temurin": { + "resources-title": "Temurinを使い始める", + "resources-description": "Temurinのインストール、ドキュメントの閲覧、プロジェクトの継続的な支援についてご案内します。", + "install-description": "お使いのオペレーティングシステムや開発ツールに応じたインストール手順をご確認ください。", + "docs-description": "Eclipse Temurinの設定や使い方に関するガイドをご覧ください。", + "sponsor-title": "プロジェクトを支援する", + "sponsor-description": "皆さまからの支援は、Eclipse Temurinを支えるインフラとコミュニティの運営に役立てられます。", + "contact-title": "Temurinをビジネスに活用", + "contact-description": "コスト削減、商用サポート、ソフトウェアサプライチェーンのセキュリティについて、コミュニティとともに検討しましょう。", + "contact": "お問い合わせ", + "community": "コミュニティに相談する" + }, + "platforms": { + "title": "対応プラットフォーム", + "description": "最新のEclipse Temurinリリースのオペレーティングシステム互換性をご確認ください。", + "intro": "オペレーティングシステムの項目を展開すると、JDKのバージョンとDockerの提供状況を比較できます。", + "supported": "対応", + "unsupported": "非対応", + "docker": "Dockerあり", + "community-title": "プラットフォーム選びでお困りですか?", + "community-description": "お使いの環境についてAdoptiumコミュニティにご相談ください。", + "community-cta": "会話に参加する" + }, + "sustainer": { + "title": "継続支援企業になる", + "subtitle": "Eclipse Temurinを支援する", + "description": "Eclipse Temurinを誰もが利用できるようにするためのインフラ、テスト、配布を継続的に支える活動にご協力ください。", + "form-title": "まずはご相談ください", + "form-description": "貴組織についてお聞かせください。Temurinへの最適な支援方法をチームがご案内します。", + "thanks-title": "ご支援ありがとうございます", + "thanks-description": "お問い合わせを受け付けました。継続支援企業への参加について、担当チームからご連絡いたします。", + "options-title": "支援方法を探す", + "options-description": "継続支援の特典、メンバーシップ、その他の参加方法をご確認ください。" + }, + "slack": { + "title": "会話に参加する", + "subtitle": "Adoptiumコミュニティ", + "description": "SlackでEclipse Adoptiumのユーザー、貢献者、メンテナーと交流しましょう。", + "card-title": "オープンソースJavaを中心としたコミュニティ", + "card-description": "質問や経験の共有を通じて、Eclipse Temurinやその他のAdoptiumプロジェクトで協力しましょう。", + "cta": "Slackに参加する", + "hint": "Adoptium Slackの招待ページが新しいタブで開きます。", + "support": "Temurinについてお困りですか?", + "support-description": "コミュニティによる支援や商用サポートをご確認ください。", + "support-cta": "サポートを受ける" + }, + "events": { + "title": "コミュニティと交流する", + "subtitle": "イベントとコミュニティ", + "description": "オンラインや世界各地で開催されるAdoptiumコミュニティのミーティングやEclipse Foundationのイベントをご紹介します。", + "upcoming": "Eclipse Foundationのイベント", + "calendar-title": "Adoptiumコミュニティカレンダー", + "calendar-description": "コミュニティのミーティング情報をチェックして、他の貢献者と交流し、取り組みの進捗を共有しましょう。", + "view-calendar": "カレンダーを見る", + "subscribe": "iCalを購読する", + "calendar-hint": "コミュニティ、セキュリティ、AQAvit、ウェブサイトに関するミーティング、リリース日、その他のオンラインでの集まりを掲載しています。", + "all-events": "Eclipse Foundationのすべてのイベントを見る", + "submit": "イベントを投稿する", + "empty": "現在、掲載されているイベントはありません。コミュニティのミーティングについてはカレンダーをご確認ください。" + }, + "news": { + "title": "ニュースと最新情報", + "subtitle": "Adoptiumコミュニティより", + "description": "プロジェクトのお知らせ、リリース情報、Javaエコシステム全体の話題をお届けします。", + "filters": "最新の記事を探す", + "sources": "すべての情報源", + "tags": "すべてのタグ", + "authors": "すべての著者", + "remove-tag": "タグを削除:{tag}", + "read-more": "続きを読む", + "read-article": "記事を読む", + "tag-title": "{tag}のタグが付いた記事", + "tag": "タグ", + "source": "情報源", + "author": "著者", + "submit": "ニュースを投稿する", + "empty": "フィルターに一致する記事はありません。", + "empty-description": "フィルターを変更するか解除してみてください。", + "no-results": "結果が見つかりませんでした" + }, + "stats": { + "title": "Adoptiumのダウンロード統計", + "subtitle": "プロジェクトのデータ", + "description": "Eclipse Temurinのダウンロード数とDockerイメージのプル数を、バージョンやプラットフォーム別に確認できます。", + "trends-title": "ダウンロードの推移", + "trends-description": "ダウンロード数とDockerイメージのプル数の推移を比較できます。", + "downloads": "ダウンロード数", + "trends": "推移", + "total": "総ダウンロード数", + "github": "GitHubダウンロード数", + "docker": "Dockerプル数", + "popular": "人気のJDKバージョン", + "github-version": "バージョン別GitHubダウンロード数", + "daily": "日別ダウンロード数", + "monthly": "月別ダウンロード数", + "version": "JDKバージョン", + "source": "ダウンロード元", + "visible": "データ系列を表示", + "type": "種類", + "days": "日数", + "series": "系列 {number}", + "daily-label": "日別", + "monthly-label": "月別", + "total-label": "合計", + "docker-note": "JDKバージョンのフィルターには、Docker公式リポジトリの結果は含まれません。", + "by-source": "ダウンロード元別のダウンロード数", + "drilldown": "リリース別のダウンロード数を見る" + }, + "release-notes": { + "description": "Eclipse Temurinの各リリースの変更、修正、改善をご確認ください。", + "lts": "長期サポート", + "features": "機能リリース", + "back": "すべてのバージョン", + "loading": "リリースノートを読み込み中…", + "filters": "変更を絞り込む", + "export": "CSVをエクスポート", + "rows": "1ページあたりの行数", + "priority": "優先度", + "type": "種類", + "component": "コンポーネント", + "issue": "課題", + "summary": "概要", + "all-priorities": "すべての優先度", + "all-types": "すべての種類", + "all-components": "すべてのコンポーネント", + "empty": "条件に一致する変更はありません。", + "results": "{count}件の変更", + "page": "{total}ページ中{page}ページ", + "p1": "{count}件の重大な問題", + "sort": "優先度で並べ替え", + "view": "リリースノートを見る", + "hidden": "非公開", + "priority-1": "開発またはテストを妨げ、本番環境での稼働が不可能。", + "priority-2": "クラッシュ、データ損失、または深刻なメモリリーク。", + "priority-3": "重大な機能の喪失。", + "priority-4": "軽微な機能の喪失、または簡単な回避策のある問題。", + "priority-5": "誤字や配置のずれなど、表示上の問題。", + "priority-6": "この課題は公開されていません。" + }, + "nightly": { + "filter-title": "早期アクセスビルドを探す" + } } } diff --git a/locales/pt-BR.json b/locales/pt-BR.json index fadcead9..18aa494e 100644 --- a/locales/pt-BR.json +++ b/locales/pt-BR.json @@ -40,6 +40,99 @@ "title": "Desculpe, não conseguimos encontrar esta página", "back-to-home": "Voltar para a Página Inicial" }, + "BusinessBenefits": { + "support": { + "title": "Precisa de ajuda com o Temurin?", + "description": "O Eclipse Temurin conta com uma comunidade ativa de desenvolvedores e usuários. Se precisar de ajuda, entre em contato.", + "cta": "Obter suporte" + }, + "contact": { + "title": "Fale conosco sobre como o Temurin pode ajudar sua empresa", + "description": "Pronto para participar? Preencha nosso formulário de associação e dê o primeiro passo para ajudar a definir o futuro do Adoptium.", + "cta": "Entre em contato" + }, + "usage": { + "title": "Como outras empresas usam o Temurin", + "description": "Descubra como líderes do setor usam o Temurin para melhorar o desempenho e impulsionar a inovação em seus processos de desenvolvimento." + }, + "adopters": { + "title": "Empresas que usam Eclipse Temurin®", + "description": "Empresas que utilizam o Eclipse Temurin em produção." + }, + "header": { + "title": "Como o Eclipse Temurin® pode beneficiar sua empresa", + "subtitle": "Benefícios para empresas", + "description": "O Eclipse Temurin oferece binários de runtime Java de código aberto, multiplataforma e de alto desempenho, prontos para empresas e testados com o TCK do Java SE para uso geral no ecossistema Java.", + "contact": "Entre em contato" + } + }, + "JoinPage": { + "title": "Participe do grupo de trabalho", + "subtitle": "Participe do grupo de trabalho Eclipse Adoptium®", + "form-title": "Entre em contato", + "form-description": "Conte-nos sobre sua organização e como gostaria de participar do Eclipse Adoptium.", + "options-title": "Explore formas de participar", + "options-description": "Saiba mais sobre associação, patrocínio e contribuições aos nossos projetos." + }, + "SupportingAnnouncement": { + "brand": "ECLIPSE ADOPTIUM", + "member": { + "title": "Torne-se membro do Adoptium", + "description": "Participe do grupo de trabalho Adoptium e apoie o futuro do Java de código aberto. Conheça nossas opções de associação e seus benefícios.", + "cta": "Saiba mais" + }, + "sustainer": { + "title": "Torne-se um apoiador", + "description": "Participe do programa de apoio do Eclipse Temurin, o JDK de código aberto que mais cresce. Seu apoio fortalece a segurança e permite lançamentos mais rápidos, distribuições prontas para uso, testes de qualidade e desenvolvimento da comunidade.", + "cta": "Saiba mais" + }, + "bloomberg": { + "title": "Estudo de caso: a migração da Bloomberg para Java de código aberto", + "description": "Descubra como o Eclipse Temurin ajuda a sustentar a infraestrutura financeira global.", + "cta": "Ler o estudo de caso" + } + }, + "NavBar": { + "Join Us": "Participe", + "Become a Member": "Torne-se membro", + "Our Members": "Nossos membros", + "Become an Individual Sustainer": "Apoie como pessoa física", + "Become a Corporate Sustainer": "Apoie como empresa", + "Our Sustainers": "Nossos apoiadores", + "Contribute to Adoptium": "Contribua com o Adoptium", + "Become an Adopter": "Divulgue sua adoção", + "Our Adopters": "Nossos usuários", + "Latest Releases": "Últimas versões", + "Marketplace": "Marketplace", + "Projects": "Projetos", + "What We Do": "O que fazemos", + "Eclipse Temurin": "Eclipse Temurin", + "Eclipse AQAvit": "Eclipse AQAvit", + "Eclipse Mission Control": "Eclipse Mission Control", + "Eclipse Migration Toolkit": "Eclipse Migration Toolkit", + "Resources": "Recursos", + "Status": "Status dos serviços", + "Release Notes": "Notas de versão", + "Installation Guide": "Guia de instalação", + "Documentation": "Documentação", + "FAQs": "Perguntas frequentes", + "Brand & Promotion": "Marca e divulgação", + "Community": "Comunidade", + "Support": "Suporte", + "News": "Notícias", + "Events": "Eventos", + "Slack": "Slack", + "Membership": "Associação", + "Sponsorship": "Patrocínio", + "Contribute": "Contribuir", + "Adopt": "Adotar", + "Join Us Overview": "Como participar", + "Global": "Navegação principal", + "Adoptium Logo": "Logotipo do Adoptium", + "notifications": "notificações", + "Open main menu": "Abrir menu principal", + "Close menu": "Fechar menu" + }, "WhatWeDo": { "mission": "Java aberto, construído em conjunto", "community": "Colaboração liderada pela comunidade", @@ -121,6 +214,7 @@ } }, "RandomContributors": { + "become-contributor": "Torne-se um contribuidor", "thank-you": "Obrigado aos nossos 300+ contribuidores", "thank-you-mobile": "Obrigado aos nossos 300+ contribuidores" }, @@ -328,5 +422,156 @@ }, "Byline": { "reading-time": "{minutes} min de leitura" + }, + "ModernPages": { + "common": { + "learn-more": "Saiba mais", + "loading": "Carregando…", + "all": "Todos", + "previous": "Anterior", + "next": "Próximo" + }, + "temurin": { + "resources-title": "Comece a usar o Temurin", + "resources-description": "Instale o Temurin, explore a documentação ou ajude a manter o projeto.", + "install-description": "Encontre instruções de instalação para seu sistema operacional e suas ferramentas de desenvolvimento.", + "docs-description": "Explore os guias de configuração e uso do Eclipse Temurin.", + "sponsor-title": "Apoie o projeto", + "sponsor-description": "As contribuições financiam a infraestrutura e a comunidade por trás do Eclipse Temurin.", + "contact-title": "Coloque o Temurin a serviço da sua empresa", + "contact-description": "Explore com nossa comunidade a redução de custos, o suporte comercial e a segurança da cadeia de suprimentos de software.", + "contact": "Entre em contato", + "community": "Converse com a comunidade" + }, + "platforms": { + "title": "Plataformas compatíveis", + "description": "Explore a compatibilidade das versões mais recentes do Eclipse Temurin com os sistemas operacionais.", + "intro": "Expanda um sistema operacional para comparar as versões do JDK e a disponibilidade do Docker.", + "supported": "Compatível", + "unsupported": "Não compatível", + "docker": "Docker disponível", + "community-title": "Precisa de ajuda para escolher uma plataforma?", + "community-description": "Converse sobre seu ambiente com a comunidade Adoptium.", + "community-cta": "Participe da conversa" + }, + "sustainer": { + "title": "Torne-se um mantenedor corporativo", + "subtitle": "Apoie o Eclipse Temurin", + "description": "Ajude a manter a infraestrutura, os testes e a distribuição que tornam o Eclipse Temurin disponível para todos.", + "form-title": "Inicie uma conversa", + "form-description": "Conte-nos sobre sua organização e nossa equipe ajudará você a encontrar a melhor forma de apoiar o Temurin.", + "thanks-title": "Obrigado pelo seu apoio", + "thanks-description": "Recebemos sua solicitação. Nossa equipe entrará em contato para conversar sobre como se tornar um mantenedor corporativo.", + "options-title": "Explore suas opções", + "options-description": "Conheça os benefícios para mantenedores, a associação e outras formas de participar." + }, + "slack": { + "title": "Participe da conversa", + "subtitle": "Comunidade Adoptium", + "description": "Conecte-se com usuários, colaboradores e mantenedores do Eclipse Adoptium no Slack.", + "card-title": "Uma comunidade em torno do Java de código aberto", + "card-description": "Faça perguntas, compartilhe sua experiência e colabore com o Eclipse Temurin e outros projetos do Adoptium.", + "cta": "Entre no Slack", + "hint": "Abre o convite para o Slack do Adoptium em uma nova aba.", + "support": "Precisa de ajuda com o Temurin?", + "support-description": "Explore as opções de ajuda da comunidade e de suporte comercial.", + "support-cta": "Obter suporte" + }, + "events": { + "title": "Conheça a comunidade", + "subtitle": "Eventos e comunidade", + "description": "Encontre reuniões da comunidade Adoptium e eventos da Eclipse Foundation, online e pelo mundo.", + "upcoming": "Eventos da Eclipse Foundation", + "calendar-title": "Calendário da comunidade Adoptium", + "calendar-description": "Acompanhe as reuniões da comunidade, conheça outros colaboradores e compartilhe seus trabalhos em andamento.", + "view-calendar": "Ver calendário", + "subscribe": "Assinar o calendário iCal", + "calendar-hint": "Reuniões da comunidade, de segurança, do AQAvit e do site, datas de lançamento e outros encontros online.", + "all-events": "Ver todos os eventos da Eclipse Foundation", + "submit": "Enviar um evento", + "empty": "Nenhum evento está disponível no momento. Consulte o calendário para ver as reuniões da comunidade." + }, + "news": { + "title": "Notícias e novidades", + "subtitle": "Da comunidade Adoptium", + "description": "Anúncios do projeto, notícias sobre lançamentos e histórias de todo o ecossistema Java.", + "filters": "Explore as últimas notícias", + "sources": "Todas as fontes", + "tags": "Todas as tags", + "authors": "Todos os autores", + "remove-tag": "Remover tag: {tag}", + "read-more": "Leia mais", + "read-article": "Ler artigo", + "tag-title": "Artigos com a tag {tag}", + "tag": "Tag", + "source": "Fonte", + "author": "Autor", + "submit": "Enviar notícia", + "empty": "Nenhum artigo corresponde aos seus filtros.", + "empty-description": "Tente ajustar ou limpar os filtros.", + "no-results": "Nenhum resultado encontrado" + }, + "stats": { + "title": "Estatísticas de downloads do Adoptium", + "subtitle": "Dados do projeto", + "description": "Explore os downloads do Eclipse Temurin e de imagens Docker por versão e plataforma.", + "trends-title": "Tendências de downloads", + "trends-description": "Compare os downloads e as obtenções de imagens Docker ao longo do tempo.", + "downloads": "Downloads", + "trends": "Tendências", + "total": "Total de downloads", + "github": "Downloads do GitHub", + "docker": "Downloads de imagens Docker", + "popular": "Versões mais populares do JDK", + "github-version": "Downloads do GitHub por versão", + "daily": "Downloads diários", + "monthly": "Downloads mensais", + "version": "Versão do JDK", + "source": "Fonte", + "visible": "Mostrar séries", + "type": "Tipo", + "days": "Dias", + "series": "Série {number}", + "daily-label": "Diário", + "monthly-label": "Mensal", + "total-label": "Total", + "docker-note": "Os filtros de versão do JDK não incluem resultados do repositório oficial do Docker.", + "by-source": "Downloads por fonte", + "drilldown": "Explore os downloads por lançamento" + }, + "release-notes": { + "description": "Explore as alterações, correções e melhorias nas versões do Eclipse Temurin.", + "lts": "Suporte de longo prazo", + "features": "Versões com novas funcionalidades", + "back": "Todas as versões", + "loading": "Carregando notas da versão…", + "filters": "Filtrar alterações", + "export": "Exportar CSV", + "rows": "Linhas por página", + "priority": "Prioridade", + "type": "Tipo", + "component": "Componente", + "issue": "Problema", + "summary": "Resumo", + "all-priorities": "Todas as prioridades", + "all-types": "Todos os tipos", + "all-components": "Todos os componentes", + "empty": "Nenhuma alteração corresponde a estes filtros.", + "results": "{count} alterações", + "page": "Página {page} de {total}", + "p1": "{count} problemas críticos", + "sort": "Ordenar por prioridade", + "view": "Ver notas da versão", + "hidden": "Não visível publicamente", + "priority-1": "Bloqueia o desenvolvimento ou os testes; o ambiente de produção não pode funcionar.", + "priority-2": "Falhas, perda de dados ou vazamentos graves de memória.", + "priority-3": "Perda significativa de funcionalidade.", + "priority-4": "Pequena perda de funcionalidade ou um problema com uma solução alternativa simples.", + "priority-5": "Problemas estéticos, como erros de ortografia ou alinhamento.", + "priority-6": "Este problema não é visível publicamente." + }, + "nightly": { + "filter-title": "Encontre uma compilação de acesso antecipado" + } } } diff --git a/locales/zh-CN.json b/locales/zh-CN.json index b99b102d..f38c1da9 100644 --- a/locales/zh-CN.json +++ b/locales/zh-CN.json @@ -40,6 +40,99 @@ "title": "很抱歉,无法找到此页面", "back-to-home": "返回首页" }, + "BusinessBenefits": { + "support": { + "title": "需要 Temurin 支持?", + "description": "Eclipse Temurin 拥有活跃的开发者和用户社区。如果您需要帮助,请联系我们。", + "cta": "获取支持" + }, + "contact": { + "title": "联系我们,了解 Temurin 如何助力您的业务", + "description": "准备好参与了吗?请填写成员申请表,迈出共同塑造 Adoptium 未来的第一步。", + "cta": "联系我们" + }, + "usage": { + "title": "其他企业如何使用 Temurin", + "description": "了解行业领先企业如何利用 Temurin 提升性能,并推动开发流程创新。" + }, + "adopters": { + "title": "Eclipse Temurin® 用户企业", + "description": "在生产环境中使用 Eclipse Temurin 的企业。" + }, + "header": { + "title": "Eclipse Temurin® 如何助力您的业务", + "subtitle": "业务优势", + "description": "Eclipse Temurin 提供高性能、跨平台的开源 Java 运行时二进制文件,适用于企业环境,并经过 Java SE TCK 测试,可广泛用于 Java 生态系统。", + "contact": "联系我们" + } + }, + "JoinPage": { + "title": "加入工作组", + "subtitle": "加入 Eclipse Adoptium® 工作组", + "form-title": "联系我们", + "form-description": "请介绍您的组织,以及您希望如何参与 Eclipse Adoptium。", + "options-title": "探索参与方式", + "options-description": "了解成员资格、赞助以及为我们的项目做贡献的方式。" + }, + "SupportingAnnouncement": { + "brand": "ECLIPSE ADOPTIUM", + "member": { + "title": "成为 Adoptium 成员", + "description": "加入 Adoptium 工作组,支持开源 Java 的未来。了解成员资格选项及其权益。", + "cta": "了解更多" + }, + "sustainer": { + "title": "成为支持者", + "description": "加入 Eclipse Temurin 支持计划,支持发展最快的开源 JDK。您的支持将助力更强的安全性、更快的发布、可直接部署的构建、质量测试和社区发展。", + "cta": "了解更多" + }, + "bloomberg": { + "title": "案例研究:Bloomberg 转向开源 Java", + "description": "了解 Eclipse Temurin 如何助力全球金融基础设施。", + "cta": "阅读案例研究" + } + }, + "NavBar": { + "Join Us": "加入我们", + "Become a Member": "成为成员", + "Our Members": "我们的成员", + "Become an Individual Sustainer": "成为个人支持者", + "Become a Corporate Sustainer": "成为企业支持者", + "Our Sustainers": "我们的支持者", + "Contribute to Adoptium": "为 Adoptium 做贡献", + "Become an Adopter": "登记使用案例", + "Our Adopters": "我们的用户企业", + "Latest Releases": "最新发行版", + "Marketplace": "市场", + "Projects": "项目", + "What We Do": "我们的工作", + "Eclipse Temurin": "Eclipse Temurin", + "Eclipse AQAvit": "Eclipse AQAvit", + "Eclipse Mission Control": "Eclipse Mission Control", + "Eclipse Migration Toolkit": "Eclipse Migration Toolkit", + "Resources": "资源", + "Status": "服务状态", + "Release Notes": "发行说明", + "Installation Guide": "安装指南", + "Documentation": "文档", + "FAQs": "常见问题", + "Brand & Promotion": "品牌与推广", + "Community": "社区", + "Support": "支持", + "News": "新闻", + "Events": "活动", + "Slack": "Slack", + "Membership": "成员资格", + "Sponsorship": "赞助", + "Contribute": "贡献", + "Adopt": "使用", + "Join Us Overview": "参与方式", + "Global": "主导航", + "Adoptium Logo": "Adoptium 标志", + "notifications": "通知", + "Open main menu": "打开主菜单", + "Close menu": "关闭菜单" + }, "WhatWeDo": { "mission": "携手共建开放的 Java", "community": "社区主导的协作", @@ -121,6 +214,7 @@ } }, "RandomContributors": { + "become-contributor": "成为贡献者", "thank-you": "感谢我们的 300+ 位贡献者", "thank-you-mobile": "感谢 我们的 300+ 位贡献者" }, @@ -328,5 +422,156 @@ }, "Byline": { "reading-time": "{minutes} 分钟阅读" + }, + "ModernPages": { + "common": { + "learn-more": "了解更多", + "loading": "加载中…", + "all": "全部", + "previous": "上一页", + "next": "下一页" + }, + "temurin": { + "resources-title": "开始使用 Temurin", + "resources-description": "安装 Temurin、查阅文档,或帮助支持项目的持续发展。", + "install-description": "查找适用于您的操作系统和开发工具的安装说明。", + "docs-description": "查阅 Eclipse Temurin 的配置和使用指南。", + "sponsor-title": "支持项目", + "sponsor-description": "捐助将用于支持 Eclipse Temurin 背后的基础设施和社区。", + "contact-title": "让 Temurin 为您的企业服务", + "contact-description": "与我们的社区一起探索成本节约、商业支持和软件供应链安全。", + "contact": "联系我们", + "community": "与社区交流" + }, + "platforms": { + "title": "支持的平台", + "description": "了解最新 Eclipse Temurin 版本的操作系统兼容性。", + "intro": "展开操作系统条目,比较 JDK 版本和 Docker 可用性。", + "supported": "支持", + "unsupported": "不支持", + "docker": "提供 Docker 镜像", + "community-title": "选择平台时需要帮助?", + "community-description": "与 Adoptium 社区讨论您的运行环境。", + "community-cta": "加入讨论" + }, + "sustainer": { + "title": "成为企业长期赞助者", + "subtitle": "支持 Eclipse Temurin", + "description": "帮助维持基础设施、测试和分发服务,让每个人都能使用 Eclipse Temurin。", + "form-title": "与我们交流", + "form-description": "向我们介绍您的组织,我们的团队将帮助您找到合适的方式来支持 Temurin。", + "thanks-title": "感谢您的支持", + "thanks-description": "我们已收到您的咨询。我们的团队将与您联系,讨论成为企业长期赞助者的相关事宜。", + "options-title": "探索参与方式", + "options-description": "了解长期赞助者权益、会员资格及其他参与方式。" + }, + "slack": { + "title": "加入讨论", + "subtitle": "Adoptium 社区", + "description": "在 Slack 上与 Eclipse Adoptium 的用户、贡献者和维护者交流。", + "card-title": "围绕开源 Java 构建的社区", + "card-description": "提出问题、分享经验,并参与 Eclipse Temurin 及其他 Adoptium 项目的协作。", + "cta": "加入 Slack", + "hint": "在新标签页中打开 Adoptium Slack 邀请链接。", + "support": "需要 Temurin 方面的帮助?", + "support-description": "了解社区帮助和商业支持选项。", + "support-cta": "获取支持" + }, + "events": { + "title": "结识社区成员", + "subtitle": "活动与社区", + "description": "查找在线上和世界各地举办的 Adoptium 社区会议及 Eclipse 基金会活动。", + "upcoming": "Eclipse 基金会活动", + "calendar-title": "Adoptium 社区日历", + "calendar-description": "掌握社区会议动态,结识其他贡献者,分享您的工作进展。", + "view-calendar": "查看日历", + "subscribe": "订阅 iCal 日历", + "calendar-hint": "社区会议、安全会议、AQAvit 和网站会议、发布日期以及其他线上聚会。", + "all-events": "查看所有 Eclipse 基金会活动", + "submit": "提交活动", + "empty": "目前没有可显示的活动。请查看日历以了解社区会议安排。" + }, + "news": { + "title": "新闻与动态", + "subtitle": "来自 Adoptium 社区", + "description": "项目公告、版本发布新闻以及整个 Java 生态系统的精彩故事。", + "filters": "浏览最新资讯", + "sources": "所有来源", + "tags": "所有标签", + "authors": "所有作者", + "remove-tag": "移除标签:{tag}", + "read-more": "阅读更多", + "read-article": "阅读文章", + "tag-title": "带有 {tag} 标签的文章", + "tag": "标签", + "source": "来源", + "author": "作者", + "submit": "提交新闻", + "empty": "没有符合筛选条件的文章。", + "empty-description": "请尝试调整或清除筛选条件。", + "no-results": "未找到结果" + }, + "stats": { + "title": "Adoptium 下载统计", + "subtitle": "项目数据概览", + "description": "了解各版本和平台的 Eclipse Temurin 下载量及 Docker 镜像拉取量。", + "trends-title": "下载趋势", + "trends-description": "比较下载量和 Docker 镜像拉取量随时间的变化。", + "downloads": "下载量", + "trends": "趋势", + "total": "总下载量", + "github": "GitHub 下载量", + "docker": "Docker 拉取量", + "popular": "最受欢迎的 JDK 版本", + "github-version": "按版本统计的 GitHub 下载量", + "daily": "每日下载量", + "monthly": "每月下载量", + "version": "JDK 版本", + "source": "来源", + "visible": "显示数据系列", + "type": "类型", + "days": "天数", + "series": "系列 {number}", + "daily-label": "每日", + "monthly-label": "每月", + "total-label": "总计", + "docker-note": "JDK 版本筛选不包含 Docker 官方仓库的结果。", + "by-source": "按来源统计的下载量", + "drilldown": "按发行版本查看下载量" + }, + "release-notes": { + "description": "了解 Eclipse Temurin 各版本的变更、修复和改进。", + "lts": "长期支持", + "features": "功能版本", + "back": "所有版本", + "loading": "正在加载发行说明…", + "filters": "筛选变更", + "export": "导出 CSV", + "rows": "每页行数", + "priority": "优先级", + "type": "类型", + "component": "组件", + "issue": "问题", + "summary": "摘要", + "all-priorities": "所有优先级", + "all-types": "所有类型", + "all-components": "所有组件", + "empty": "没有符合筛选条件的变更。", + "results": "{count} 项变更", + "page": "第 {page} 页,共 {total} 页", + "p1": "{count} 个严重问题", + "sort": "按优先级排序", + "view": "查看发行说明", + "hidden": "不公开", + "priority-1": "阻碍开发或测试,生产环境无法运行。", + "priority-2": "崩溃、数据丢失或严重的内存泄漏。", + "priority-3": "重大功能缺失。", + "priority-4": "轻微功能缺失,或有简单规避方法的问题。", + "priority-5": "拼写或对齐等外观问题。", + "priority-6": "此问题不公开。" + }, + "nightly": { + "filter-title": "查找早期访问构建" + } } } diff --git a/src/app/[locale]/__tests__/__snapshots__/page.test.tsx.snap b/src/app/[locale]/__tests__/__snapshots__/page.test.tsx.snap index 9ce13162..3545f2f1 100644 --- a/src/app/[locale]/__tests__/__snapshots__/page.test.tsx.snap +++ b/src/app/[locale]/__tests__/__snapshots__/page.test.tsx.snap @@ -1267,7 +1267,7 @@ exports[`Index page > renders correctly 1`] = `

- ECLIPSE ADOPTIUM + Text

renders correctly 1`] = ` rel="noopener noreferrer" target="_blank" > - Become a Contributor + + Text + - + +
+
+
+
+ setIsSubmitted(true)} + />
- ) -} \ No newline at end of file + + + + ); +} diff --git a/src/app/[locale]/become-a-sustainer/__tests__/BecomeSustainerClient.test.tsx b/src/app/[locale]/become-a-sustainer/__tests__/BecomeSustainerClient.test.tsx new file mode 100644 index 00000000..0a9ebfe8 --- /dev/null +++ b/src/app/[locale]/become-a-sustainer/__tests__/BecomeSustainerClient.test.tsx @@ -0,0 +1,69 @@ +// Some portions generated by Co-Pilot +import { fireEvent, render, screen } from "@testing-library/react"; +import { describe, expect, it, vi } from "vitest"; +import BecomeSustainerClient from "../BecomeSustainerClient"; + +vi.mock("next-intl", async () => { + const actual = await vi.importActual("next-intl"); + const messages = (await import("@/../locales/en.json")).default; + return { + ...actual, + useTranslations: (namespace: "ModernPages.sustainer" | "NavBar") => + actual.createTranslator({ locale: "en", messages, namespace }), + }; +}); + +vi.mock("@/components/HubspotForm", () => ({ + default: ({ + portalId, + formId, + onFormSubmit, + }: { + portalId: string; + formId: string; + onFormSubmit: () => void; + }) => ( + + ), +})); + +describe("Corporate sustainer enquiry", () => { + it("preserves the production HubSpot form and related destinations", () => { + render(); + expect( + screen.getByRole("heading", { + level: 1, + name: "Become a Corporate Sustainer", + }), + ).toBeInTheDocument(); + const form = screen.getByRole("button", { + name: "Simulate hosted form callback", + }); + expect(form).toHaveAttribute("data-portal", "5413615"); + expect(form).toHaveAttribute( + "data-form", + "6e3e994e-5bc8-4a6e-91b3-d3f331b69402", + ); + expect( + screen.getByRole("link", { name: "Become a Corporate Sustainer" }), + ).toHaveAttribute("href", "/sustainers"); + expect( + screen.getByRole("link", { name: "Become a Member" }), + ).toHaveAttribute("href", "/members"); + }); + + it("announces the original form submission callback without unmounting the form", () => { + render(); + fireEvent.click( + screen.getByRole("button", { name: "Simulate hosted form callback" }), + ); + expect(screen.getByRole("status")).toHaveTextContent( + "Thank you for your support", + ); + expect( + screen.getByRole("button", { name: "Simulate hosted form callback" }), + ).toBeInTheDocument(); + }); +}); diff --git a/src/app/[locale]/become-a-sustainer/__tests__/__snapshots__/page.test.tsx.snap b/src/app/[locale]/become-a-sustainer/__tests__/__snapshots__/page.test.tsx.snap index 3c23bc1a..fef661a0 100644 --- a/src/app/[locale]/become-a-sustainer/__tests__/__snapshots__/page.test.tsx.snap +++ b/src/app/[locale]/become-a-sustainer/__tests__/__snapshots__/page.test.tsx.snap @@ -2,87 +2,192 @@ exports[`BecomeASustainer page > renders correctly 1`] = ` `; diff --git a/src/app/[locale]/business-benefits/__tests__/__snapshots__/page.test.tsx.snap b/src/app/[locale]/business-benefits/__tests__/__snapshots__/page.test.tsx.snap index d9815407..048de03e 100644 --- a/src/app/[locale]/business-benefits/__tests__/__snapshots__/page.test.tsx.snap +++ b/src/app/[locale]/business-benefits/__tests__/__snapshots__/page.test.tsx.snap @@ -1,111 +1,949 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`Business Benefits page > renders correctly 1`] = ` -
-
+
-
+ class="max-w-3xl" + > +
+ Business Benefits +
+

+ How Eclipse Temurin® can benefit your business +

+
+ Eclipse Temurin offers high-performance, cross-platform, open-source Java runtime binaries that are enterprise-ready and Java SE TCK-tested for general use in the Java ecosystem. +
+
+ class="flex flex-wrap items-center gap-3 lg:pb-1" + > + + + Download Temurin® + + + + + + Contact Us + + + +
+
+
-
+ How other companies are using Temurin +

+

+ Discover how industry leaders leverage Temurin to enhance performance and drive innovation in their development processes. +

+ +
+
-
-
+ +
+

+ Performance & Reliability +

+

+ Run your enterprise applications with confidence using Eclipse Temurin, a secure, high-performance Java runtime rigorously tested for stability and optimized for seamless operation across diverse environments. +

+
+
+
+ +
-
-
+ + + +
+ 02 + +

+ Cost-Effective Innovation +

+

+ Adopt high-quality open source Java with no licensing fees. Reduce costs while benefiting from a robust ecosystem that ensures long-term sustainability and enterprise-ready runtime performance. +

+ +
- Eclipse Temurin offers high-performance, cross-platform, open-source Java runtime binaries that are enterprise-ready and Java SE TCK-tested for general use in the Java ecosystem. + + + +
- +

+ Empowering Developers +

+

+ Boost developer productivity with Eclipse Temurin's consistent, cross-platform builds. Focus on innovation while relying on a dependable, high-quality runtime trusted by millions worldwide. +

+
- +
-

- How other companies are using Temurin -

-

+ Eclipse Temurin® Adopters + +

+ Companies that use Eclipse Temurin in production. +

+
+
- Discover how industry leaders leverage Temurin to enhance performance and drive innovation in their development processes. -

- -
-
@@ -122,7 +960,7 @@ exports[`Business Benefits page > renders correctly 1`] = ` class="mb-7 max-w-sm text-3xl font-semibold leading-tight tracking-tight sm:text-4xl" id="_r_0_" > - Text + Built together. Trusted worldwide.
renders correctly 1`] = `
-
-

- Need support with Temurin? -

-

- Eclipse Temurin is supported by a vibrant community of developers and users. If you need help, please reach out to us. -

- - - - + Need support with Temurin? + +

+ Eclipse Temurin is supported by a vibrant community of developers and users. If you need help, please reach out to us. +

+
- + +
-
- message icon -

- Contact us about how Temurin can help your business -

- - Ready to get involved? Fill out our membership form and take the first step in shaping the future of Adoptium. - +

+ Contact us about how Temurin can help your business +

+
+ Ready to get involved? Fill out our membership form and take the first step in shaping the future of Adoptium. +
+
- + +
diff --git a/src/app/[locale]/business-benefits/__tests__/page.test.tsx b/src/app/[locale]/business-benefits/__tests__/page.test.tsx index d9d9d8e5..c1e9a885 100644 --- a/src/app/[locale]/business-benefits/__tests__/page.test.tsx +++ b/src/app/[locale]/business-benefits/__tests__/page.test.tsx @@ -1,26 +1,123 @@ -import React from "react" -import { render } from "@testing-library/react" -import { describe, expect, it, vi } from "vitest" -import { axe } from "vitest-axe" -import BusinessBenefits from "../page" +// Some portions generated by Co-Pilot +import React from "react"; +import { fireEvent, render, screen } from "@testing-library/react"; +import { afterEach, describe, expect, it, vi } from "vitest"; +import { axe } from "vitest-axe"; +import BusinessBenefits from "../page"; +import adopters from "@/data/adopters.json"; +import testimonials from "@/data/testimonials.json"; +import englishMessages from "../../../../../locales/en.json"; +import chineseMessages from "../../../../../locales/zh-CN.json"; -vi.mock("@/components/Logos", () => { +const translationState = vi.hoisted(() => ({ locale: "en" })); + +vi.mock("next-intl", async (importOriginal) => { + const original = await importOriginal(); return { - __esModule: true, - default: () =>
, - LogoType: {}, - } -}) + ...original, + useLocale: () => translationState.locale, + useTranslations: ( + namespace?: + | keyof typeof englishMessages + | "BusinessBenefits.header" + | "BusinessBenefits.adopters" + | "BusinessBenefits.usage" + | "BusinessBenefits.support" + | "BusinessBenefits.contact", + ) => + original.createTranslator({ + locale: translationState.locale, + messages: + translationState.locale === "zh-CN" + ? chineseMessages + : englishMessages, + namespace, + }), + }; +}); + +vi.unmock("@/data/adopters.json"); describe("Business Benefits page", () => { + afterEach(() => { + translationState.locale = "en"; + }); it("renders correctly", () => { - const { container } = render() - expect(container.firstChild).toMatchSnapshot() - }) + const { container } = render(); + expect(container.firstChild).toMatchSnapshot(); + }); it("has no accessibility violations", async () => { - const { container } = render() - const results = await axe(container) - expect(results).toHaveNoViolations() - }) -}) + const { container } = render(); + const results = await axe(container); + expect(results).toHaveNoViolations(); + }); + + it("uses one primary heading and direct download, support and contact links", () => { + const { container } = render(); + expect(screen.getAllByRole("heading", { level: 1 })).toHaveLength(1); + expect( + screen.getByRole("heading", { + level: 1, + name: "How Eclipse Temurin® can benefit your business", + }), + ).toBeVisible(); + expect( + container.querySelector('a[href="/temurin/releases"]'), + ).toBeInTheDocument(); + expect(screen.getByRole("link", { name: "Get Support" })).toHaveAttribute( + "href", + "/support", + ); + for (const link of screen.getAllByRole("link", { name: "Contact Us" })) + expect(link).toHaveAttribute("href", "/join"); + expect(container.querySelector("a button")).not.toBeInTheDocument(); + }); + + it("preserves every adopter logo and organisation destination", () => { + const { container } = render(); + expect(container.querySelectorAll("#adopters a")).toHaveLength( + adopters.length, + ); + for (const adopter of adopters) + expect(screen.getByRole("link", { name: adopter.name })).toHaveAttribute( + "href", + adopter.url, + ); + }); + + it("keeps the original member testimonials and manual selection", () => { + render(); + fireEvent.click(screen.getByRole("button", { name: "Red Hat" })); + const mark = testimonials.find( + (testimonial) => testimonial.name === "Mark Little", + )!; + expect(screen.getByText(mark.quote, { exact: false })).toBeVisible(); + expect(screen.getByText(mark.name)).toBeVisible(); + expect(screen.getByRole("button", { name: "Red Hat" })).toHaveAttribute( + "aria-pressed", + "true", + ); + }); + + it("translates support and contact content into Chinese while preserving destinations", () => { + translationState.locale = "zh-CN"; + render(); + const messages = chineseMessages.BusinessBenefits; + expect( + screen.getByRole("heading", { name: messages.support.title }), + ).toBeVisible(); + expect(screen.getByText(messages.support.description)).toBeVisible(); + expect( + screen.getByRole("link", { name: messages.support.cta }), + ).toHaveAttribute("href", "/support"); + expect( + screen.getByRole("heading", { name: messages.contact.title }), + ).toBeVisible(); + expect(screen.getByText(messages.contact.description)).toBeVisible(); + for (const link of screen.getAllByRole("link", { + name: messages.contact.cta, + })) + expect(link).toHaveAttribute("href", "/join"); + }); +}); diff --git a/src/app/[locale]/business-benefits/page.tsx b/src/app/[locale]/business-benefits/page.tsx index a86bae24..e7837b40 100644 --- a/src/app/[locale]/business-benefits/page.tsx +++ b/src/app/[locale]/business-benefits/page.tsx @@ -1,10 +1,14 @@ -import { Metadata } from "next"; +// Some portions generated by Co-Pilot +import type { Metadata } from "next"; +import { useTranslations } from "next-intl"; +import { FiArrowRight, FiDownload } from "react-icons/fi"; +import { Link } from "@/i18n/navigation"; import PageHeader from "@/components/Common/PageHeader"; import UsingTemurin from "@/components/About/UsingTemurin"; import Logos, { LogoType } from "@/components/Logos"; import Testimonials from "@/components/Testimonials"; -import ImageText from "@/components/ImageText"; import ContactUs from "@/components/ContactUs"; +import SectionHeading from "@/components/Common/SectionHeading"; export const metadata: Metadata = { title: "Business Benefits", @@ -13,29 +17,72 @@ export const metadata: Metadata = { }; export default function BusinessBenefitsPage() { + const tHome = useTranslations("HomePage"); + const t = useTranslations("BusinessBenefits.header"); + const tAdopters = useTranslations("BusinessBenefits.adopters"); + const tSupport = useTranslations("BusinessBenefits.support"); + const tContact = useTranslations("BusinessBenefits.contact"); return ( -
+
+ + {tHome("download-temurin-button")} +
diff --git a/src/app/[locale]/events/__tests__/__snapshots__/page.test.tsx.snap b/src/app/[locale]/events/__tests__/__snapshots__/page.test.tsx.snap index f38977fd..fc92fd48 100644 --- a/src/app/[locale]/events/__tests__/__snapshots__/page.test.tsx.snap +++ b/src/app/[locale]/events/__tests__/__snapshots__/page.test.tsx.snap @@ -2,204 +2,185 @@ exports[`Events page > renders correctly 1`] = `
-
-
-
-
-
-
-
- - - - -
- Events -
-
-
- Eclipse Foundation Events -
+ Text
+

+ Text +

- Follow the latest Eclipse Foundation Events + Text
-
+
-
-

- Upcoming Events -

-
-
-
-
+
-
- -
-
-
- -
+ Text + +
+
+ diff --git a/src/app/[locale]/events/page.tsx b/src/app/[locale]/events/page.tsx index 638f7e48..b21bacea 100644 --- a/src/app/[locale]/events/page.tsx +++ b/src/app/[locale]/events/page.tsx @@ -1,32 +1,33 @@ -import { Metadata } from "next" -import React from "react" -import PageHeader from "@/components/Common/PageHeader" -import Timeline from "@/components/Events/Timeline" -import Calendar from "@/components/Events/Calendar" +// Some portions generated by Co-Pilot +import { Metadata } from "next"; +import React from "react"; +import { useTranslations } from "next-intl"; +import SectionHeading from "@/components/Common/SectionHeading"; +import PageHeader from "@/components/Common/PageHeader"; +import Timeline from "@/components/Events/Timeline"; +import Calendar from "@/components/Events/Calendar"; export const metadata: Metadata = { - title: "Events", - description: "Learn about upcoming events and how to participate in the Eclipse Adoptium community.", -} + title: "Events", + description: + "Learn about upcoming events and how to participate in the Eclipse Adoptium community.", +}; export default function EventsPage() { - return ( -
- -
-
-

- Upcoming Events -

-
- - -
-
- ) -} \ No newline at end of file + const t = useTranslations("ModernPages.events"); + return ( +
+ +
+ + + +
+
+ ); +} diff --git a/src/app/[locale]/join/__tests__/__snapshots__/page.test.tsx.snap b/src/app/[locale]/join/__tests__/__snapshots__/page.test.tsx.snap index 20ad85ee..f41079e4 100644 --- a/src/app/[locale]/join/__tests__/__snapshots__/page.test.tsx.snap +++ b/src/app/[locale]/join/__tests__/__snapshots__/page.test.tsx.snap @@ -1,88 +1,202 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`Join page > renders correctly 1`] = ` -
-
+
-
-
+ class="max-w-3xl" + > +
+ Join the Eclipse Adoptium® Working Group +
+

+ Joining the Working Group +

+
+ Eclipse Temurin offers high-performance, cross-platform, open-source Java runtime binaries that are enterprise-ready and Java SE TCK-tested for general use in the Java ecosystem. +
+
+
+
-
- +
+
+
-
- -
-
- Eclipse Temurin offers high-performance, cross-platform, open-source Java runtime binaries that are enterprise-ready and Java SE TCK-tested for general use in the Java ecosystem. -
-
-
-
-
-
`; diff --git a/src/app/[locale]/join/__tests__/page.test.tsx b/src/app/[locale]/join/__tests__/page.test.tsx index 0aac01b4..6ef82059 100644 --- a/src/app/[locale]/join/__tests__/page.test.tsx +++ b/src/app/[locale]/join/__tests__/page.test.tsx @@ -1,18 +1,106 @@ -import React from "react" -import { render } from "@testing-library/react" -import { describe, expect, it } from "vitest" -import { axe } from "vitest-axe" -import Join from "../page" +// Some portions generated by Co-Pilot +import React from "react"; +import { fireEvent, render, screen } from "@testing-library/react"; +import { describe, expect, it, vi } from "vitest"; +import { axe } from "vitest-axe"; +import Join from "../page"; +import englishMessages from "../../../../../locales/en.json"; +import chineseMessages from "../../../../../locales/zh-CN.json"; + +const translationState = vi.hoisted(() => ({ locale: "en" })); + +vi.mock("next-intl", async (importOriginal) => { + const original = await importOriginal(); + return { + ...original, + useTranslations: ( + namespace: "JoinPage" | "NavBar" | "BusinessBenefits.header", + ) => + original.createTranslator({ + locale: translationState.locale, + messages: + translationState.locale === "zh-CN" + ? chineseMessages + : englishMessages, + namespace, + }), + }; +}); describe("Join page", () => { it("renders correctly", () => { - const { container } = render() - expect(container.firstChild).toMatchSnapshot() - }) + const { container } = render(); + expect(container.firstChild).toMatchSnapshot(); + }); it("has no accessibility violations", async () => { - const { container } = render() - const results = await axe(container) - expect(results).toHaveNoViolations() - }) -}) + const { container } = render(); + const results = await axe(container); + expect(results).toHaveNoViolations(); + }); + + it("uses a single primary heading and preserves the hosted form mount", () => { + const { container } = render(); + expect(screen.getAllByRole("heading", { level: 1 })).toHaveLength(1); + expect(container.querySelector("#hubspotForm")).toBeInTheDocument(); + expect(container.querySelector(".joinForm")).toBeInTheDocument(); + expect( + screen.getByRole("heading", { level: 2, name: "Get in touch" }), + ).toBeVisible(); + expect( + screen.getByRole("link", { name: "Become a Member" }), + ).toHaveAttribute("href", "/members"); + expect( + screen.getByRole("link", { name: "Become a Corporate Sustainer" }), + ).toHaveAttribute("href", "/sustainers"); + expect( + screen.getByRole("link", { name: "Contribute to Adoptium" }), + ).toHaveAttribute("href", "/contributing"); + }); + + it("renders a translated Chinese header, form introduction and related links", () => { + translationState.locale = "zh-CN"; + try { + render(); + expect( + screen.getByRole("heading", { + level: 1, + name: chineseMessages.JoinPage.title, + }), + ).toBeVisible(); + expect( + screen.getByText(chineseMessages.JoinPage["form-description"]), + ).toBeVisible(); + expect( + screen.getByRole("link", { + name: chineseMessages.NavBar["Become a Member"], + }), + ).toHaveAttribute("href", "/members"); + } finally { + translationState.locale = "en"; + } + }); + + it("retains the existing HubSpot portal and form IDs", () => { + const previous = window.hbspt; + const create = vi.fn(); + window.hbspt = { forms: { create } }; + try { + render(); + const script = document.querySelector( + 'script[src="https://js.hsforms.net/forms/v2.js"]', + ); + expect(script).toBeInTheDocument(); + fireEvent.load(script!); + expect(create).toHaveBeenCalledWith( + expect.objectContaining({ + portalId: "5413615", + formId: "78aa6887-715f-420c-97be-b97860899cec", + target: "#hubspotForm", + }), + ); + } finally { + window.hbspt = previous; + } + }); +}); diff --git a/src/app/[locale]/join/page.tsx b/src/app/[locale]/join/page.tsx index 8a0d8136..7f588f17 100644 --- a/src/app/[locale]/join/page.tsx +++ b/src/app/[locale]/join/page.tsx @@ -1,26 +1,87 @@ -import { Metadata } from 'next' -import PageHeader from "@/components/Common/PageHeader" -import HubspotForm from "@/components/HubspotForm" +// Some portions generated by Co-Pilot +import type { Metadata } from "next"; +import { useTranslations } from "next-intl"; +import { FiArrowRight, FiMessageSquare } from "react-icons/fi"; +import { Link } from "@/i18n/navigation"; +import PageHeader from "@/components/Common/PageHeader"; +import HubspotForm from "@/components/HubspotForm"; export const metadata: Metadata = { - title: 'Join', - description: 'Join the Eclipse Adoptium Working Group to contribute to the development and maintenance of high-performance, cross-platform, open-source Java runtime binaries.', -} + title: "Join", + description: + "Join the Eclipse Adoptium Working Group to contribute to the development and maintenance of high-performance, cross-platform, open-source Java runtime binaries.", +}; + +const waysToJoin = [ + { label: "Become a Member", href: "/members" }, + { label: "Become a Corporate Sustainer", href: "/sustainers" }, + { label: "Contribute to Adoptium", href: "/contributing" }, +]; export default function JoinWGPage() { - return ( -
- -
- -
+ const t = useTranslations("JoinPage"); + const tNavigation = useTranslations("NavBar"); + const tBenefits = useTranslations("BusinessBenefits.header"); + return ( +
+ +
+
+
+ + +

+ {t("form-title")} +

+

+ {t("form-description")} +

+
+
- ) + +
+
+ ); } diff --git a/src/app/[locale]/news/__tests__/__snapshots__/page.test.tsx.snap b/src/app/[locale]/news/__tests__/__snapshots__/page.test.tsx.snap index f3b571d6..aedf2825 100644 --- a/src/app/[locale]/news/__tests__/__snapshots__/page.test.tsx.snap +++ b/src/app/[locale]/news/__tests__/__snapshots__/page.test.tsx.snap @@ -3,80 +3,33 @@ exports[`NewsPage (root) > renders header and NewsPageContent with resolved searchParams 1`] = `
-
-
-
-
-
-
-
- - - - -
- News -
-
-
- News & Updates -
+ From the Adoptium community
+

+ News & updates +

- Follow the latest updates from the Eclipse Adoptium Project + Project announcements, release news and stories from across the Java ecosystem.
-
+
diff --git a/src/app/[locale]/news/__tests__/page.test.tsx b/src/app/[locale]/news/__tests__/page.test.tsx index 3a6c575c..b2311718 100644 --- a/src/app/[locale]/news/__tests__/page.test.tsx +++ b/src/app/[locale]/news/__tests__/page.test.tsx @@ -1,9 +1,20 @@ +// Some portions generated by Co-Pilot import { describe, it, expect, vi, afterEach } from "vitest"; import { render, screen } from "@testing-library/react"; import { axe } from "vitest-axe"; import NewsPage from "../page"; +vi.mock("next-intl/server", async () => { + const { createTranslator } = + await vi.importActual("next-intl"); + const messages = (await import("@/../locales/en.json")).default; + return { + getTranslations: async (namespace: "ModernPages.news") => + createTranslator({ locale: "en", messages, namespace }), + }; +}); + // Mock child component vi.mock("@/components/News/NewsPageContent", () => ({ default: vi.fn((props) => ( @@ -31,7 +42,9 @@ describe("NewsPage (root)", () => { const { container } = render(element); // Header rendered - expect(screen.getByText("News & Updates")).toBeInTheDocument(); + expect( + screen.getByRole("heading", { level: 1, name: "News & updates" }), + ).toBeInTheDocument(); // Child rendered expect(screen.getByTestId("news-page-content")).toBeInTheDocument(); diff --git a/src/app/[locale]/news/author/[author]/__tests__/__snapshots__/page.test.tsx.snap b/src/app/[locale]/news/author/[author]/__tests__/__snapshots__/page.test.tsx.snap index 9ec0ddd8..b1e22bf2 100644 --- a/src/app/[locale]/news/author/[author]/__tests__/__snapshots__/page.test.tsx.snap +++ b/src/app/[locale]/news/author/[author]/__tests__/__snapshots__/page.test.tsx.snap @@ -8,74 +8,27 @@ exports[`AuthorNewsPage > renders header and news when posts exist 1`] = ` > {"@context":"https://schema.org","@graph":[{"@type":"Person","name":"Jane Doe","description":"No biography available","affiliation":{"@type":"Organization","name":"Eclipse Adoptium"},"url":"https://adoptium.net/news/author/jane-doe"},{"@type":"CollectionPage","@id":"https://adoptium.net/news/author/jane-doe","name":"Posts by Jane Doe","url":"https://adoptium.net/news/author/jane-doe","mainEntity":[{"@type":"BlogPosting","headline":"Author News","url":"https://adoptium.net/news/2025/06/author-news","datePublished":"2025-06-18T00:00:00.000Z"}]}]} -
-
-
-
-
-
-
- - - - -
- Author -
-
-
- Jane Doe -
+ Author
+

+ Jane Doe +

renders header and news when posts exist 1`] = `
-
+
+

+ Text +

renders header and news when posts exist 1`] = ` class="inline-flex items-center gap-1.5 text-sm font-medium text-pink hover:underline transition-colors" href="[object Object]" > - Read more + Text renders header and news when posts exist 1`] = `
- +
- Submit News + Text { + const { createTranslator } = + await vi.importActual("next-intl"); + const messages = (await import("@/../locales/en.json")).default; + return { + getTranslations: async (namespace: "ModernPages.news") => + createTranslator({ locale: "en", messages, namespace }), + }; +}); import { render, screen } from "@testing-library/react"; import { axe } from "vitest-axe"; diff --git a/src/app/[locale]/news/author/[author]/page.tsx b/src/app/[locale]/news/author/[author]/page.tsx index 61ee7b3e..408f8bc7 100644 --- a/src/app/[locale]/news/author/[author]/page.tsx +++ b/src/app/[locale]/news/author/[author]/page.tsx @@ -1,4 +1,6 @@ +// Some portions generated by Co-Pilot import React from "react"; +import { getTranslations } from "next-intl/server"; import { notFound } from "next/navigation"; import { getNewsByAuthor } from "@/utils/news"; import PageHeader from "@/components/Common/PageHeader"; @@ -95,6 +97,7 @@ export default async function AuthorNewsPage({ }; const sanitizedJsonLd = sanitizeObject(jsonLdSchema); + const t = await getTranslations("ModernPages.news"); return (
@@ -106,11 +109,10 @@ export default async function AuthorNewsPage({ }} /> {authorData.name || t("author")}} description={} - className="mx-auto max-w-[860px] px-2 w-full" - compact /> renders news and header for author and page w > {"@context":"https://schema.org","@graph":[{"@type":"Person","name":"Jane Doe","affiliation":{"@type":"Organization","name":"Eclipse Adoptium"},"url":"https://adoptium.net/news/author/jane-doe"},{"@type":"CollectionPage","@id":"https://adoptium.net/news/author/jane-doe/page/2","name":"Posts by Jane Doe - Page 2","url":"https://adoptium.net/news/author/jane-doe/page/2","isPartOf":{"@type":"CollectionPage","@id":"https://adoptium.net/news/author/jane-doe"},"mainEntity":[{"@type":"BlogPosting","headline":"Author Page 2 News","url":"https://adoptium.net/news/2025/06/author-page-2-news","datePublished":"2025-06-18T00:00:00.000Z"}]}]} -
-
-
-
-
-
-
- - - - -
- Author -
-
-
- Jane Doe -
+ Author
+

+ Jane Doe +

renders news and header for author and page w
-
+
+

+ Text +

renders news and header for author and page w class="inline-flex items-center gap-1.5 text-sm font-medium text-pink hover:underline transition-colors" href="[object Object]" > - Read more + Text renders news and header for author and page w
-
+
- Submit News + Text { + const { createTranslator } = + await vi.importActual("next-intl"); + const messages = (await import("@/../locales/en.json")).default; + return { + getTranslations: async (namespace: "ModernPages.news") => + createTranslator({ locale: "en", messages, namespace }), + }; +}); import { render, screen } from "@testing-library/react"; import { axe } from "vitest-axe"; diff --git a/src/app/[locale]/news/author/[author]/page/[page]/page.tsx b/src/app/[locale]/news/author/[author]/page/[page]/page.tsx index 69ccd593..d77c6e73 100644 --- a/src/app/[locale]/news/author/[author]/page/[page]/page.tsx +++ b/src/app/[locale]/news/author/[author]/page/[page]/page.tsx @@ -1,4 +1,6 @@ +// Some portions generated by Co-Pilot import React from "react"; +import { getTranslations } from "next-intl/server"; import { notFound, redirect } from "next/navigation"; import { getNewsByAuthor } from "@/utils/news"; import PageHeader from "@/components/Common/PageHeader"; @@ -94,6 +96,7 @@ export default async function AuthorNewsPagePaginated({ }; const sanitizedJsonLd = sanitizeObject(jsonLdSchema); + const t = await getTranslations("ModernPages.news"); return (
@@ -105,11 +108,10 @@ export default async function AuthorNewsPagePaginated({ }} /> {authorData.name || t("author")}} description={} - className="mx-auto max-w-[860px] px-2 w-full" - compact /> renders header and passes correct props to NewsPageContent 1`] = `
-
-
-
-
-
-
-
- - - - -
- News -
-
-
- News & Updates -
+ From the Adoptium community
+

+ News & updates +

- Follow the latest updates from the Eclipse Adoptium Project + Project announcements, release news and stories from across the Java ecosystem.
-
+
diff --git a/src/app/[locale]/news/page/[page]/__tests__/page.test.tsx b/src/app/[locale]/news/page/[page]/__tests__/page.test.tsx index 8ad404cf..3fd75c4d 100644 --- a/src/app/[locale]/news/page/[page]/__tests__/page.test.tsx +++ b/src/app/[locale]/news/page/[page]/__tests__/page.test.tsx @@ -1,4 +1,15 @@ +// Some portions generated by Co-Pilot import { describe, it, expect, vi, afterEach } from "vitest"; + +vi.mock("next-intl/server", async () => { + const { createTranslator } = + await vi.importActual("next-intl"); + const messages = (await import("@/../locales/en.json")).default; + return { + getTranslations: async (namespace: "ModernPages.news") => + createTranslator({ locale: "en", messages, namespace }), + }; +}); import { render, screen } from "@testing-library/react"; import { axe } from "vitest-axe"; import NewsPage from "../page"; @@ -57,7 +68,9 @@ describe("NewsPage (paginated)", () => { const { container } = render(element); // Header exists - expect(screen.getByText("News & Updates")).toBeInTheDocument(); + expect( + screen.getByRole("heading", { level: 1, name: "News & updates" }), + ).toBeInTheDocument(); // Child rendered expect(screen.getByTestId("news-page-content")).toBeInTheDocument(); diff --git a/src/app/[locale]/news/page/[page]/page.tsx b/src/app/[locale]/news/page/[page]/page.tsx index 5e7e7ec5..3a8c87f5 100644 --- a/src/app/[locale]/news/page/[page]/page.tsx +++ b/src/app/[locale]/news/page/[page]/page.tsx @@ -1,4 +1,6 @@ +// Some portions generated by Co-Pilot import { notFound, redirect } from "next/navigation"; +import { getTranslations } from "next-intl/server"; import PageHeader from "@/components/Common/PageHeader"; import NewsPageContent from "@/components/News/NewsPageContent"; @@ -8,6 +10,7 @@ interface PageProps { } export default async function NewsPage({ params, searchParams }: PageProps) { + const t = await getTranslations("ModernPages.news"); const resolvedParams = await params; const resolvedSearchParams = await searchParams; @@ -23,11 +26,10 @@ export default async function NewsPage({ params, searchParams }: PageProps) { return (
renders header and news when posts exist 1`] = ` > {"@context":"https://schema.org","@type":"CollectionPage","@id":"https://adoptium.net/news/tag/temurin","name":"Posts tagged with "temurin"","url":"https://adoptium.net/news/tag/temurin","mainEntity":[{"@type":"BlogPosting","headline":"Tagged News","url":"https://adoptium.net/news/2025/06/tagged-news","datePublished":"2025-06-18T00:00:00.000Z"}]} -
-
-
-
-
-
-
- - - - -
- News -
-
-
- News tagged with "temurin" -
+ News & updates
+

+ Stories tagged with temurin +

- Follow the latest updates from the Eclipse Adoptium Project + Project announcements, release news and stories from across the Java ecosystem.
-
+
+

+ Text +

renders header and news when posts exist 1`] = ` class="inline-flex items-center gap-1.5 text-sm font-medium text-pink hover:underline transition-colors" href="[object Object]" > - Read more + Text renders header and news when posts exist 1`] = `
-
+
- Submit News + Text { + const { createTranslator } = + await vi.importActual("next-intl"); + const messages = (await import("@/../locales/en.json")).default; + return { + getTranslations: async (namespace: "ModernPages.news") => + createTranslator({ locale: "en", messages, namespace }), + }; +}); import { render, screen } from "@testing-library/react"; import { axe } from "vitest-axe"; @@ -58,7 +69,12 @@ describe("TagsPage (tag root)", () => { const { container } = render(element); - expect(screen.getByText('News tagged with "temurin"')).toBeInTheDocument(); + expect( + screen.getByRole("heading", { + level: 1, + name: "Stories tagged with temurin", + }), + ).toBeInTheDocument(); expect(screen.getByText("Tagged News")).toBeInTheDocument(); expect(container).toMatchSnapshot(); diff --git a/src/app/[locale]/news/tag/[tag]/page.tsx b/src/app/[locale]/news/tag/[tag]/page.tsx index b9dfdddf..c3a11306 100644 --- a/src/app/[locale]/news/tag/[tag]/page.tsx +++ b/src/app/[locale]/news/tag/[tag]/page.tsx @@ -1,4 +1,6 @@ +// Some portions generated by Co-Pilot import React from "react"; +import { getTranslations } from "next-intl/server"; import { notFound } from "next/navigation"; import { getNewsByTag } from "@/utils/news"; import PageHeader from "@/components/Common/PageHeader"; @@ -52,6 +54,7 @@ export default async function TagsPage({ }; const sanitizedJsonLd = sanitizeObject(jsonLdSchema); + const t = await getTranslations("ModernPages.news"); return (
@@ -63,11 +66,10 @@ export default async function TagsPage({ }} /> {t("tag-title", { tag })}} + description={t("description")} /> renders news and header for tag and page w > {"@context":"https://schema.org","@type":"CollectionPage","@id":"https://adoptium.net/news/tag/temurin/page/2","name":"Posts tagged with "temurin" - Page 2","url":"https://adoptium.net/news/tag/temurin/page/2","isPartOf":{"@type":"CollectionPage","@id":"https://adoptium.net/news/tag/temurin"},"mainEntity":[{"@type":"BlogPosting","headline":"Tagged Page 2 News","url":"https://adoptium.net/news/2025/06/tagged-page-2-news","datePublished":"2025-06-18T00:00:00.000Z"}]} -
-
-
-
-
-
-
- - - - -
- News -
-
-
- News tagged with "temurin" -
+ News & updates
+

+ Stories tagged with temurin +

- Follow the latest updates from the Eclipse Adoptium Project + Project announcements, release news and stories from across the Java ecosystem.
-
+
+

+ Text +

renders news and header for tag and page w class="inline-flex items-center gap-1.5 text-sm font-medium text-pink hover:underline transition-colors" href="[object Object]" > - Read more + Text renders news and header for tag and page w
-
+
- Submit News + Text { + const { createTranslator } = + await vi.importActual("next-intl"); + const messages = (await import("@/../locales/en.json")).default; + return { + getTranslations: async (namespace: "ModernPages.news") => + createTranslator({ locale: "en", messages, namespace }), + }; +}); import { render, screen } from "@testing-library/react"; import { axe } from "vitest-axe"; @@ -85,7 +96,12 @@ describe("TaggedNewsPage (paginated)", () => { const { container } = render(element); - expect(screen.getByText('News tagged with "temurin"')).toBeInTheDocument(); + expect( + screen.getByRole("heading", { + level: 1, + name: "Stories tagged with temurin", + }), + ).toBeInTheDocument(); expect(screen.getByText("Tagged Page 2 News")).toBeInTheDocument(); expect(container).toMatchSnapshot(); diff --git a/src/app/[locale]/news/tag/[tag]/page/[page]/page.tsx b/src/app/[locale]/news/tag/[tag]/page/[page]/page.tsx index bc567a5a..89c4a6ff 100644 --- a/src/app/[locale]/news/tag/[tag]/page/[page]/page.tsx +++ b/src/app/[locale]/news/tag/[tag]/page/[page]/page.tsx @@ -1,4 +1,6 @@ +// Some portions generated by Co-Pilot import React from "react"; +import { getTranslations } from "next-intl/server"; import { redirect, notFound } from "next/navigation"; import { getNewsByTag } from "@/utils/news"; import PageHeader from "@/components/Common/PageHeader"; @@ -65,6 +67,7 @@ export default async function TaggedNewsPage({ }; const sanitizedJsonLd = sanitizeObject(jsonLdSchema); + const t = await getTranslations("ModernPages.news"); return (
@@ -76,11 +79,10 @@ export default async function TaggedNewsPage({ }} /> {t("tag-title", { tag })}} + description={t("description")} /> renders correctly 1`] = `
-
`; diff --git a/src/app/[locale]/slack/page.tsx b/src/app/[locale]/slack/page.tsx index f91c68aa..c2d02e6f 100644 --- a/src/app/[locale]/slack/page.tsx +++ b/src/app/[locale]/slack/page.tsx @@ -1,33 +1,63 @@ -import { Metadata } from "next" -import React from "react" -import PageHeader from "@/components/Common/PageHeader" +// Some portions generated by Co-Pilot +import { Metadata } from "next"; +import React from "react"; +import { useTranslations } from "next-intl"; +import { FiArrowUpRight, FiMessageSquare } from "react-icons/fi"; +import PageHeader from "@/components/Common/PageHeader"; +import ContactUs from "@/components/ContactUs"; export const metadata: Metadata = { - title: "Slack", - description: "Join our Slack community to connect with other Eclipse Adoptium users and contributors.", -} + title: "Slack", + description: + "Join our Slack community to connect with other Eclipse Adoptium users and contributors.", +}; export default function SlackPage() { - return ( -
- -
-

- Join our Slack community to connect with other Eclipse Adoptium users and contributors. - Share your experiences, ask questions, and collaborate on projects. -

- - Join Slack - -
+ const t = useTranslations("ModernPages.slack"); + return ( +
+ +
+
+
- ) +
+ +
+ ); } diff --git a/src/app/[locale]/stats/__tests__/layout.test.tsx b/src/app/[locale]/stats/__tests__/layout.test.tsx new file mode 100644 index 00000000..ef46eb83 --- /dev/null +++ b/src/app/[locale]/stats/__tests__/layout.test.tsx @@ -0,0 +1,36 @@ +// Some portions generated by Co-Pilot +import { render, screen } from "@testing-library/react"; +import { describe, expect, it, vi } from "vitest"; +import StatsLayout from "../layout"; + +vi.mock("next-intl/server", async () => { + const { createTranslator } = + await vi.importActual("next-intl"); + const messages = (await import("@/../locales/en.json")).default; + return { + getTranslations: async (namespace: "ModernPages.stats") => + createTranslator({ locale: "en", messages, namespace }), + }; +}); + +vi.mock("@/components/Dashboard/Nav", () => ({ + default: () => , +})); + +describe("Statistics layout", () => { + it("shares the same heading and navigation around either tab", async () => { + const { rerender } = render( + await StatsLayout({ children:
Downloads content
}), + ); + const header = screen.getByRole("heading", { + level: 1, + name: "Adoptium download statistics", + }); + const tabs = screen.getByRole("navigation", { name: "Statistics" }); + rerender(await StatsLayout({ children:
Trends content
})); + expect(screen.getByRole("heading", { level: 1 })).toBe(header); + expect(screen.getByRole("navigation", { name: "Statistics" })).toBe(tabs); + expect(screen.getByText("Trends content")).toBeInTheDocument(); + expect(screen.queryByText("Downloads content")).not.toBeInTheDocument(); + }); +}); diff --git a/src/app/[locale]/stats/download/page.tsx b/src/app/[locale]/stats/download/page.tsx index 8fd2fcd7..34816ccb 100644 --- a/src/app/[locale]/stats/download/page.tsx +++ b/src/app/[locale]/stats/download/page.tsx @@ -1,30 +1,28 @@ // Some portions generated by Co-Pilot import { Metadata } from "next"; import React from "react"; -import startCase from "lodash/startCase"; +import { getLocale, getTranslations } from "next-intl/server"; import { IoCloudDownloadOutline } from "react-icons/io5"; import { FaGithub, FaDocker } from "react-icons/fa"; -import PageHeader from "@/components/Common/PageHeader"; import { fetchDownloadStats } from "@/utils/fetchDownloadStats"; import { fetchAvailableReleases } from "@/utils/fetchAvailableReleases"; import PieChart from "@/components/Dashboard/PieChart"; import ColumnDrilldown from "@/components/Dashboard/ColumnDrilldown"; import StackedBarChart from "@/components/Dashboard/StackedBarChart"; -import StatsNav from "@/components/Dashboard/Nav"; export const metadata: Metadata = { title: "Download Dashboard", description: "View download statistics for Temurin releases", }; -function formatCompact(n: number): string { - if (n >= 1_000_000_000) return (n / 1_000_000_000).toFixed(1) + "B"; - if (n >= 1_000_000) return (n / 1_000_000).toFixed(1) + "M"; - if (n >= 1_000) return (n / 1_000).toFixed(1) + "K"; - return n.toLocaleString(); -} - export default async function DownloadStatsPage() { + const t = await getTranslations("ModernPages.stats"); + const locale = await getLocale(); + const formatCompact = (value: number) => + new Intl.NumberFormat(locale, { + notation: "compact", + maximumFractionDigits: 1, + }).format(value); const availableReleases = await fetchAvailableReleases(); (availableReleases.available_releases ?? []).sort((a, b) => a - b); @@ -39,7 +37,7 @@ export default async function DownloadStatsPage() { totalPieChartData = Object.keys(data.total_downloads) .filter((key) => key !== "total") .map((key) => ({ - name: startCase(key), + name: key === "docker_pulls" ? t("docker") : t("github"), y: data.total_downloads[key as keyof typeof data.total_downloads], })); } @@ -68,49 +66,38 @@ export default async function DownloadStatsPage() { return (
- - -
+
{/* Summary stat cards */} -
-
+
+

{formatCompact(total)}

-

Total Downloads

+

{t("total")}

-
+

{formatCompact(totalGithub)}

-

- GitHub Downloads -

+

{t("github")}

-
+

{formatCompact(totalDocker)}

-

- Docker Official Image Pulls -

+

{t("docker")}

{/* Top 5 versions by GitHub downloads */} -
-

- Most Popular Versions (GitHub Downloads) -

+
+

{t("popular")}

+

{t("github")}

{topVersions.map((v, i) => (
))}
-
+
{/* Source breakdown pie */} -
-
+
+
-
+
{/* GitHub downloads per version bar chart */} -
+
{/* Detailed drilldown */} -
-

- GitHub Release Downloads (Drilldown) -

+
+

{t("drilldown")}

-
+
); diff --git a/src/app/[locale]/stats/layout.tsx b/src/app/[locale]/stats/layout.tsx new file mode 100644 index 00000000..1f557d04 --- /dev/null +++ b/src/app/[locale]/stats/layout.tsx @@ -0,0 +1,26 @@ +// Some portions generated by Co-Pilot +import type { ReactNode } from "react"; +import { getTranslations } from "next-intl/server"; +import PageHeader from "@/components/Common/PageHeader"; +import StatsNav from "@/components/Dashboard/Nav"; + +export default async function StatsLayout({ + children, +}: { + children: ReactNode; +}) { + const t = await getTranslations("ModernPages.stats"); + + return ( + <> + + + {children} + + ); +} diff --git a/src/app/[locale]/stats/trends/__tests__/trends-client.test.tsx b/src/app/[locale]/stats/trends/__tests__/trends-client.test.tsx new file mode 100644 index 00000000..2343dd47 --- /dev/null +++ b/src/app/[locale]/stats/trends/__tests__/trends-client.test.tsx @@ -0,0 +1,127 @@ +// Some portions generated by Co-Pilot +import { + act, + fireEvent, + render, + screen, + waitFor, + within, +} from "@testing-library/react"; +import { afterEach, describe, expect, it, vi } from "vitest"; +import DownloadTrendsPage from "../trends-client"; + +vi.mock("next-intl", async () => { + const actual = await vi.importActual("next-intl"); + const messages = (await import("@/../locales/en.json")).default; + return { + ...actual, + useLocale: () => "en", + useTranslations: (namespace: "ModernPages.stats" | "ModernPages.common") => + actual.createTranslator({ locale: "en", messages, namespace }), + }; +}); + +vi.mock("@/utils/fetchAvailableReleases", () => ({ + fetchAvailableReleases: async () => ({ available_releases: [21, 25] }), +})); +vi.mock("@/components/Dashboard/LineChart", () => ({ + default: (props: object) => ( + {JSON.stringify(props)} + ), +})); +vi.mock("@/components/Dashboard/BarChart", () => ({ + default: (props: object) => ( + {JSON.stringify(props)} + ), +})); + +afterEach(() => vi.unstubAllGlobals()); + +function renderTrends() { + const fetchMock = vi.fn(async (url: string) => ({ + ok: true, + json: async () => + url.includes("/monthly/") + ? [{ month: "2026-10", monthly: 5, total: 20 }] + : [{ date: "2026-10-01", daily: 2, total: 10 }], + })); + vi.stubGlobal("fetch", fetchMock); + render(); + return fetchMock; +} + +describe("Download trends controls", () => { + it("renders both charts", async () => { + renderTrends(); + expect(await screen.findByTestId("line-chart")).toHaveTextContent( + '"data":[2]', + ); + expect(screen.getByTestId("bar-chart")).toHaveTextContent('"Oct 2026":5'); + }); + + it("preserves source and version filtering", async () => { + const fetchMock = renderTrends(); + await screen.findByTestId("line-chart"); + const series = await screen.findByRole("group", { name: "Series 1" }); + fireEvent.click(within(series).getByRole("radio", { name: "GitHub" })); + fireEvent.change( + within(series).getByRole("combobox", { name: "JDK version" }), + { + target: { value: "25" }, + }, + ); + await waitFor(() => + expect(fetchMock).toHaveBeenCalledWith( + expect.stringContaining("source=github&feature_version=25"), + ), + ); + }); + + it("updates the range using the keyboard and keeps visibility controls labelled", async () => { + const fetchMock = renderTrends(); + await screen.findByTestId("line-chart"); + const series = await screen.findByRole("group", { name: "Series 1" }); + expect( + within(series).getByRole("checkbox", { name: "Show series" }), + ).toBeChecked(); + const slider = screen.getByRole("slider", { name: "Days" }); + fireEvent.change(slider, { target: { value: "60" } }); + fireEvent.keyUp(slider, { key: "ArrowRight" }); + await waitFor(() => + expect(fetchMock).toHaveBeenCalledWith( + expect.stringContaining("days=60"), + ), + ); + }); + + it("keeps the chart slots and controls mounted throughout loading", async () => { + const ready = Promise.withResolvers(); + vi.stubGlobal( + "fetch", + vi.fn(async () => { + await ready.promise; + return { ok: true, json: async () => [] }; + }), + ); + const { container } = render(); + const dashboard = container.firstElementChild; + const chartSlots = container.querySelectorAll(".h-\\[400px\\]"); + const controls = screen.getAllByRole("combobox", { name: "JDK version" }); + expect(dashboard).toHaveAttribute("aria-busy", "true"); + expect(chartSlots).toHaveLength(2); + expect(screen.getByText(/^Loading/)).toBeInTheDocument(); + controls.forEach((control) => expect(control).toBeDisabled()); + + await act(async () => ready.resolve()); + await screen.findByTestId("line-chart"); + expect(container.firstElementChild).toBe(dashboard); + expect(dashboard).toHaveAttribute("aria-busy", "false"); + expect(container.querySelectorAll(".h-\\[400px\\]")[0]).toBe(chartSlots[0]); + screen + .getAllByRole("combobox", { name: "JDK version" }) + .forEach((control, index) => { + expect(control).toBe(controls[index]); + expect(control).toBeEnabled(); + }); + }); +}); diff --git a/src/app/[locale]/stats/trends/trends-client.tsx b/src/app/[locale]/stats/trends/trends-client.tsx index b5be48d4..6bd320f9 100644 --- a/src/app/[locale]/stats/trends/trends-client.tsx +++ b/src/app/[locale]/stats/trends/trends-client.tsx @@ -1,400 +1,585 @@ -"use client" +// Some portions generated by Co-Pilot +"use client"; import React, { useEffect, useState } from "react"; -import PageHeader from "@/components/Common/PageHeader"; +import { useLocale, useTranslations } from "next-intl"; import { fetchAvailableReleases } from "@/utils/fetchAvailableReleases"; import BarChart from "@/components/Dashboard/BarChart"; import LineChart from "@/components/Dashboard/LineChart"; -import StatsNav from "@/components/Dashboard/Nav"; interface SeriesType { - name: string; - data: (number | null)[]; - visible: boolean; - type?: string; + name: string; + data: (number | null)[]; + visible: boolean; + type?: string; } type ArgsType = { - visible: boolean; - type: 'daily' | 'total'; - source?: string; - feature_version: string; - jvm_impl?: string; + visible: boolean; + type: "daily" | "total"; + source?: string; + feature_version: string; + jvm_impl?: string; }; type MonthlyArgsType = { - type: 'monthly' | 'total'; - source?: string; - feature_version: string; - jvm_impl?: string; + type: "monthly" | "total"; + source?: string; + feature_version: string; + jvm_impl?: string; }; -const defaultArgs: ArgsType = { visible: true, type: 'daily', feature_version: '' }; -const defaultArgs2: ArgsType = { visible: false, type: 'daily', feature_version: '' }; -const defaultMonthlyArgs: MonthlyArgsType = { type: 'monthly', feature_version: '' }; - -const monthNames = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; +const defaultArgs: ArgsType = { + visible: true, + type: "daily", + feature_version: "", +}; +const defaultArgs2: ArgsType = { + visible: false, + type: "daily", + feature_version: "", +}; +const defaultMonthlyArgs: MonthlyArgsType = { + type: "monthly", + feature_version: "", +}; -function parseMonth(month: string) { - const b = month.split('-'); - return monthNames[Number(b[1]) - 1] + ' ' + b[0]; +function parseMonth(month: string, locale: string) { + const [year, value] = month.split("-").map(Number); + return new Intl.DateTimeFormat(locale, { + month: "short", + year: "numeric", + timeZone: "UTC", + }).format(new Date(Date.UTC(year, value - 1, 1))); } function processData( - data: Array<{ daily: number; total: number }>, - type: 'daily' | 'total', - visible: boolean, - name: string + data: Array<{ daily: number; total: number }>, + type: "daily" | "total", + visible: boolean, + name: string, ): SeriesType { - let typeData: (number | null)[] = []; - switch (type) { - case 'daily': - typeData = data.map(({ daily }) => daily); - break; - case 'total': - typeData = data.map(({ total }) => total); - break; - } - return { - name, - data: typeData, - visible: data.length !== 0 && visible, - type: 'line', - }; + let typeData: (number | null)[] = []; + switch (type) { + case "daily": + typeData = data.map(({ daily }) => daily); + break; + case "total": + typeData = data.map(({ total }) => total); + break; + } + return { + name, + data: typeData, + visible: data.length !== 0 && visible, + type: "line", + }; } function max(arr1: string[] = [], arr2: string[] = []) { - return arr1.length > arr2.length ? arr1 : arr2; + return arr1.length > arr2.length ? arr1 : arr2; } function padArray(state: SeriesType, diff: number): SeriesType { - return { - ...state, - data: Array(diff).fill(null).concat(state.data), - }; + return { + ...state, + data: Array(diff).fill(null).concat(state.data), + }; } -function createSeries(series: SeriesType, series2: SeriesType): Highcharts.SeriesOptionsType[] { - const s1 = { ...series, data: [...series.data] }; - const s2 = { ...series2, data: [...series2.data] }; - s1.data.splice(0, s1.data.lastIndexOf(null) + 1); - s2.data.splice(0, s2.data.lastIndexOf(null) + 1); - const diff = s1.data.length - s2.data.length; - const arr: SeriesType[] = diff > 0 ? [s1, padArray(s2, diff)] : diff < 0 ? [padArray(s1, -diff), s2] : [s1, s2]; - return arr.map(s => ({ - type: 'line', - name: s.name, - data: s.data, - visible: s.visible, - })) as Highcharts.SeriesOptionsType[]; +function createSeries( + series: SeriesType, + series2: SeriesType, +): Highcharts.SeriesOptionsType[] { + const s1 = { ...series, data: [...series.data] }; + const s2 = { ...series2, data: [...series2.data] }; + s1.data.splice(0, s1.data.lastIndexOf(null) + 1); + s2.data.splice(0, s2.data.lastIndexOf(null) + 1); + const diff = s1.data.length - s2.data.length; + const arr: SeriesType[] = + diff > 0 + ? [s1, padArray(s2, diff)] + : diff < 0 + ? [padArray(s1, -diff), s2] + : [s1, s2]; + return arr.map((s) => ({ + type: "line", + name: s.name, + data: s.data, + visible: s.visible, + })) as Highcharts.SeriesOptionsType[]; } -const sourceOptions = [ - { label: 'All', value: '' }, - { label: 'Github', value: 'github' }, - { label: 'Docker', value: 'dockerhub' }, -]; - -const typeOptions = [ - { label: 'Daily', value: 'daily' }, - { label: 'Total', value: 'total' }, -]; - -const monthlyTypeOptions = [ - { label: 'Monthly', value: 'monthly' }, - { label: 'Total', value: 'total' }, -]; - -function NativeRadioGroup({ name, value, options, onChange }: { name: string, value: T, options: { label: string, value: T }[], onChange: (v: T) => void }) { - const checkedValue = value ?? ""; - return ( -
- {options.map(opt => ( - - ))} -
- ); +function NativeRadioGroup({ + name, + value, + options, + onChange, +}: { + name: string; + value: T; + options: { label: string; value: T }[]; + onChange: (v: T) => void; +}) { + const checkedValue = value ?? ""; + return ( +
+ {options.map((opt) => ( + + ))} +
+ ); } -function NativeCheckbox({ checked, onChange }: { checked: boolean, onChange: (v: boolean) => void }) { - return ( - ) => onChange(e.target.checked)} className="accent-blue-500 w-4 h-4" /> - ); +function NativeCheckbox({ + checked, + onChange, + label, +}: { + checked: boolean; + onChange: (v: boolean) => void; + label: string; +}) { + return ( + ) => + onChange(e.target.checked) + } + className="h-4 w-4 accent-pink" + /> + ); } -function NativeSlider({ value, min, max, onChange, onAfterChange }: { value: number, min: number, max: number, onChange: (v: number) => void, onAfterChange: () => void }) { - return ( - ) => onChange(Number(e.target.value))} - onMouseUp={onAfterChange} - onTouchEnd={onAfterChange} - className="w-full accent-blue-500 h-2 rounded-lg bg-gray-700" - /> - ); +function NativeSlider({ + value, + min, + max, + onChange, + onAfterChange, + label, +}: { + value: number; + min: number; + max: number; + onChange: (v: number) => void; + onAfterChange: () => void; + label: string; +}) { + return ( + ) => + onChange(Number(e.target.value)) + } + onMouseUp={onAfterChange} + onTouchEnd={onAfterChange} + onKeyUp={(event) => { + if ( + [ + "ArrowLeft", + "ArrowRight", + "ArrowUp", + "ArrowDown", + "Home", + "End", + "PageUp", + "PageDown", + ].includes(event.key) + ) + onAfterChange(); + }} + className="h-2 w-full rounded-lg bg-white/10 accent-pink" + /> + ); } function NativeSpinner() { - return ( -
- - - - - Loading... -
- ); + const t = useTranslations("ModernPages.common"); + return ( +
+ + {t("loading")} +
+ ); } interface FiltersBoxProps { - argsObj: T; - setArgsObj: React.Dispatch>; - versions: number[] | undefined; - isMonthly?: boolean; - groupId: string; + argsObj: T; + setArgsObj: React.Dispatch>; + versions: number[] | undefined; + isMonthly?: boolean; + groupId: string; } function FiltersBox({ - argsObj, - setArgsObj, - versions, - isMonthly = false, - groupId, + argsObj, + setArgsObj, + versions, + isMonthly = false, + groupId, }: FiltersBoxProps) { - const generateVersions = () => { - const versionOpts: { label: string; value: string }[] = [{ label: 'All', value: '' }]; - if (versions) { - for (const version of versions) { - versionOpts.push({ label: 'JDK ' + version, value: String(version) }); - } - } - return versionOpts; - }; - - function hasVisible(obj: ArgsType | MonthlyArgsType): obj is ArgsType { - return Object.prototype.hasOwnProperty.call(obj, 'visible'); + const t = useTranslations("ModernPages.stats"); + const tCommon = useTranslations("ModernPages.common"); + const sourceOptions = [ + { label: tCommon("all"), value: "" }, + { label: "GitHub", value: "github" }, + { label: "Docker", value: "dockerhub" }, + ]; + const typeOptions = [ + { + label: t(isMonthly ? "monthly-label" : "daily-label"), + value: isMonthly ? "monthly" : "daily", + }, + { label: t("total-label"), value: "total" }, + ]; + const generateVersions = () => { + const versionOpts: { label: string; value: string }[] = [ + { label: tCommon("all"), value: "" }, + ]; + if (versions) { + for (const version of versions) { + versionOpts.push({ label: "JDK " + version, value: String(version) }); + } } - - return ( -
-
Filters
-
-
- - - setArgsObj(prev => ({ - ...prev, - source: v === '' ? undefined : v, - })) - } - /> -
-
- - - setArgsObj(prev => ({ - ...prev, - feature_version: v, - })) - } - /> -
- {hasVisible(argsObj) && ( -
- - - setArgsObj(prev => ({ - ...prev, - visible: v, - })) - } - /> -
- )} -
- - - setArgsObj(prev => ({ - ...prev, - type: v, - })) - } - /> -
-
+ return versionOpts; + }; + + function hasVisible(obj: ArgsType | MonthlyArgsType): obj is ArgsType { + return Object.prototype.hasOwnProperty.call(obj, "visible"); + } + + return ( +
+ + {isMonthly ? t("monthly") : t("series", { number: groupId })} + +
+
+ + {t("source")} + + + setArgsObj((prev) => ({ + ...prev, + source: v === "" ? undefined : v, + })) + } + /> +
+
+ +
- ); + {hasVisible(argsObj) && ( +
+ + {t("visible")} + + + setArgsObj((prev) => ({ + ...prev, + visible: v, + })) + } + /> +
+ )} +
+ + {t("type")} + + + setArgsObj((prev) => ({ + ...prev, + type: v, + })) + } + /> +
+
+
+ ); } const DownloadTrendsPage: React.FC = () => { - const [series, setSeries] = useState(); - const [series2, setSeries2] = useState(); - const [monthlyData, setMonthlyData] = useState | undefined>(); - const [categories, setCategories] = useState(); - const [categories2, setCategories2] = useState(); - const [args, setArgs] = useState({ ...defaultArgs }); - const [args2, setArgs2] = useState({ ...defaultArgs2 }); - const [monthlyArgs, setMonthlyArgs] = useState({ ...defaultMonthlyArgs }); - const [days, setDays] = useState(30); - const [versions, setVersions] = useState(); - const [loading, setLoading] = useState(true); - - useEffect(() => { - (async () => { - setLoading(true); - const releases = await fetchAvailableReleases(); - setVersions(releases.available_releases); - await updateData(1, args); - await updateData(2, args2); - await updateMonthlyData(monthlyArgs); - setLoading(false); - })(); - // eslint-disable-next-line react-hooks/exhaustive-deps - }, []); - - useEffect(() => { - if (!loading) updateData(1, args); - // eslint-disable-next-line react-hooks/exhaustive-deps - }, [args]); - - useEffect(() => { - if (!loading) updateData(2, args2); - // eslint-disable-next-line react-hooks/exhaustive-deps - }, [args2]); - - useEffect(() => { - if (!loading) updateMonthlyData(monthlyArgs); - // eslint-disable-next-line react-hooks/exhaustive-deps - }, [monthlyArgs]); - - async function updateData(seriesID: number, argsObj: ArgsType) { - const params = generateParams(argsObj); - const data = await fetchTracking(params); - if (!data) return; - if (seriesID === 1) { - setSeries(processData(data, argsObj.type, argsObj.visible, 'Series 1')); - setCategories(data.map(({ date }: { date: string }) => formatDate(date))); - } else { - setSeries2(processData(data, argsObj.type, argsObj.visible, 'Series 2')); - setCategories2(data.map(({ date }: { date: string }) => formatDate(date))); - } - } - - async function updateMonthlyData(argsObj: MonthlyArgsType) { - const params = generateParams(argsObj); - const data: Array<{ month: string; monthly: number; total: number }> = await fetchMonthly(params); - if (!data) return; - const monthly: Record = {}; - data.forEach((d) => { - monthly[parseMonth(d.month)] = argsObj.type === 'monthly' ? d.monthly : d.total; - }); - setMonthlyData(monthly); - } - - function generateParams(argsObj: ArgsType | MonthlyArgsType) { - return { - source: argsObj.source || undefined, - feature_version: argsObj.feature_version !== '' ? Number(argsObj.feature_version) : undefined, - jvm_impl: argsObj.jvm_impl || undefined, - days, - }; - } - - function formatDate(date: string) { - const d = new Date(date); - return d.toLocaleDateString('en-GB'); + const t = useTranslations("ModernPages.stats"); + const locale = useLocale(); + const [series, setSeries] = useState(); + const [series2, setSeries2] = useState(); + const [monthlyData, setMonthlyData] = useState< + Record | undefined + >(); + const [categories, setCategories] = useState(); + const [categories2, setCategories2] = useState(); + const [args, setArgs] = useState({ ...defaultArgs }); + const [args2, setArgs2] = useState({ ...defaultArgs2 }); + const [monthlyArgs, setMonthlyArgs] = useState({ + ...defaultMonthlyArgs, + }); + const [days, setDays] = useState(30); + const [versions, setVersions] = useState(); + const [loading, setLoading] = useState(true); + + useEffect(() => { + (async () => { + setLoading(true); + const releases = await fetchAvailableReleases(); + setVersions(releases.available_releases); + await updateData(1, args); + await updateData(2, args2); + await updateMonthlyData(monthlyArgs); + setLoading(false); + })(); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, []); + + useEffect(() => { + if (!loading) updateData(1, args); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [args]); + + useEffect(() => { + if (!loading) updateData(2, args2); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [args2]); + + useEffect(() => { + if (!loading) updateMonthlyData(monthlyArgs); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [monthlyArgs]); + + async function updateData(seriesID: number, argsObj: ArgsType) { + const params = generateParams(argsObj); + const data = await fetchTracking(params); + if (!data) return; + if (seriesID === 1) { + setSeries( + processData( + data, + argsObj.type, + argsObj.visible, + t("series", { number: 1 }), + ), + ); + setCategories(data.map(({ date }: { date: string }) => formatDate(date))); + } else { + setSeries2( + processData( + data, + argsObj.type, + argsObj.visible, + t("series", { number: 2 }), + ), + ); + setCategories2( + data.map(({ date }: { date: string }) => formatDate(date)), + ); } - - async function fetchTracking(params: Record) { - const url = new URL('https://api.adoptium.net/v3/stats/downloads/tracking/'); - Object.entries(params).forEach(([key, value]) => { - if (value !== undefined) url.searchParams.append(key, String(value)); - }); - const res = await fetch(url.toString()); - if (!res.ok) return []; - return res.json() as Promise>; - } - async function fetchMonthly(params: Record) { - const url = new URL('https://api.adoptium.net/v3/stats/downloads/monthly/'); - Object.entries(params).forEach(([key, value]) => { - if (value !== undefined) url.searchParams.append(key, String(value)); - }); - const res = await fetch(url.toString()); - if (!res.ok) return []; - return res.json() as Promise>; - } - - if (loading) { - return ; - } - - return ( -
- = + await fetchMonthly(params); + if (!data) return; + const monthly: Record = {}; + data.forEach((d) => { + monthly[parseMonth(d.month, locale)] = + argsObj.type === "monthly" ? d.monthly : d.total; + }); + setMonthlyData(monthly); + } + + function generateParams(argsObj: ArgsType | MonthlyArgsType) { + return { + source: argsObj.source || undefined, + feature_version: + argsObj.feature_version !== "" + ? Number(argsObj.feature_version) + : undefined, + jvm_impl: argsObj.jvm_impl || undefined, + days, + }; + } + + function formatDate(date: string) { + const d = new Date(date); + return d.toLocaleDateString(locale); + } + + async function fetchTracking( + params: Record, + ) { + const url = new URL( + "https://api.adoptium.net/v3/stats/downloads/tracking/", + ); + Object.entries(params).forEach(([key, value]) => { + if (value !== undefined) url.searchParams.append(key, String(value)); + }); + const res = await fetch(url.toString()); + if (!res.ok) return []; + return res.json() as Promise< + Array<{ date: string; daily: number; total: number }> + >; + } + async function fetchMonthly( + params: Record, + ) { + const url = new URL("https://api.adoptium.net/v3/stats/downloads/monthly/"); + Object.entries(params).forEach(([key, value]) => { + if (value !== undefined) url.searchParams.append(key, String(value)); + }); + const res = await fetch(url.toString()); + if (!res.ok) return []; + return res.json() as Promise< + Array<{ month: string; monthly: number; total: number }> + >; + } + + return ( +
+
+
+ {loading ? ( + + ) : ( + - -
-
- -
- - -
-
Days
- { updateData(1, args); updateData(2, args2); }} - /> -
-
-
-
- -
- -
-
-

*Does not include results from the Official Docker Repo

+ )} +
+
+ + +
+
+ {t("days")}: {days}
+ { + updateData(1, args); + updateData(2, args2); + }} + /> +
+
+
+
+
+ {loading ? ( + - ); +
+ +
+
+

{t("docker-note")}

+
+ ); }; export default DownloadTrendsPage; diff --git a/src/app/[locale]/supported-platforms/__tests__/__snapshots__/page.test.tsx.snap b/src/app/[locale]/supported-platforms/__tests__/__snapshots__/page.test.tsx.snap index 2b7944bc..a5f1c0e4 100644 --- a/src/app/[locale]/supported-platforms/__tests__/__snapshots__/page.test.tsx.snap +++ b/src/app/[locale]/supported-platforms/__tests__/__snapshots__/page.test.tsx.snap @@ -2,287 +2,211 @@ exports[`Supported Platforms page > renders correctly 1`] = `
-
-
-
-
-
-
-
- - - - -
- Eclipse Temurin -
-
-
- Supported Platforms -
+ Eclipse Temurin
+

+ Text +

- Eclipse Temurin offers high-performance, cross-platform, open-source Java runtime binaries that are enterprise-ready and Java SE TCK-tested for general use in the Java ecosystem. + Text
-
-
+
-
-

- This section lists the operating systems that are supported with the latest release of Eclipse Temurin. -

-
-
+
    -
    - - Supported - -
    -
    +
  • - - Docker Available - -
  • -
    +
  • - - Not Supported - -
  • -
+ Text + +
-
-
-

- Text -

-
-
-
-
-
-
+ +
-
+
-
- message icon -

- Connect with the community -

- - Join our Slack channel to discuss work and reach out to project maintainers. - +

+ Text +

+
+ Text +
+
- + + +
diff --git a/src/app/[locale]/supported-platforms/page.tsx b/src/app/[locale]/supported-platforms/page.tsx index 502c2154..3c1548fc 100644 --- a/src/app/[locale]/supported-platforms/page.tsx +++ b/src/app/[locale]/supported-platforms/page.tsx @@ -1,34 +1,34 @@ -import { Metadata } from 'next' -import PageHeader from "@/components/Common/PageHeader" -import PlatformMatrix from "@/components/Support/PlatformMatrix" -import ContactUs from "@/components/ContactUs" +// Some portions generated by Co-Pilot +import { Metadata } from "next"; +import { useTranslations } from "next-intl"; +import PageHeader from "@/components/Common/PageHeader"; +import PlatformMatrix from "@/components/Support/PlatformMatrix"; +import ContactUs from "@/components/ContactUs"; export const metadata: Metadata = { - title: 'Temurin™ Supported Platforms', - description: 'View the supported platforms for Eclipse Temurin, the high-performance, cross-platform, open-source Java runtime binaries that are enterprise-ready and Java SE TCK-tested.', -} + title: "Temurin™ Supported Platforms", + description: + "View the supported platforms for Eclipse Temurin, the high-performance, cross-platform, open-source Java runtime binaries that are enterprise-ready and Java SE TCK-tested.", +}; export default function SupportedPlatformsPage() { - return ( -
- - - {/* */} - - {/*
- -
*/} -
- ) + const t = useTranslations("ModernPages.platforms"); + return ( +
+ + + +
+ ); } diff --git a/src/app/[locale]/temurin/__tests__/__snapshots__/page.test.tsx.snap b/src/app/[locale]/temurin/__tests__/__snapshots__/page.test.tsx.snap index cba86c73..48c635f1 100644 --- a/src/app/[locale]/temurin/__tests__/__snapshots__/page.test.tsx.snap +++ b/src/app/[locale]/temurin/__tests__/__snapshots__/page.test.tsx.snap @@ -477,410 +477,444 @@ exports[`TemurinIndex page > renders correctly 1`] = `
-

Text

-

Text -

- - - +

- Description - scroll divider -
-

+ + + +

Text -

-
+

Text -

-

-
-
- Description - scroll divider -
+ +
-

+ + + + +

Text -

-
+

Text -

-

-
-
- Description - scroll divider -
+ +
-

+ + + +

Text -

-
+

Text -

-

+

+
- -
+ + + + +
-

- Become a Sponsor -

-

- Contributions from users like you help fund critical operations of the Adoptium working group. All money contributed through the Eclipse Foundation ensures the survivability, continuity, and responsiveness of Adoptium projects. -

-
- - - -
+

+ Text +

+

+ Text +

+
-
+

- Installation Guide + Text

- Eclipse Temurin offers high-performance, cross-platform, open-source Java runtime. + Text

-
- - + + Text + + + -
-
-
+

- Documentation + Text

- Eclipse Temurin offers high-performance, cross-platform, open-source Java runtime. + Text

-
+ + + Text + + + + - + Text + +

+ Text +

+ + + Text + + +
-
-

- Want to discuss how Temurin can positively impact your company? -

-

- Whether you are looking for opportunities for cost-savings, or a selection of choices for commercial support, or if you want to bolster security around your software supply chain, we would love to discuss how using Temurin brings a variety of benefits to your enterprise. -

- - - - - - - -
-
-
-
-
- message icon -

- Speak to our team today -

- - Ready to get involved? Fill out our membership form and take the first step in shaping the future of Adoptium. - - +
+
diff --git a/src/app/[locale]/temurin/__tests__/page.test.tsx b/src/app/[locale]/temurin/__tests__/page.test.tsx index 08da99b5..19274881 100644 --- a/src/app/[locale]/temurin/__tests__/page.test.tsx +++ b/src/app/[locale]/temurin/__tests__/page.test.tsx @@ -5,6 +5,16 @@ import { describe, expect, it, vi } from "vitest"; import { axe } from "vitest-axe"; import TemurinPage from "../page"; +vi.mock("next-intl/server", async () => { + const { createTranslator } = + await vi.importActual("next-intl"); + const messages = (await import("@/../locales/en.json")).default; + return { + getTranslations: async (namespace: "ModernPages.temurin") => + createTranslator({ locale: "en", messages, namespace }), + }; +}); + vi.mock("@/utils/fetchAvailableReleases", () => ({ fetchAvailableReleases: vi.fn().mockResolvedValue({ most_recent_lts: 21, diff --git a/src/app/[locale]/temurin/nightly/TemurinNightlyPageClient.tsx b/src/app/[locale]/temurin/nightly/TemurinNightlyPageClient.tsx index aa0dd51c..71196b76 100644 --- a/src/app/[locale]/temurin/nightly/TemurinNightlyPageClient.tsx +++ b/src/app/[locale]/temurin/nightly/TemurinNightlyPageClient.tsx @@ -1,62 +1,71 @@ -import React from "react" -import { useTranslations } from "next-intl" -import { FaArrowCircleRight } from "react-icons/fa" -import PageHeader from "@/components/Common/PageHeader" -import LinkText from "@/components/Common/LinkText" -import NightlyVersionSelector from "@/components/Temurin/NightlyVersionSelector" -import { Link } from "@/i18n/navigation" +// Some portions generated by Co-Pilot +import React from "react"; +import { useTranslations } from "next-intl"; +import { FiArrowRight, FiAlertTriangle } from "react-icons/fi"; +import PageHeader from "@/components/Common/PageHeader"; +import LinkText from "@/components/Common/LinkText"; +import NightlyVersionSelector from "@/components/Temurin/NightlyVersionSelector"; +import { Link } from "@/i18n/navigation"; interface TemurinNightlyPageClientProps { - allVersions: { name: string; value: string }[]; - latestLTS: number; + allVersions: { name: string; value: string }[]; + latestLTS: number; } -const TemurinNightlyPageClient: React.FC = ({ allVersions, latestLTS }) => { - const t = useTranslations("Temurin.Nightly") - return ( -
- = ({ + allVersions, + latestLTS, +}) => { + const t = useTranslations("Temurin.Nightly"); + return ( +
+ + {t("latest-releases")}
+
+ ); +}; -export default TemurinNightlyPageClient +export default TemurinNightlyPageClient; diff --git a/src/app/[locale]/temurin/nightly/__tests__/__snapshots__/page.test.tsx.snap b/src/app/[locale]/temurin/nightly/__tests__/__snapshots__/page.test.tsx.snap index 160fdf76..baada8a6 100644 --- a/src/app/[locale]/temurin/nightly/__tests__/__snapshots__/page.test.tsx.snap +++ b/src/app/[locale]/temurin/nightly/__tests__/__snapshots__/page.test.tsx.snap @@ -2,273 +2,251 @@ exports[`TemurinNightly page > renders correctly 1`] = `
-
-
-
-
-
-
-
- - - - -
- Text -
-
-
- Text -
-
-
Text
-
-
-
-
-
-
-

- Text -

-

Text -

-
- Text -
+
-

- Text -

+ Text
-
+
+ +
+
+

+ Text +

-

- Text -

+ + +
-
+ Text + + - - - - - - - -
-
+
-
+
-
+ 10 + + + + +
+
+ + +
-
- Text -
+ +
+ Text
diff --git a/src/app/[locale]/temurin/page.tsx b/src/app/[locale]/temurin/page.tsx index 73011f3d..87c4090c 100644 --- a/src/app/[locale]/temurin/page.tsx +++ b/src/app/[locale]/temurin/page.tsx @@ -1,12 +1,13 @@ // Some portions generated by Co-Pilot import React from "react"; import { Metadata } from "next"; +import { getTranslations } from "next-intl/server"; +import { FiArrowRight } from "react-icons/fi"; import { fetchAvailableReleases } from "@/utils/fetchAvailableReleases"; import HeroSection from "@/components/HeroSection"; import PowerOfTemurin from "@/components/PowerOfTemurin"; import InstallationGuideCard from "@/components/Download/GuideCard"; -import ImageText from "@/components/ImageText"; -import ContactUs from "@/components/ContactUs"; +import { Link } from "@/i18n/navigation"; export const metadata: Metadata = { title: "Eclipse Temurin", @@ -15,6 +16,7 @@ export const metadata: Metadata = { }; export default async function TemurinPage() { + const t = await getTranslations("ModernPages.temurin"); const availableReleases = await fetchAvailableReleases(); const latestLTS = availableReleases.most_recent_lts ?? 25; return ( @@ -22,17 +24,33 @@ export default async function TemurinPage() { - - +
+
+
+

+ {t("contact-title")} +

+

+ {t("contact-description")} +

+
+
+ + {t("contact")} +
+
+
); } diff --git a/src/app/[locale]/temurin/release-notes/ReleaseNotesPageClient.tsx b/src/app/[locale]/temurin/release-notes/ReleaseNotesPageClient.tsx index 0d150f05..2be89bf1 100644 --- a/src/app/[locale]/temurin/release-notes/ReleaseNotesPageClient.tsx +++ b/src/app/[locale]/temurin/release-notes/ReleaseNotesPageClient.tsx @@ -1,41 +1,58 @@ -"use client" +// Some portions generated by Co-Pilot +"use client"; -import React from "react" -import { useSearchParams } from "next/navigation" -import ReleaseNotesRender from "@/components/Content/ReleaseNotes" -import ReleaseNotesVersionSelector from "@/components/Content/ReleaseNotesVersionSelector" +import React from "react"; +import { useSearchParams } from "next/navigation"; +import { useTranslations } from "next-intl"; +import { Link } from "@/i18n/navigation"; +import { FiArrowLeft } from "react-icons/fi"; +import ReleaseNotesRender from "@/components/Content/ReleaseNotes"; +import ReleaseNotesVersionSelector from "@/components/Content/ReleaseNotesVersionSelector"; interface AvailableReleases { - available_lts_releases: number[] - available_releases: number[] - most_recent_feature_release: number - most_recent_feature_version: number - most_recent_lts: number - tip_version: number + available_lts_releases: number[]; + available_releases: number[]; + most_recent_feature_release: number; + most_recent_feature_version: number; + most_recent_lts: number; + tip_version: number; } interface ReleaseNotesPageClientProps { - availableReleases: AvailableReleases + availableReleases: AvailableReleases; } const ReleaseNotesPageClient: React.FC = ({ - availableReleases + availableReleases, }) => { - const searchParams = useSearchParams() - const version = searchParams.get("version") + const searchParams = useSearchParams(); + const t = useTranslations("ModernPages.release-notes"); + const version = searchParams.get("version"); - // If no version is specified, show the version selector - if (!version) { - return ( - - ) - } + // If no version is specified, show the version selector + if (!version) { + return ( + + ); + } - // If a version is specified, show the release notes - return -} + // If a version is specified, show the release notes + return ( + <> +
+ +
+ + + ); +}; -export default ReleaseNotesPageClient +export default ReleaseNotesPageClient; diff --git a/src/app/[locale]/temurin/release-notes/__tests__/__snapshots__/page.test.tsx.snap b/src/app/[locale]/temurin/release-notes/__tests__/__snapshots__/page.test.tsx.snap index c0dceb59..65926ad0 100644 --- a/src/app/[locale]/temurin/release-notes/__tests__/__snapshots__/page.test.tsx.snap +++ b/src/app/[locale]/temurin/release-notes/__tests__/__snapshots__/page.test.tsx.snap @@ -5,80 +5,33 @@ exports[`TemurinPage > renders the release notes page with header and content 1`
-
-
-
-
-
-
-
- - - - -
- Temurin -
-
-
- Release Notes -
+ Eclipse Temurin
+

+ Release Notes +

- Eclipse Temurin offers high-performance, cross-platform, open-source Java runtime binaries that are enterprise-ready and Java SE TCK-tested for general use in the Java ecosystem. + description
-
+
diff --git a/src/app/[locale]/temurin/release-notes/__tests__/page.test.tsx b/src/app/[locale]/temurin/release-notes/__tests__/page.test.tsx index fc94aaf3..432606eb 100644 --- a/src/app/[locale]/temurin/release-notes/__tests__/page.test.tsx +++ b/src/app/[locale]/temurin/release-notes/__tests__/page.test.tsx @@ -1,48 +1,54 @@ -import { describe, it, expect, vi } from 'vitest'; -import { render, screen } from '@testing-library/react'; -import TemurinPage, { metadata } from '../page'; +// Some portions generated by Co-Pilot +import { describe, it, expect, vi } from "vitest"; +import { render, screen } from "@testing-library/react"; +import TemurinPage, { metadata } from "../page"; -vi.mock('next-intl/server', () => ({ +vi.mock("next-intl/server", () => ({ getTranslations: vi.fn().mockImplementation(() => Promise.resolve((key: string) => { - if (key === 'title') return 'Release Notes'; + if (key === "title") return "Release Notes"; return key; - }) + }), ), })); // Mock the fetchAvailableReleases function -vi.mock('@/utils/fetchAvailableReleases', () => ({ - fetchAvailableReleases: () => Promise.resolve({ - available_lts_releases: [8, 11, 17, 21], - available_releases: [8, 11, 17, 18, 19, 20, 21, 22, 23], - most_recent_feature_release: 23, - most_recent_feature_version: 23, - most_recent_lts: 21, - tip_version: 24 - }) +vi.mock("@/utils/fetchAvailableReleases", () => ({ + fetchAvailableReleases: () => + Promise.resolve({ + available_lts_releases: [8, 11, 17, 21], + available_releases: [8, 11, 17, 18, 19, 20, 21, 22, 23], + most_recent_feature_release: 23, + most_recent_feature_version: 23, + most_recent_lts: 21, + tip_version: 24, + }), })); // Mock the ReleaseNotesPageClient component -vi.mock('../ReleaseNotesPageClient', () => ({ - default: () =>
Release Notes Content
+vi.mock("../ReleaseNotesPageClient", () => ({ + default: () => ( +
Release Notes Content
+ ), })); - -describe('TemurinPage', () => { - it('renders the release notes page with header and content', async () => { +describe("TemurinPage", () => { + it("renders the release notes page with header and content", async () => { const { container } = render(await TemurinPage()); - expect(screen.getByTestId('temurin-release-notes-page')).toBeInTheDocument(); - expect(screen.getByText('Release Notes')).toBeInTheDocument(); - expect(screen.getByText('Temurin')).toBeInTheDocument(); - expect(screen.getByTestId('release-notes-content')).toBeInTheDocument(); + expect( + screen.getByTestId("temurin-release-notes-page"), + ).toBeInTheDocument(); + expect(screen.getByText("Release Notes")).toBeInTheDocument(); + expect(screen.getByText("Eclipse Temurin")).toBeInTheDocument(); + expect(screen.getByTestId("release-notes-content")).toBeInTheDocument(); expect(container).toMatchSnapshot(); }); - it('has correct metadata export', () => { + it("has correct metadata export", () => { expect(metadata).toEqual({ - title: 'Release Notes', - description: 'Eclipse Temurin offers high-performance, cross-platform, open-source Java runtime binaries that are enterprise-ready and Java SE TCK-tested for general use in the Java ecosystem.', + title: "Release Notes", + description: + "Eclipse Temurin offers high-performance, cross-platform, open-source Java runtime binaries that are enterprise-ready and Java SE TCK-tested for general use in the Java ecosystem.", }); }); }); diff --git a/src/app/[locale]/temurin/release-notes/page.tsx b/src/app/[locale]/temurin/release-notes/page.tsx index 86d72a7c..e3465e49 100644 --- a/src/app/[locale]/temurin/release-notes/page.tsx +++ b/src/app/[locale]/temurin/release-notes/page.tsx @@ -1,3 +1,4 @@ +// Some portions generated by Co-Pilot import React from "react"; import { Metadata } from "next"; import { getTranslations } from "next-intl/server"; @@ -13,6 +14,7 @@ export const metadata: Metadata = { export default async function TemurinPage() { const t = await getTranslations("ReleaseNotes"); + const tModern = await getTranslations("ModernPages.release-notes"); const availableReleases = await fetchAvailableReleases(); const releases = { available_lts_releases: availableReleases.available_lts_releases ?? [], @@ -28,10 +30,10 @@ export default async function TemurinPage() { return (
diff --git a/src/components/About/UsingTemurin/__tests__/UsingTemurin.test.tsx b/src/components/About/UsingTemurin/__tests__/UsingTemurin.test.tsx index 4666571c..55639b00 100644 --- a/src/components/About/UsingTemurin/__tests__/UsingTemurin.test.tsx +++ b/src/components/About/UsingTemurin/__tests__/UsingTemurin.test.tsx @@ -1,12 +1,47 @@ -import React from "react" -import { render } from "@testing-library/react" -import { describe, expect, it } from "vitest" -import UsingTemurin from "../index" +// Some portions generated by Co-Pilot +import React from "react"; +import { render, screen } from "@testing-library/react"; +import { describe, expect, it, vi } from "vitest"; +import UsingTemurin from "../index"; +import { axe } from "vitest-axe"; +import englishMessages from "../../../../../locales/en.json"; + +vi.mock("next-intl", async (importOriginal) => { + const original = await importOriginal(); + return { + ...original, + useTranslations: (namespace: "PowerOfTemurin" | "BusinessBenefits.usage") => + original.createTranslator({ + locale: "en", + messages: englishMessages, + namespace, + }), + }; +}); describe("UsingTemurin component", () => { it("should render correctly", () => { - const { container } = render() + const { container } = render(); + + expect(container).toMatchSnapshot(); + }); + + it("presents three scannable benefits without decorative images or interactions", () => { + const { container } = render(); + expect(screen.getAllByRole("article")).toHaveLength(3); + expect(screen.getAllByRole("heading", { level: 3 })).toHaveLength(3); + expect( + screen.getByRole("heading", { + level: 2, + name: "How other companies are using Temurin", + }), + ).toBeVisible(); + expect(container.querySelector("img")).not.toBeInTheDocument(); + expect(container.querySelector("button")).not.toBeInTheDocument(); + }); - expect(container).toMatchSnapshot() - }) -}) + it("has no accessibility violations", async () => { + const { container } = render(); + expect(await axe(container)).toHaveNoViolations(); + }); +}); diff --git a/src/components/About/UsingTemurin/__tests__/__snapshots__/UsingTemurin.test.tsx.snap b/src/components/About/UsingTemurin/__tests__/__snapshots__/UsingTemurin.test.tsx.snap index b3580008..35fabb13 100644 --- a/src/components/About/UsingTemurin/__tests__/__snapshots__/UsingTemurin.test.tsx.snap +++ b/src/components/About/UsingTemurin/__tests__/__snapshots__/UsingTemurin.test.tsx.snap @@ -3,32 +3,163 @@ exports[`UsingTemurin component > should render correctly 1`] = `

How other companies are using Temurin

Discover how industry leaders leverage Temurin to enhance performance and drive innovation in their development processes.

diff --git a/src/components/About/UsingTemurin/index.tsx b/src/components/About/UsingTemurin/index.tsx index 03c0e8aa..aa7f7e50 100644 --- a/src/components/About/UsingTemurin/index.tsx +++ b/src/components/About/UsingTemurin/index.tsx @@ -1,31 +1,47 @@ -import React from "react"; -import Image from "next/image"; +// Some portions generated by Co-Pilot +import { useTranslations } from "next-intl"; +import { FiActivity, FiCode, FiTrendingUp } from "react-icons/fi"; +import SectionHeading from "@/components/Common/SectionHeading"; -const UsingTemurin = () => { +const benefits = [ + { key: "performance", icon: FiActivity }, + { key: "cost", icon: FiTrendingUp }, + { key: "developers", icon: FiCode }, +]; + +export default function UsingTemurin() { + const t = useTranslations("PowerOfTemurin"); + const tUsage = useTranslations("BusinessBenefits.usage"); return ( - <> -
-
-

- How other companies are using Temurin -

-

- Discover how industry leaders leverage Temurin to enhance - performance and drive innovation in their development processes. -

-
-
- scroll-divider -
-
- +
+ +
+ {benefits.map(({ key, icon: Icon }, index) => ( +
+
+ + + +
+

+ {t(`benefits.${key}.title`)} +

+

+ {t(`benefits.${key}.description`)} +

+
+ ))} +
+
); -}; - -export default UsingTemurin; +} diff --git a/src/components/Banner/Middle/__tests__/BannerMiddle.test.tsx b/src/components/Banner/Middle/__tests__/BannerMiddle.test.tsx index 43d6ea09..7e40a9a2 100644 --- a/src/components/Banner/Middle/__tests__/BannerMiddle.test.tsx +++ b/src/components/Banner/Middle/__tests__/BannerMiddle.test.tsx @@ -3,6 +3,25 @@ import { render, screen } from "@testing-library/react"; import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; import { axe } from "vitest-axe"; import BannerMiddle from "../index"; +import { currentAnnouncements } from "../announcements"; +import englishMessages from "../../../../../locales/en.json"; +import frenchMessages from "../../../../../locales/fr.json"; + +const translationState = vi.hoisted(() => ({ locale: "en" })); + +vi.mock("next-intl", async (importOriginal) => { + const original = await importOriginal(); + return { + ...original, + useTranslations: () => + original.createTranslator({ + locale: translationState.locale, + messages: + translationState.locale === "fr" ? frenchMessages : englishMessages, + namespace: "SupportingAnnouncement", + }), + }; +}); vi.mock("../announcements", () => ({ currentAnnouncements: [ @@ -26,6 +45,8 @@ vi.mock("../announcements", () => ({ describe("Supporting homepage announcement", () => { beforeEach(() => { + translationState.locale = "en"; + delete currentAnnouncements[0].translationKey; vi.useFakeTimers({ now: new Date("2026-10-27T12:00:00Z"), shouldAdvanceTime: true, @@ -57,4 +78,25 @@ describe("Supporting homepage announcement", () => { const { container } = render(); expect(await axe(container)).toHaveNoViolations(); }); + + it("translates the member callout and its action without changing the destination", () => { + translationState.locale = "fr"; + currentAnnouncements[0].translationKey = "member"; + render(); + expect( + screen.getByRole("heading", { name: "Devenez membre d'Adoptium" }), + ).toBeVisible(); + expect( + screen.getByText( + frenchMessages.SupportingAnnouncement.member.description, + ), + ).toBeVisible(); + expect( + screen.getByRole("link", { name: "En savoir plus" }), + ).toHaveAttribute("href", "/sustainers/"); + expect(screen.getByText("ECLIPSE ADOPTIUM")).toBeVisible(); + expect( + screen.queryByText("Support Eclipse Temurin"), + ).not.toBeInTheDocument(); + }); }); diff --git a/src/components/Banner/Middle/announcements.ts b/src/components/Banner/Middle/announcements.ts index 8043b4f7..119cf6ff 100644 --- a/src/components/Banner/Middle/announcements.ts +++ b/src/components/Banner/Middle/announcements.ts @@ -1,5 +1,6 @@ // Some portions generated by Co-Pilot export type BannerMiddleProps = { + translationKey?: "member" | "sustainer" | "bloomberg"; title: string; description: string; cta: string; @@ -13,6 +14,7 @@ export type BannerMiddleProps = { // ------------------------------------------------------- export const currentAnnouncements: BannerMiddleProps[] = [ { + translationKey: "member", title: "Become an Adoptium member", description: "Join the Adoptium Working Group and support the future of open source Java. Explore our membership options and benefits.", @@ -20,6 +22,7 @@ export const currentAnnouncements: BannerMiddleProps[] = [ ctaLink: "/members/", }, { + translationKey: "sustainer", title: "Become a sustainer", description: "Join the Eclipse Temurin Sustainer Program to support Eclipse Temurin, the fastest-growing open source JDK. Your support fuels stronger security, faster releases, ready-to-deploy builds, quality testing and community development.", @@ -27,6 +30,7 @@ export const currentAnnouncements: BannerMiddleProps[] = [ ctaLink: "/sustainers/", }, { + translationKey: "bloomberg", title: "Case Study: Bloomberg’s shift to Open Source Java", description: "Discover how Eclipse Temurin helps power global financial infrastructure.", diff --git a/src/components/Banner/Middle/index.tsx b/src/components/Banner/Middle/index.tsx index 7c6bb0bf..be80fe62 100644 --- a/src/components/Banner/Middle/index.tsx +++ b/src/components/Banner/Middle/index.tsx @@ -5,6 +5,8 @@ import { useState, useSyncExternalStore } from "react"; import { shuffle } from "@/utils/shuffle"; import { filterByCurrentDate } from "@/utils/filterByDate"; import { FiArrowUpRight } from "react-icons/fi"; +import { useTranslations } from "next-intl"; +import { Link } from "@/i18n/navigation"; import { currentAnnouncements, BannerMiddleProps } from "./announcements"; const subscribe = () => () => {}; @@ -12,6 +14,7 @@ const getClientSnapshot = () => true; const getServerSnapshot = () => false; const Announcement = () => { + const t = useTranslations("SupportingAnnouncement"); const [announcement] = useState(() => { const filteredAnnouncements = filterByCurrentDate(currentAnnouncements); return filteredAnnouncements.length > 0 @@ -22,6 +25,7 @@ const Announcement = () => { if (!announcement) { return null; } + const AnnouncementLink = announcement.ctaLink.startsWith("/") ? Link : "a"; return (
diff --git a/src/components/Content/ReleaseNotes/__tests__/ReleaseNotesRender.test.tsx b/src/components/Content/ReleaseNotes/__tests__/ReleaseNotesRender.test.tsx index 7ddf032d..e6cb17aa 100644 --- a/src/components/Content/ReleaseNotes/__tests__/ReleaseNotesRender.test.tsx +++ b/src/components/Content/ReleaseNotes/__tests__/ReleaseNotesRender.test.tsx @@ -1,5 +1,6 @@ +// Some portions generated by Co-Pilot import React from "react"; -import { render, fireEvent } from "@testing-library/react"; +import { render, fireEvent, screen } from "@testing-library/react"; import { describe, afterEach, expect, it, vi } from "vitest"; import ReleaseNotesRender, { fetchTitle, sortReleaseNotesBy } from "../index"; import type { ReleaseNoteAPIResponse } from "@/hooks"; @@ -8,6 +9,18 @@ import { createMockReleaseNotesAPI } from "./__fixtures__/hooks"; vi.mock("@/hooks/fetchReleaseNotes"); +vi.mock("next-intl", async () => { + const actual = await vi.importActual("next-intl"); + const messages = (await import("@/../locales/en.json")).default; + return { + ...actual, + useTranslations: ( + namespace: + "ReleaseNotes" | "ModernPages.release-notes" | "ModernPages.common", + ) => actual.createTranslator({ locale: "en", messages, namespace }), + }; +}); + // Dynamic mock for useSearchParams let mockVersionParam: string | undefined = "jdk-17.0.1+12"; vi.mock("next/navigation", () => ({ @@ -166,7 +179,7 @@ describe("ReleaseNotesRender component", () => { expect(header.textContent).toContain("▲"); // Click to toggle to descending - fireEvent.click(header); + fireEvent.click(screen.getByRole("button", { name: "Sort by priority" })); expect(header.textContent).toContain("▼"); }); @@ -186,7 +199,7 @@ describe("ReleaseNotesRender component", () => { const { container } = render(); const prioritySelect = container.querySelector( - 'select[aria-label="Filter by priority"]', + 'select[aria-label="Priority"]', ) as HTMLSelectElement; fireEvent.change(prioritySelect, { target: { value: "2" } }); @@ -209,7 +222,7 @@ describe("ReleaseNotesRender component", () => { const { container } = render(); const componentSelect = container.querySelector( - 'select[aria-label="Filter by component"]', + 'select[aria-label="Component"]', ) as HTMLSelectElement; fireEvent.change(componentSelect, { target: { value: "hotspot" } }); @@ -243,7 +256,7 @@ describe("ReleaseNotesRender component", () => { const { container } = render(); - const exportBtn = container.querySelector("button") as HTMLButtonElement; + const exportBtn = screen.getByRole("button", { name: "Export CSV" }); fireEvent.click(exportBtn); expect(mockCreateObjectURL).toHaveBeenCalled(); @@ -291,7 +304,7 @@ describe("ReleaseNotesRender component", () => { // Filter by priority "2" which none of the rows have const prioritySelect = container.querySelector( - 'select[aria-label="Filter by priority"]', + 'select[aria-label="Priority"]', ) as HTMLSelectElement; // First add the option to the select (simulating a valid filter) const opt = document.createElement("option"); @@ -300,10 +313,10 @@ describe("ReleaseNotesRender component", () => { fireEvent.change(prioritySelect, { target: { value: "2" } }); expect(container.querySelectorAll("[data-row]")).toHaveLength(0); - expect(container.textContent).toContain("No results found"); + expect(container.textContent).toContain("No changes match these filters."); }); - it("shows 0 of 0 in pagination when no results", () => { + it("shows an empty result count and disables pagination when no results", () => { mockVersionParam = "jdk-17.0.1+12"; const mockData = createMockReleaseNotesAPI(1); @@ -319,14 +332,16 @@ describe("ReleaseNotesRender component", () => { // Filter by priority "2" which the single row doesn't have const prioritySelect = container.querySelector( - 'select[aria-label="Filter by priority"]', + 'select[aria-label="Priority"]', ) as HTMLSelectElement; const opt = document.createElement("option"); opt.value = "2"; prioritySelect.appendChild(opt); fireEvent.change(prioritySelect, { target: { value: "2" } }); - expect(container.textContent).toContain("0 of 0"); + expect(container.textContent).toContain("0 changes"); + expect(screen.getByRole("button", { name: "Previous" })).toBeDisabled(); + expect(screen.getByRole("button", { name: "Next" })).toBeDisabled(); }); it("renders loading spinner when data is not yet available", () => { @@ -335,9 +350,27 @@ describe("ReleaseNotesRender component", () => { // @ts-expect-error - mockReturnValue is used to simulate the useFetchReleaseNotesForVersion hook useFetchReleaseNotesForVersion.mockReturnValue(undefined); + render(); + expect(screen.getByRole("status")).toHaveTextContent( + "Loading release notes", + ); + }); + + it("allows all types to be selected after the default enhancement filter", () => { + mockVersionParam = "jdk-25+36"; + const data = createMockReleaseNotesAPI(2); + data.release_name = "jdk-25+36"; + data.release_notes[0].type = "Enhancement"; + data.release_notes[1].type = "Bug"; + vi.mocked(useFetchReleaseNotesForVersion).mockReturnValue({ + releaseNoteAPIResponse: data, + isValid: true, + }); const { container } = render(); - expect( - container.querySelector('[aria-label="loading spinner"]'), - ).toBeTruthy(); + expect(container.querySelectorAll("[data-row]")).toHaveLength(1); + fireEvent.change(screen.getByRole("combobox", { name: "Type" }), { + target: { value: "all" }, + }); + expect(container.querySelectorAll("[data-row]")).toHaveLength(2); }); }); diff --git a/src/components/Content/ReleaseNotes/__tests__/__snapshots__/ReleaseNotesRender.test.tsx.snap b/src/components/Content/ReleaseNotes/__tests__/__snapshots__/ReleaseNotesRender.test.tsx.snap index c0208d49..9dc877ec 100644 --- a/src/components/Content/ReleaseNotes/__tests__/__snapshots__/ReleaseNotesRender.test.tsx.snap +++ b/src/components/Content/ReleaseNotes/__tests__/__snapshots__/ReleaseNotesRender.test.tsx.snap @@ -3,13 +3,13 @@ exports[`ReleaseNotesRender component > should render correctly - no release notes 1`] = `

release_name_mock

@@ -26,12 +26,12 @@ exports[`ReleaseNotesRender component > should render correctly - no release not

- Text + Oops... We couldn't find those release notes

- Text + Please ensure that you have a specified a version using the version URL parameter: should render correctly - no release not exports[`ReleaseNotesRender component > should render correctly - version not defined 1`] = `

release_name_mock

@@ -67,12 +67,12 @@ exports[`ReleaseNotesRender component > should render correctly - version not de class="w-full" >

- Text + This section organizes the changes in the selected update release by the main component under which each issue is filed.

should render correctly - version not de - - 2 - - - P1 fixes + 2 critical issues
+

+ Filter changes +

+ + 2 changes + +
+
+
-
should render correctly - version not de class="border-b border-white/[0.08]" > @@ -207,7 +227,7 @@ exports[`ReleaseNotesRender component > should render correctly - version not de > P1 @@ -254,7 +274,7 @@ exports[`ReleaseNotesRender component > should render correctly - version not de > P1 @@ -295,13 +315,13 @@ exports[`ReleaseNotesRender component > should render correctly - version not de
- Priority - - - ▲ - + + Priority + + + ▲ + + should render correctly - version not de - Title + Summary
-
- Rows + Rows per page -
+
- 1–2 of 2 + Page 1 of 1
-
should render correctly 1`] = ` class="border-b border-white/[0.08]" > @@ -514,7 +556,7 @@ exports[`ReleaseNotesRender component > should render correctly 1`] = ` > P1 @@ -561,7 +603,7 @@ exports[`ReleaseNotesRender component > should render correctly 1`] = ` > P1 @@ -602,13 +644,13 @@ exports[`ReleaseNotesRender component > should render correctly 1`] = `
- Priority - - - ▲ - + + Priority + + + ▲ + + should render correctly 1`] = ` - Title + Summary
-
- Rows + Rows per page -
+
- 1–2 of 2 + Page 1 of 1
-
{/* Table */} -
- +
+
@@ -349,9 +367,7 @@ const ReleaseNotesRender = () => { > )} @@ -404,9 +420,9 @@ const ReleaseNotesRender = () => { {/* Pagination */} -
-
- Rows +
+
-
+ +
- {totalRows > 0 - ? `${safePage * pageSize + 1}\u2013${Math.min((safePage + 1) * pageSize, totalRows)} of ${totalRows}` - : "0 of 0"} + {tModern("page", { + page: safePage + 1, + total: totalPages, + })}
-
- - {t("viewReleaseNotes")} - - - + {tModern("view")} +
-
- - ))} -
-
- )} - - {/* Section: Non-LTS */} - {nonLtsVersions.length > 0 && ( -
-
-

- Feature Releases -

-
-
-
- {nonLtsVersions.map((version) => ( - - ))} -
-
- )} + + ))} +
+ + ))}
); -}; - -export default ReleaseNotesVersionSelector; +} diff --git a/src/components/Contributors/__tests__/home.test.tsx b/src/components/Contributors/__tests__/home.test.tsx new file mode 100644 index 00000000..e6c4387f --- /dev/null +++ b/src/components/Contributors/__tests__/home.test.tsx @@ -0,0 +1,33 @@ +// Some portions generated by Co-Pilot +import { render, screen } from "@testing-library/react"; +import { describe, expect, it, vi } from "vitest"; +import ContributorsHome from "../home"; +import frenchMessages from "../../../../locales/fr.json"; + +vi.mock("next-intl", async (importOriginal) => { + const original = await importOriginal(); + return { + ...original, + useTranslations: () => + original.createTranslator({ + locale: "fr", + messages: frenchMessages, + namespace: "RandomContributors", + }), + }; +}); + +vi.mock("@/components/Contributors/RandomContributor", () => ({ + default: () =>
, +})); + +describe("Homepage contributor action", () => { + it("uses a translated label while preserving the GitHub destination", () => { + render(); + const link = screen.getByRole("link", { name: "Devenir contributeur" }); + expect(link).toHaveAttribute("href", "https://github.com/adoptium"); + expect(link).toHaveAttribute("target", "_blank"); + expect(link).toHaveAttribute("rel", "noopener noreferrer"); + expect(screen.queryByText("Become a Contributor")).not.toBeInTheDocument(); + }); +}); diff --git a/src/components/Contributors/home.tsx b/src/components/Contributors/home.tsx index 775c456b..da8eccf0 100644 --- a/src/components/Contributors/home.tsx +++ b/src/components/Contributors/home.tsx @@ -77,7 +77,7 @@ const ContributorsHome = () => { rel="noopener noreferrer" className="inline-flex items-center justify-center px-8 py-4 text-lg font-bold text-white transition-all duration-300 bg-white/5 border border-white/10 rounded-full hover:bg-white/10 hover:scale-105 hover:border-pink-500/50 backdrop-blur-md shadow-lg hover:shadow-pink-500/20 group" > - Become a Contributor + {t("become-contributor")} matches snapshot 1`] = ` diff --git a/src/components/Dashboard/Nav/__tests__/index.test.tsx b/src/components/Dashboard/Nav/__tests__/index.test.tsx index 133e1cbd..ba0499e1 100644 --- a/src/components/Dashboard/Nav/__tests__/index.test.tsx +++ b/src/components/Dashboard/Nav/__tests__/index.test.tsx @@ -1,23 +1,52 @@ -import React from 'react'; -import { render, cleanup } from '@testing-library/react'; -import { describe, it, expect, afterEach, vi } from 'vitest'; -import StatsNav from '../index'; +// Some portions generated by Co-Pilot +import React from "react"; +import { render, cleanup, screen } from "@testing-library/react"; +import { describe, it, expect, afterEach, vi } from "vitest"; +import StatsNav from "../index"; // Mock next/navigation and i18n/navigation Link -vi.mock('next/navigation', () => ({ - usePathname: () => '/stats/download', +vi.mock("next/navigation", () => ({ + usePathname: () => "/stats/download", })); -vi.mock('@/i18n/navigation', () => ({ - Link: ({ href, className, children, ...props }: { href: string; className?: string; children: React.ReactNode }) => {children}, +vi.mock("@/i18n/navigation", () => ({ + Link: ({ + href, + className, + children, + scroll, + ...props + }: { + href: string; + className?: string; + children: React.ReactNode; + scroll?: boolean; + }) => ( + + {children} + + ), })); -describe('StatsNav', () => { - afterEach(() => { - cleanup(); - }); +describe("StatsNav", () => { + afterEach(() => { + cleanup(); + }); + + it("matches snapshot", () => { + const { container } = render(); + expect(container.firstChild).toMatchSnapshot(); + }); - it('matches snapshot', () => { - const { container } = render(); - expect(container.firstChild).toMatchSnapshot(); + it("preserves scroll position when switching either statistics tab", () => { + render(); + expect(screen.getAllByRole("link")).toHaveLength(2); + screen.getAllByRole("link").forEach((link) => { + expect(link).toHaveAttribute("data-scroll", "false"); }); + }); }); diff --git a/src/components/Dashboard/Nav/index.tsx b/src/components/Dashboard/Nav/index.tsx index ff86552e..9d1b6d3a 100644 --- a/src/components/Dashboard/Nav/index.tsx +++ b/src/components/Dashboard/Nav/index.tsx @@ -1,32 +1,43 @@ +// Some portions generated by Co-Pilot "use client"; import { Link } from "@/i18n/navigation"; import { usePathname } from "next/navigation"; +import { useTranslations } from "next-intl"; const StatsNav: React.FC = () => { - const pathname = usePathname() || ""; - const isDownload = pathname.includes("/stats/download") || (!pathname.includes("/stats/trends") && !pathname.includes("/stats/download")); - const isTrends = pathname.includes("/stats/trends"); - return ( - - ); -} + const t = useTranslations("ModernPages.stats"); + const pathname = usePathname() || ""; + const isDownload = + pathname.includes("/stats/download") || + (!pathname.includes("/stats/trends") && + !pathname.includes("/stats/download")); + const isTrends = pathname.includes("/stats/trends"); + return ( + + ); +}; -export default StatsNav; \ No newline at end of file +export default StatsNav; diff --git a/src/components/Download/GuideCard/index.tsx b/src/components/Download/GuideCard/index.tsx index fe28a98c..de45e96f 100644 --- a/src/components/Download/GuideCard/index.tsx +++ b/src/components/Download/GuideCard/index.tsx @@ -1,64 +1,65 @@ -import React from "react" -import { Link } from "@/i18n/navigation" -import CommonHeading from "@/components/Common/CommonHeading" +// Some portions generated by Co-Pilot +import { useTranslations } from "next-intl"; +import { FiArrowRight, FiBookOpen, FiDownload, FiHeart } from "react-icons/fi"; +import { Link } from "@/i18n/navigation"; +import SectionHeading from "@/components/Common/SectionHeading"; -const InstallationGuideCard = () => { - const carddata = [ +export default function InstallationGuideCard() { + const t = useTranslations("ModernPages.temurin"); + const tDocs = useTranslations("DocsPage"); + const tCommon = useTranslations("ModernPages.common"); + const cards = [ { - id: 1, - title: "Installation Guide", - description: - "Eclipse Temurin offers high-performance, cross-platform, open-source Java runtime.", - button: "Installation Guide", - link: "/installation", + href: "/installation", + title: tDocs("install-temurin"), + description: t("install-description"), + icon: FiDownload, }, { - id: 2, - title: "Documentation", - description: - "Eclipse Temurin offers high-performance, cross-platform, open-source Java runtime.", - button: "Documentation", - link: "/docs", + href: "/docs", + title: tDocs("documentation"), + description: t("docs-description"), + icon: FiBookOpen, }, - ] + { + href: "/sustainers/", + title: t("sponsor-title"), + description: t("sponsor-description"), + icon: FiHeart, + }, + ]; + return ( -
- - - - -
- {carddata.map((data, index) => ( -
-
-

- {data.title} -

-

- {data.description} +

+
+ +
+ {cards.map(({ href, title, description, icon: Icon }) => ( + +
- - + + {tCommon("learn-more")} + -
- ))} + ))} +
- ) + ); } - -export default InstallationGuideCard diff --git a/src/components/Events/Calendar/__tests__/Calendar.test.tsx b/src/components/Events/Calendar/__tests__/Calendar.test.tsx index acaecd2d..f456c1a6 100644 --- a/src/components/Events/Calendar/__tests__/Calendar.test.tsx +++ b/src/components/Events/Calendar/__tests__/Calendar.test.tsx @@ -1,44 +1,66 @@ // Some portions generated by Co-Pilot -import { describe, it, expect } from 'vitest'; -import { render } from '@testing-library/react'; -import Calendar from '../index'; +import { describe, it, expect, vi } from "vitest"; +import { render } from "@testing-library/react"; +import Calendar from "../index"; -describe('Calendar', () => { - it('renders correctly', () => { +vi.mock("next-intl", async () => { + const actual = await vi.importActual("next-intl"); + const messages = (await import("@/../locales/en.json")).default; + return { + ...actual, + useTranslations: (namespace: "ModernPages.events") => + actual.createTranslator({ locale: "en", messages, namespace }), + }; +}); + +describe("Calendar", () => { + it("renders correctly", () => { const { container } = render(); expect(container).toBeTruthy(); }); - it('matches snapshot', () => { + it("matches snapshot", () => { const { container } = render(); expect(container.firstChild).toMatchSnapshot(); }); - it('displays the calendar title', () => { + it("displays the calendar title", () => { const { container } = render(); - const heading = container.querySelector('h3'); - expect(heading).toHaveTextContent('Adoptium Community Calendar'); + const heading = container.querySelector("h2"); + expect(heading).toHaveTextContent("Adoptium community calendar"); }); - it('renders view calendar link with correct href', () => { + it("renders view calendar link with correct href", () => { const { container } = render(); - const viewCalendarLink = container.querySelector('a[href*="calendar.google.com/calendar/embed"]'); - expect(viewCalendarLink).toHaveAttribute('href', 'https://calendar.google.com/calendar/embed?src=c_uannoums5ho0olhjk3ulecdkbc%40group.calendar.google.com'); - expect(viewCalendarLink).toHaveAttribute('target', '_blank'); - expect(viewCalendarLink).toHaveAttribute('rel', 'noopener noreferrer'); - expect(viewCalendarLink).toHaveTextContent('View Calendar'); + const viewCalendarLink = container.querySelector( + 'a[href*="calendar.google.com/calendar/embed"]', + ); + expect(viewCalendarLink).toHaveAttribute( + "href", + "https://calendar.google.com/calendar/embed?src=c_uannoums5ho0olhjk3ulecdkbc%40group.calendar.google.com", + ); + expect(viewCalendarLink).toHaveAttribute("target", "_blank"); + expect(viewCalendarLink).toHaveAttribute("rel", "noopener noreferrer"); + expect(viewCalendarLink).toHaveTextContent("View calendar"); }); - it('renders iCal subscription link with correct href', () => { + it("renders iCal subscription link with correct href", () => { const { container } = render(); - const iCalLink = container.querySelector('a[href*="calendar.google.com/calendar/ical"]'); - expect(iCalLink).toHaveAttribute('href', 'https://calendar.google.com/calendar/ical/c_uannoums5ho0olhjk3ulecdkbc%40group.calendar.google.com/public/basic.ics'); - expect(iCalLink).toHaveTextContent('Subscribe to iCal'); + const iCalLink = container.querySelector( + 'a[href*="calendar.google.com/calendar/ical"]', + ); + expect(iCalLink).toHaveAttribute( + "href", + "https://calendar.google.com/calendar/ical/c_uannoums5ho0olhjk3ulecdkbc%40group.calendar.google.com/public/basic.ics", + ); + expect(iCalLink).toHaveTextContent("Subscribe to iCal"); }); - it('displays calendar description text', () => { + it("displays calendar description text", () => { const { container } = render(); - const description = container.querySelector('p.text-grey'); - expect(description).toHaveTextContent(/Stay up to date with the Adoptium Community meeting/); + const description = container.querySelector("p.text-grey"); + expect(description).toHaveTextContent( + /Stay up to date with community meetings/, + ); }); -}); \ No newline at end of file +}); diff --git a/src/components/Events/Calendar/__tests__/__snapshots__/Calendar.test.tsx.snap b/src/components/Events/Calendar/__tests__/__snapshots__/Calendar.test.tsx.snap index 08a7d9eb..222cd2b4 100644 --- a/src/components/Events/Calendar/__tests__/__snapshots__/Calendar.test.tsx.snap +++ b/src/components/Events/Calendar/__tests__/__snapshots__/Calendar.test.tsx.snap @@ -1,89 +1,138 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`Calendar > matches snapshot 1`] = ` -
-
-
+ `; diff --git a/src/components/Events/Calendar/index.tsx b/src/components/Events/Calendar/index.tsx index 6195ebbc..965d7962 100644 --- a/src/components/Events/Calendar/index.tsx +++ b/src/components/Events/Calendar/index.tsx @@ -1,79 +1,43 @@ -import React from "react"; +// Some portions generated by Co-Pilot +import { useTranslations } from "next-intl"; +import { FiArrowUpRight, FiCalendar, FiDownload } from "react-icons/fi"; -const Calendar: React.FC = () => { +export default function Calendar() { + const t = useTranslations("ModernPages.events"); return ( -
-
-

- - - - Adoptium Community Calendar -

-

- Stay up to date with the Adoptium Community meetings, catch up with - community members, and share your ideas and work-in-progress. -

-
- - View Calendar - +
+ -

- What you'll find: What you - will find: Community Calls: General, Security, AQAvit, Website, other - technical team, Release dates, and other community online meetings. -

-
+ ); -}; - -export default Calendar; +} diff --git a/src/components/Events/EventCard/__tests__/index.test.tsx b/src/components/Events/EventCard/__tests__/index.test.tsx index 47307ea4..ee6893ee 100644 --- a/src/components/Events/EventCard/__tests__/index.test.tsx +++ b/src/components/Events/EventCard/__tests__/index.test.tsx @@ -5,10 +5,13 @@ import EventCard from "../index"; // Mock the useLocale hook vi.mock("next-intl", async () => { - const actual = await vi.importActual("next-intl"); + const actual = await vi.importActual("next-intl"); + const messages = (await import("@/../locales/en.json")).default; return { - ...actual as object, + ...actual, useLocale: () => "en", + useTranslations: (namespace: "ModernPages.news") => + actual.createTranslator({ locale: "en", messages, namespace }), }; }); @@ -34,7 +37,9 @@ describe("EventCard", () => { it("renders the post description", () => { render(); - const descriptions = screen.getAllByText("This is a test description for the blog post."); + const descriptions = screen.getAllByText( + "This is a test description for the blog post.", + ); expect(descriptions.length).toBeGreaterThan(0); }); diff --git a/src/components/Events/EventCard/index.tsx b/src/components/Events/EventCard/index.tsx index dd3c800c..29b0b6c9 100644 --- a/src/components/Events/EventCard/index.tsx +++ b/src/components/Events/EventCard/index.tsx @@ -1,5 +1,6 @@ +// Some portions generated by Co-Pilot import React from "react"; -import { useLocale } from "next-intl"; +import { useLocale, useTranslations } from "next-intl"; import { Link } from "@/i18n/navigation"; import Image from "next/image"; import { formatDate } from "@/utils/date"; @@ -26,6 +27,7 @@ interface EventCardProps { const EventCard = ({ post, isEclipseNews, priority }: EventCardProps) => { const locale = useLocale(); + const t = useTranslations("ModernPages.news"); const isExternalLink = isEclipseNews || post.metadata.tags?.includes("eclipse-news"); @@ -103,7 +105,7 @@ const EventCard = ({ post, isEclipseNews, priority }: EventCardProps) => { rel="noopener noreferrer" className="inline-flex items-center gap-1.5 text-sm font-medium text-pink hover:underline transition-colors" > - Read article + {t("read-article")} { }} className="inline-flex items-center gap-1.5 text-sm font-medium text-pink hover:underline transition-colors" > - Read more + {t("read-more")} void; + currentPage: number; + totalPages: number; + onNavigate: (page: number) => void; } -const ClientPagination: React.FC = ({ currentPage, totalPages, onNavigate }) => { - const pages: (number | string)[] = []; - if (totalPages <= 7) { - for (let i = 1; i <= totalPages; i++) { - pages.push(i); - } - } else { - pages.push(1); - let start = Math.max(2, currentPage - 2); - let end = Math.min(totalPages - 1, currentPage + 2); - if (currentPage <= 3) { - start = 2; - end = 5; - } - if (currentPage >= totalPages - 2) { - start = totalPages - 4; - end = totalPages - 1; - } - if (start > 2) pages.push("..."); - for (let i = start; i <= end; i++) pages.push(i); - if (end < totalPages - 1) pages.push("..."); - pages.push(totalPages); +const ClientPagination: React.FC = ({ + currentPage, + totalPages, + onNavigate, +}) => { + const t = useTranslations("ModernPages.common"); + if (totalPages <= 1) return null; + const pages: (number | string)[] = []; + if (totalPages <= 7) { + for (let i = 1; i <= totalPages; i++) { + pages.push(i); } - return ( -
- -
-
- {pages.map((page, idx) => - page === "..." ? ( - ... - ) : ( - - ) - )} -
-
- + } else { + pages.push(1); + let start = Math.max(2, currentPage - 2); + let end = Math.min(totalPages - 1, currentPage + 2); + if (currentPage <= 3) { + start = 2; + end = 5; + } + if (currentPage >= totalPages - 2) { + start = totalPages - 4; + end = totalPages - 1; + } + if (start > 2) pages.push("..."); + for (let i = start; i <= end; i++) pages.push(i); + if (end < totalPages - 1) pages.push("..."); + pages.push(totalPages); + } + return ( + + ); }; export default ClientPagination; diff --git a/src/components/Events/Timeline/__tests__/ClientPagination.test.tsx b/src/components/Events/Timeline/__tests__/ClientPagination.test.tsx index 5b58fb35..6dfe626e 100644 --- a/src/components/Events/Timeline/__tests__/ClientPagination.test.tsx +++ b/src/components/Events/Timeline/__tests__/ClientPagination.test.tsx @@ -4,11 +4,25 @@ import { render, fireEvent } from "@testing-library/react"; import { describe, it, expect, vi } from "vitest"; import ClientPagination from "../ClientPagination"; +vi.mock("next-intl", async () => { + const actual = await vi.importActual("next-intl"); + const messages = (await import("@/../locales/en.json")).default; + return { + ...actual, + useTranslations: (namespace: "ModernPages.common") => + actual.createTranslator({ locale: "en", messages, namespace }), + }; +}); + describe("ClientPagination", () => { it("renders all pages when totalPages <= 7", () => { const onNavigate = vi.fn(); const { getByText } = render( - , + , ); expect(getByText("1")).toBeTruthy(); expect(getByText("2")).toBeTruthy(); @@ -18,7 +32,11 @@ describe("ClientPagination", () => { it("renders Previous and Next buttons", () => { const onNavigate = vi.fn(); const { getAllByText } = render( - , + , ); expect(getAllByText("Previous").length).toBeGreaterThan(0); expect(getAllByText("Next").length).toBeGreaterThan(0); @@ -27,9 +45,15 @@ describe("ClientPagination", () => { it("disables Previous button on first page", () => { const onNavigate = vi.fn(); const { getAllByText } = render( - , - ); - const prevButtons = getAllByText("Previous").map((el) => el.closest("button")).filter(Boolean); + , + ); + const prevButtons = getAllByText("Previous") + .map((el) => el.closest("button")) + .filter(Boolean); // At least one previous button should be disabled expect(prevButtons.some((btn) => btn?.disabled)).toBe(true); }); @@ -37,16 +61,26 @@ describe("ClientPagination", () => { it("disables Next button on last page", () => { const onNavigate = vi.fn(); const { getAllByText } = render( - , - ); - const nextButtons = getAllByText("Next").map((el) => el.closest("button")).filter(Boolean); + , + ); + const nextButtons = getAllByText("Next") + .map((el) => el.closest("button")) + .filter(Boolean); expect(nextButtons.some((btn) => btn?.disabled)).toBe(true); }); it("calls onNavigate with correct page when clicking Next", () => { const onNavigate = vi.fn(); const { container } = render( - , + , ); // Find the Next button - it's the last button in the component const buttons = container.querySelectorAll("button"); @@ -61,7 +95,11 @@ describe("ClientPagination", () => { it("calls onNavigate with correct page when clicking Previous", () => { const onNavigate = vi.fn(); const { container } = render( - , + , ); const buttons = container.querySelectorAll("button"); const prevButton = Array.from(buttons).find( @@ -75,7 +113,11 @@ describe("ClientPagination", () => { it("calls onNavigate when clicking a page number", () => { const onNavigate = vi.fn(); const { container } = render( - , + , ); const buttons = container.querySelectorAll("button"); const page3Button = Array.from(buttons).find( @@ -89,7 +131,11 @@ describe("ClientPagination", () => { it("renders ellipsis for large page counts at beginning", () => { const onNavigate = vi.fn(); const { getAllByText } = render( - , + , ); // Should show first and last page expect(getAllByText("1").length).toBeGreaterThan(0); @@ -99,7 +145,11 @@ describe("ClientPagination", () => { it("renders ellipsis for large page counts at end", () => { const onNavigate = vi.fn(); const { getAllByText } = render( - , + , ); expect(getAllByText("...").length).toBeGreaterThan(0); }); @@ -107,7 +157,11 @@ describe("ClientPagination", () => { it("renders ellipsis for large page counts in middle", () => { const onNavigate = vi.fn(); const { getAllByText } = render( - , + , ); // With middle page selected, should have ellipsis on both sides const ellipses = getAllByText("..."); @@ -117,7 +171,11 @@ describe("ClientPagination", () => { it("highlights current page with bold styling", () => { const onNavigate = vi.fn(); const { container } = render( - , + , ); // The current page button should have the "font-bold" class const buttons = container.querySelectorAll("button"); @@ -130,7 +188,11 @@ describe("ClientPagination", () => { it("renders correctly with 1 page", () => { const onNavigate = vi.fn(); const { container } = render( - , + , ); expect(container).toBeTruthy(); }); @@ -138,7 +200,11 @@ describe("ClientPagination", () => { it("renders near-end pages correctly (currentPage >= totalPages - 2)", () => { const onNavigate = vi.fn(); const { container } = render( - , + , ); expect(container).toBeTruthy(); // Should show pages near the end diff --git a/src/components/Events/Timeline/__tests__/__snapshots__/timeline.test.tsx.snap b/src/components/Events/Timeline/__tests__/__snapshots__/timeline.test.tsx.snap index 3c84b001..ac37dae2 100644 --- a/src/components/Events/Timeline/__tests__/__snapshots__/timeline.test.tsx.snap +++ b/src/components/Events/Timeline/__tests__/__snapshots__/timeline.test.tsx.snap @@ -2,133 +2,121 @@ exports[`TimeLine component > should render correctly with events 1`] = `
-
+
-
-
-
+ Oct 1, 2023 + +

- - Oct 1, 2023 - -

Event A -

+ +
-

- This is a description for Event A. -

-

-
-
-
-
-
-
-
-
-
+

+ This is a description for Event A. +

+ +
- @@ -154,33 +189,17 @@ exports[`TimeLine component > should render correctly with events 1`] = ` exports[`TimeLine component > should render correctly with no events 1`] = `
-
+
diff --git a/src/components/Events/Timeline/__tests__/timeline.test.tsx b/src/components/Events/Timeline/__tests__/timeline.test.tsx index 95a765ac..0fa999be 100644 --- a/src/components/Events/Timeline/__tests__/timeline.test.tsx +++ b/src/components/Events/Timeline/__tests__/timeline.test.tsx @@ -1,49 +1,58 @@ -import React from "react" -import { render, within } from "@testing-library/react" -import { describe, expect, it } from "vitest" -import TimeLine from "../" +// Some portions generated by Co-Pilot +import React from "react"; +import { render, within } from "@testing-library/react"; +import { describe, expect, it } from "vitest"; +import TimeLine from "../"; const mockData = [ - { - title: "Event A", - description: "This is a description for Event A.", - date: "2023-10-01T00:00:00Z", - infoLink: "https://example.com/a", - }, - { - title: "Event B", - description: "This is a description for Event B.", - date: "2023-10-03T00:00:00Z", - infoLink: "https://example.com/b", - }, -] + { + title: "Event A", + description: "This is a description for Event A.", + date: "2023-10-01T00:00:00Z", + infoLink: "https://example.com/a", + }, + { + title: "Event B", + description: "This is a description for Event B.", + date: "2023-10-03T00:00:00Z", + infoLink: "https://example.com/b", + }, +]; describe("TimeLine component", () => { - it("should render correctly with events", () => { - const { container } = render() - expect(container).toMatchSnapshot() - }) + it("should render correctly with events", () => { + const { container } = render(); + expect(container).toMatchSnapshot(); + }); - it("should render correctly with no events", () => { - const { container } = render() - expect(container).toMatchSnapshot() - }) + it("should render correctly with no events", () => { + const { container } = render(); + expect(container).toMatchSnapshot(); + }); - it("should filter out events with no date", () => { - const dataWithInvalid = [ - ...mockData, - { - title: "Event C", - description: "This is a description for Event C.", - date: "", // invalid but type-safe - infoLink: "https://example.com/c", - }, - ] - const { container, queryByText } = render() - // Only count headings in the timeline, not in pagination or elsewhere - const headings = within(container).getAllByRole("heading", { name: /Event [AB]/ }) - expect(headings.filter(h => h.textContent === "Event A").length).toBe(1) - expect(headings.filter(h => h.textContent === "Event B").length).toBe(1) - expect(queryByText("Event C")).toBeNull() - }) -}) + it("should filter out events with no date", () => { + const dataWithInvalid = [ + ...mockData, + { + title: "Event C", + description: "This is a description for Event C.", + date: "", // invalid but type-safe + infoLink: "https://example.com/c", + }, + ]; + const { container, queryByText } = render( + , + ); + // Only count headings in the timeline, not in pagination or elsewhere + const headings = within(container).getAllByRole("heading", { + name: /Event [AB]/, + }); + expect( + headings.filter((h) => h.textContent?.trim() === "Event A").length, + ).toBe(1); + expect( + headings.filter((h) => h.textContent?.trim() === "Event B").length, + ).toBe(1); + expect(queryByText("Event C")).toBeNull(); + }); +}); diff --git a/src/components/Events/Timeline/index.tsx b/src/components/Events/Timeline/index.tsx index cc74cbd1..edec70f3 100644 --- a/src/components/Events/Timeline/index.tsx +++ b/src/components/Events/Timeline/index.tsx @@ -1,132 +1,134 @@ -"use client" +// Some portions generated by Co-Pilot +"use client"; -import React, { memo, useState, useEffect } from "react" -import { useLocale } from "next-intl" -import ClientPagination from "./ClientPagination" -import { truncateIfLonger } from "@/utils/truncateLonger" -import { fetchLatestEvents } from "@/hooks" +import React, { memo, useState, useEffect } from "react"; +import { useLocale, useTranslations } from "next-intl"; +import { FiArrowUpRight } from "react-icons/fi"; +import ClientPagination from "./ClientPagination"; +import { truncateIfLonger } from "@/utils/truncateLonger"; +import { fetchLatestEvents } from "@/hooks"; // Define a type for events interface TimelineEvent { - date: string; - title: string; - description: string; - infoLink: string; + date: string; + title: string; + description: string; + infoLink: string; } // Accept data as a prop for testing, fallback to fetchLatestEvents if not provided interface TimeLineProps { - data?: TimelineEvent[] + data?: TimelineEvent[]; } const TimeLine = ({ data }: TimeLineProps) => { - const locale = useLocale() - const [events, setEvents] = useState(data || []) + const locale = useLocale(); + const t = useTranslations("ModernPages.events"); + const [events, setEvents] = useState(data || []); - useEffect(() => { - if (!data) { - // Fetch actual events from API - const getEvents = async () => { - const response = await fetchLatestEvents() - setEvents(response) - } - getEvents() - } - }, [data]) - - const validEvents = events?.filter( - event => !!event.date && !isNaN(new Date(event.date).getTime()), - ) - - const totalCount = validEvents?.length || 0 - const postsPerPage = 6 - const totalPages = Math.ceil(totalCount / postsPerPage) - const [currentPage, setCurrentPage] = useState(1) - - const startIndex = (currentPage - 1) * postsPerPage - const endIndex = startIndex + postsPerPage - const paginatedData = validEvents.slice(startIndex, endIndex) - - // Helper for date formatting - const newDate = (dateString: string) => { - const date = new Date(dateString) - return date.toLocaleDateString(locale, { - year: "numeric", - month: "short", - day: "numeric" - }) + useEffect(() => { + if (!data) { + // Fetch actual events from API + const getEvents = async () => { + const response = await fetchLatestEvents(); + setEvents(response); + }; + getEvents(); } + }, [data]); - return ( -
- {paginatedData.map((event, index) => { - const isRight = index % 2 === 0 - return ( -
-
+ const validEvents = events?.filter( + (event) => !!event.date && !isNaN(new Date(event.date).getTime()), + ); -
-
- - {newDate(event.date)} - - -

- {event.title} -

-
-

- {truncateIfLonger(event.description)} -

-
-
+ const totalCount = validEvents?.length || 0; + const postsPerPage = 6; + const totalPages = Math.ceil(totalCount / postsPerPage); + const [currentPage, setCurrentPage] = useState(1); -
-
-
+ const startIndex = (currentPage - 1) * postsPerPage; + const endIndex = startIndex + postsPerPage; + const paginatedData = validEvents.slice(startIndex, endIndex); - {/* Empty side for alignment */} -
-
- ) - })} - -
- - View all Eclipse Foundation events - - | + // Helper for date formatting + const newDate = (dateString: string) => { + const date = new Date(dateString); + return date.toLocaleDateString(locale, { + year: "numeric", + month: "short", + day: "numeric", + }); + }; + + return ( +
+
+ {paginatedData.map((event, index) => { + return ( +
-
- ) -} + +

+ {truncateIfLonger(event.description)} +

+ + ); + })} +
+ {data && paginatedData.length === 0 && ( +

+ {t("empty")} +

+ )} + + +
+ ); +}; -export default memo(TimeLine) +export default memo(TimeLine); diff --git a/src/components/NavBar/__tests__/NavBar.test.tsx b/src/components/NavBar/__tests__/NavBar.test.tsx index ebd41e0c..cd6a1e63 100644 --- a/src/components/NavBar/__tests__/NavBar.test.tsx +++ b/src/components/NavBar/__tests__/NavBar.test.tsx @@ -2,6 +2,24 @@ import { vi } from "vitest"; import { fireEvent } from "@testing-library/react"; import { waitFor } from "@testing-library/react"; +import englishMessages from "../../../../locales/en.json"; +import frenchMessages from "../../../../locales/fr.json"; + +const translationState = vi.hoisted(() => ({ locale: "en" })); + +vi.mock("next-intl", async (importOriginal) => { + const original = await importOriginal(); + return { + ...original, + useTranslations: () => + original.createTranslator({ + locale: translationState.locale, + messages: + translationState.locale === "fr" ? frenchMessages : englishMessages, + namespace: "NavBar", + }), + }; +}); vi.mock("@/i18n/navigation", () => ({ usePathname: () => "/members", @@ -53,8 +71,44 @@ import NavBar from "../index"; describe("NavBar", () => { afterEach(() => { cleanup(); + translationState.locale = "en"; + }); + + it("translates desktop dropdowns without changing membership destinations", () => { + translationState.locale = "fr"; + const { getByRole, getByText } = render(); + fireEvent.click(getByRole("button", { name: "Nous rejoindre" })); + expect(getByText("Devenir membre").closest("a")).toHaveAttribute( + "href", + "/members", + ); + expect(getByText("Nos membres").closest("a")).toHaveAttribute( + "href", + "/members#strategic-sec", + ); + expect(getByText("Soutien financier")).toBeVisible(); + expect( + getByRole("link", { name: "Comment nous rejoindre" }), + ).toHaveAttribute("href", "/join-us"); }); + it.each(["de", "es", "fr", "pt-BR", "ja", "zh-CN"])( + "provides complete navigation and adopter translations in %s", + async (locale) => { + const messages = (await import(`../../../../locales/${locale}.json`)) + .default; + expect(Object.keys(messages.NavBar).sort()).toEqual( + Object.keys(englishMessages.NavBar).sort(), + ); + for (const value of Object.values(messages.NavBar)) + expect(typeof value === "string" && value.trim().length > 0).toBe(true); + expect(messages.BusinessBenefits.adopters.title).toContain("Temurin®"); + expect( + messages.BusinessBenefits.adopters.description.length, + ).toBeGreaterThan(0); + }, + ); + it("should match the snapshot", () => { const { container } = render(); expect(container.firstChild).toMatchSnapshot(); diff --git a/src/components/NavBar/__tests__/__snapshots__/NavBar.test.tsx.snap b/src/components/NavBar/__tests__/__snapshots__/NavBar.test.tsx.snap index 84ef0b07..54d55b91 100644 --- a/src/components/NavBar/__tests__/__snapshots__/NavBar.test.tsx.snap +++ b/src/components/NavBar/__tests__/__snapshots__/NavBar.test.tsx.snap @@ -39,7 +39,7 @@ exports[`NavBar > should match the snapshot 1`] = ` class="inline-flex w-full gap-2 justify-center rounded-md text-sm font-semibold text-white-900 hover:bg-white-50 cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-[#86507E]" data-headlessui-state="" data-menu-button="true" - id="headlessui-menu-button-_r_2_" + id="headlessui-menu-button-_r_h_" type="button" > Join Us @@ -81,7 +81,7 @@ exports[`NavBar > should match the snapshot 1`] = ` class="inline-flex w-full gap-2 justify-center rounded-md text-sm font-semibold text-white-900 hover:bg-white-50 cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-[#86507E]" data-headlessui-state="" data-menu-button="true" - id="headlessui-menu-button-_r_5_" + id="headlessui-menu-button-_r_k_" type="button" > Projects @@ -113,7 +113,7 @@ exports[`NavBar > should match the snapshot 1`] = ` class="inline-flex w-full gap-2 justify-center rounded-md text-sm font-semibold text-white-900 hover:bg-white-50 cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-[#86507E]" data-headlessui-state="" data-menu-button="true" - id="headlessui-menu-button-_r_8_" + id="headlessui-menu-button-_r_n_" type="button" > Resources @@ -145,7 +145,7 @@ exports[`NavBar > should match the snapshot 1`] = ` class="inline-flex w-full gap-2 justify-center rounded-md text-sm font-semibold text-white-900 hover:bg-white-50 cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-[#86507E]" data-headlessui-state="" data-menu-button="true" - id="headlessui-menu-button-_r_b_" + id="headlessui-menu-button-_r_q_" type="button" > Community diff --git a/src/components/NavBar/index.tsx b/src/components/NavBar/index.tsx index 45ba13a0..ca72e5a6 100644 --- a/src/components/NavBar/index.tsx +++ b/src/components/NavBar/index.tsx @@ -1,3 +1,4 @@ +// Some portions generated by Co-Pilot "use client"; import React, { useState, useEffect, Fragment } from "react"; @@ -15,6 +16,7 @@ import { } from "@headlessui/react"; import { FaChevronDown, FaRegBell } from "react-icons/fa"; import { BsXLg, BsList } from "react-icons/bs"; +import { useTranslations } from "next-intl"; import IconSocial from "@/components/Common/IconSocial"; import LanguageSelector from "@/components/LanguageSelector"; @@ -144,6 +146,7 @@ const MobileLink: React.FC<{ activePaths: Set; onClick?: () => void; }> = ({ href, name, onClick, activePaths }) => { + const t = useTranslations("NavBar"); const commonClasses = classNames( "-mx-3 block rounded-lg px-2.5 py-1.5 text-[16px] font-normal leading-6 text-white-900 hover:bg-white-50", href && activePaths.has(href) ? "text-rose-600" : "", @@ -158,7 +161,7 @@ const MobileLink: React.FC<{ className={commonClasses} onClick={onClick} > - {name} + {t(name)} ); } @@ -166,7 +169,7 @@ const MobileLink: React.FC<{ if (href && href.startsWith("/") && !href.includes("#")) { return ( - {name} + {t(name)} ); } @@ -174,7 +177,7 @@ const MobileLink: React.FC<{ // Internal links WITH hash → normal anchor (same tab) return ( - {name} + {t(name)} ); }; @@ -187,6 +190,7 @@ const MobileDivider: React.FC = () => ( ); const NavBar = ({ locale }: { locale: string }) => { + const t = useTranslations("NavBar"); const [openedMenu, setOpenedMenu] = useState(undefined as undefined | string); const [mobileMenuOpen, setMobileMenuOpen] = useState(false); const [showLastSlide, setShowLastSlide] = useState(false); @@ -261,12 +265,12 @@ const NavBar = ({ locale }: { locale: string }) => {
@@ -324,7 +328,7 @@ const NavBar = ({ locale }: { locale: string }) => {

- Membership + {t("Membership")}

{

- Sponsorship + {t("Sponsorship")}

{

- Contribute + {t("Contribute")}

{

- Adopt + {t("Adopt")}

{ className="text-[15px] font-semibold text-[#ff1365] hover:underline" onClick={() => setOpenedMenu(undefined)} > - Join Us Overview → + {t("Join Us Overview")} +
@@ -438,7 +445,7 @@ const NavBar = ({ locale }: { locale: string }) => { ) } > - {item.name} + {t(item.name)}
@@ -488,7 +495,7 @@ const NavBar = ({ locale }: { locale: string }) => { : "", )} > - {item.name} + {t(item.name)} ) : null, )} @@ -499,7 +506,7 @@ const NavBar = ({ locale }: { locale: string }) => {
setShowAnnouncement(!showAnnouncement)} className="relative" > @@ -516,7 +523,7 @@ const NavBar = ({ locale }: { locale: string }) => { className="-m-2.5 inline-flex items-center justify-center rounded-md text-white-700" onClick={() => setMobileMenuOpen(true)} > - Open main menu + {t("Open main menu")}
@@ -539,7 +546,7 @@ const NavBar = ({ locale }: { locale: string }) => { { className="-m-2.5 rounded-md p-2.5 text-white-700" onClick={() => setMobileMenuOpen(false)} > - Close menu + {t("Close menu")}
@@ -572,7 +579,7 @@ const NavBar = ({ locale }: { locale: string }) => { className="flex items-center justify-between" >
- {item.name} + {t(item.name)}
{ /> - {activeLastSlide && activeLastSlide.name} + {activeLastSlide && t(activeLastSlide.name)}
diff --git a/src/components/News/NewsCardList/__tests__/index.test.tsx b/src/components/News/NewsCardList/__tests__/index.test.tsx index da0a01d9..ca113fd8 100644 --- a/src/components/News/NewsCardList/__tests__/index.test.tsx +++ b/src/components/News/NewsCardList/__tests__/index.test.tsx @@ -5,10 +5,13 @@ import NewsCardList from "../index"; // Mock the useLocale hook for EventCard vi.mock("next-intl", async () => { - const actual = await vi.importActual("next-intl"); + const actual = await vi.importActual("next-intl"); + const messages = (await import("@/../locales/en.json")).default; return { - ...actual as object, + ...actual, useLocale: () => "en", + useTranslations: (namespace: "ModernPages.news" | "ModernPages.common") => + actual.createTranslator({ locale: "en", messages, namespace }), }; }); @@ -49,25 +52,18 @@ describe("NewsCardList", () => { it("renders the Submit News link", () => { render(); - const submitLinks = screen.getAllByText("Submit News"); + const submitLinks = screen.getAllByRole("link", { name: "Submit news" }); expect(submitLinks.length).toBeGreaterThan(0); }); it("renders with empty posts array", () => { - render( - - ); - const submitLinks = screen.getAllByText("Submit News"); + render(); + const submitLinks = screen.getAllByRole("link", { name: "Submit news" }); expect(submitLinks.length).toBeGreaterThan(0); }); it("renders the component container", () => { - const { container } = render( - - ); + const { container } = render(); expect(container.firstChild).toBeInTheDocument(); }); }); diff --git a/src/components/News/NewsCardList/index.tsx b/src/components/News/NewsCardList/index.tsx index 787066d1..c66a5b27 100644 --- a/src/components/News/NewsCardList/index.tsx +++ b/src/components/News/NewsCardList/index.tsx @@ -1,4 +1,6 @@ +// Some portions generated by Co-Pilot import React from "react"; +import { useTranslations } from "next-intl"; import EventCard from "@/components/Events/EventCard"; import Pagination from "@/components/News/Pagination"; @@ -37,35 +39,20 @@ const NewsCardList: React.FC = ({ baseUrl, queryString, }) => { - const allPosts = [...posts]; - const rowsNeeded = Math.ceil(allPosts.length / 3); - const rowData: Post[][] = []; - - // Create rows with up to 3 cards each - for (let i = 0; i < rowsNeeded; i++) { - const startIndex = i * 3; - const rowPosts = allPosts.slice(startIndex, startIndex + 3); - rowData.push(rowPosts); - } - + const t = useTranslations("ModernPages.news"); return ( -
- {/* Display all posts in rows of up to 3 cards */} - {rowData.map((row, rowIndex) => ( -
- {row.map((post, index) => ( - - ))} -
- ))} +
+

{t("title")}

+
+ {posts.map((post, index) => ( + + ))} +
= ({ baseUrl={baseUrl} queryString={queryString} /> -
+
- Submit News + {t("submit")} { + const actual = await vi.importActual("next-intl"); + const messages = (await import("@/../locales/en.json")).default; + return { + ...actual, + useTranslations: (namespace: "ModernPages.news") => + actual.createTranslator({ locale: "en", messages, namespace }), + }; +}); + // Mock authors utility vi.mock("@/utils/authors", () => ({ getFormattedAuthorData: (authorId: string) => { @@ -20,7 +30,9 @@ describe("NewsEmptyState", () => { it("renders filter adjustment suggestion", () => { render(); - const suggestions = screen.getAllByText("Try adjusting or clearing your filters."); + const suggestions = screen.getAllByText( + "Try adjusting or clearing your filters.", + ); expect(suggestions.length).toBeGreaterThan(0); }); diff --git a/src/components/News/NewsEmptyState/index.tsx b/src/components/News/NewsEmptyState/index.tsx index 52c18f45..4030298c 100644 --- a/src/components/News/NewsEmptyState/index.tsx +++ b/src/components/News/NewsEmptyState/index.tsx @@ -1,3 +1,5 @@ +// Some portions generated by Co-Pilot +import { useTranslations } from "next-intl"; import { getFormattedAuthorData } from "@/utils/authors"; interface NewsEmptyStateProps { @@ -11,6 +13,7 @@ export default function NewsEmptyState({ author, source, }: NewsEmptyStateProps) { + const t = useTranslations("ModernPages.news"); const formattedAuthor = author ? getFormattedAuthorData(author).name : undefined; @@ -20,36 +23,32 @@ export default function NewsEmptyState({ : undefined; return ( -
+

- No results found + {t("no-results")}

-

- We couldn't find any blogs matching your selected filters. -

+

{t("empty")}

{tag && ( - Tag: {tag} + {t("tag")}: {tag} )} {formattedAuthor && ( - Author: {formattedAuthor} + {t("author")}: {formattedAuthor} )} {formattedSource && ( - Source: {formattedSource} + {t("source")}: {formattedSource} )}
-

- Try adjusting or clearing your filters. -

+

{t("empty-description")}

); } diff --git a/src/components/News/NewsFilters/FilterSelect/index.tsx b/src/components/News/NewsFilters/FilterSelect/index.tsx index 15281efe..dbf69cfa 100644 --- a/src/components/News/NewsFilters/FilterSelect/index.tsx +++ b/src/components/News/NewsFilters/FilterSelect/index.tsx @@ -1,4 +1,6 @@ +// Some portions generated by Co-Pilot import { useState, useRef, useEffect, useMemo, useId } from "react"; +import { useTranslations } from "next-intl"; export interface SelectOption { value: string; @@ -20,6 +22,7 @@ export function FilterSelect({ onChange, disabled, }: FilterSelectProps) { + const t = useTranslations("ModernPages.news"); const [open, setOpen] = useState(false); const [searchTerm, setSearchTerm] = useState(""); const [justSelected, setJustSelected] = useState(false); @@ -113,13 +116,25 @@ export function FilterSelect({ {/* Trigger */}
!disabled && setOpen(true)} + onKeyDown={(event) => { + if ( + !disabled && + !open && + ["Enter", " ", "ArrowDown"].includes(event.key) + ) { + event.preventDefault(); + setOpen(true); + } + }} className={`w-full bg-white/5 backdrop-blur-md text-white - px-4 py-2.5 rounded-full + px-4 py-3 rounded-xl flex justify-between items-center border transition-all duration-200 @@ -136,6 +151,7 @@ export function FilterSelect({ setSearchTerm(e.target.value)} onClick={(e) => e.stopPropagation()} @@ -203,7 +219,7 @@ export function FilterSelect({ {filteredOptions.length === 0 ? (
- No results found + {t("no-results")}
) : ( filteredOptions.map((opt) => { diff --git a/src/components/News/NewsFilters/__tests__/NewsFilters.test.tsx b/src/components/News/NewsFilters/__tests__/NewsFilters.test.tsx new file mode 100644 index 00000000..9438d805 --- /dev/null +++ b/src/components/News/NewsFilters/__tests__/NewsFilters.test.tsx @@ -0,0 +1,58 @@ +// Some portions generated by Co-Pilot +import { fireEvent, render, screen } from "@testing-library/react"; +import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; +import NewsFilters from "../index"; + +const navigation = vi.hoisted(() => ({ replace: vi.fn() })); +vi.mock("next/navigation", () => ({ + useRouter: () => ({ replace: navigation.replace }), + usePathname: () => "/fr/news/page/2", + useSearchParams: () => + new URLSearchParams("tag=java,temurin&source=adoptium&page=2"), +})); +vi.mock("next-intl", async () => { + const actual = await vi.importActual("next-intl"); + const messages = (await import("@/../locales/en.json")).default; + return { + ...actual, + useTranslations: (namespace: "ModernPages.news") => + actual.createTranslator({ locale: "en", messages, namespace }), + }; +}); + +beforeEach(() => { + vi.useFakeTimers(); + navigation.replace.mockClear(); +}); +afterEach(() => { + vi.clearAllTimers(); + vi.useRealTimers(); +}); + +describe("News filters", () => { + const props = { + tags: [ + { value: "java", label: "Java" }, + { value: "temurin", label: "Temurin" }, + ], + authors: [], + }; + + it("opens a filter from the keyboard and clears all tags while retaining locale and source", () => { + render(); + fireEvent.keyDown(screen.getByRole("combobox", { name: "All tags" }), { + key: "Enter", + }); + expect(screen.getByRole("textbox", { name: "All tags" })).toHaveFocus(); + fireEvent.click(screen.getByRole("option", { name: "All tags" })); + expect(navigation.replace).toHaveBeenCalledWith("/fr/news?source=adoptium"); + }); + + it("removes one tag without dropping the remaining filter", () => { + render(); + fireEvent.click(screen.getByRole("button", { name: "Remove tag: java" })); + expect(navigation.replace).toHaveBeenCalledWith( + "/fr/news?tag=temurin&source=adoptium", + ); + }); +}); diff --git a/src/components/News/NewsFilters/index.tsx b/src/components/News/NewsFilters/index.tsx index 9c936061..5eabb1f4 100644 --- a/src/components/News/NewsFilters/index.tsx +++ b/src/components/News/NewsFilters/index.tsx @@ -1,7 +1,9 @@ +// Some portions generated by Co-Pilot "use client"; import { useRouter, useSearchParams, usePathname } from "next/navigation"; import { useTransition } from "react"; +import { useTranslations } from "next-intl"; import { FilterSelect, SelectOption } from "./FilterSelect"; interface NewsFiltersProps { @@ -12,6 +14,7 @@ interface NewsFiltersProps { type FilterKey = "source" | "tag" | "author"; export default function NewsFilters({ tags, authors }: NewsFiltersProps) { + const t = useTranslations("ModernPages.news"); const router = useRouter(); const searchParams = useSearchParams(); const pathname = usePathname(); @@ -86,56 +89,68 @@ export default function NewsFilters({ tags, authors }: NewsFiltersProps) { ]; return ( -
-
-
- handleChange("source", value)} - disabled={isPending} - /> +
+
+

+ {t("filters")} +

+
+
+ handleChange("source", value)} + disabled={isPending} + /> +
+ +
+ + value ? addTag(value) : handleChange("tag", "") + } + disabled={isPending} + /> +
+ +
+ handleChange("author", value)} + disabled={isPending} + /> +
- -
- addTag(value)} - disabled={isPending} - /> -
- -
- handleChange("author", value)} - disabled={isPending} - /> -
-
- {selectedTags.length > 0 && ( -
- {selectedTags.map((tag) => ( -
- {tag} - -
- ))} -
- )} -
+ {tag} + +
+ ))} +
+ )} +
+ ); } diff --git a/src/components/News/Pagination/__tests__/Pagination.test.tsx b/src/components/News/Pagination/__tests__/Pagination.test.tsx index d3598c36..a5a364fc 100644 --- a/src/components/News/Pagination/__tests__/Pagination.test.tsx +++ b/src/components/News/Pagination/__tests__/Pagination.test.tsx @@ -1,9 +1,19 @@ // Some portions generated by Co-Pilot import React from "react"; import { render, cleanup } from "@testing-library/react"; -import { afterEach, describe, it, expect } from "vitest"; +import { afterEach, describe, it, expect, vi } from "vitest"; import Pagination from "../index"; +vi.mock("next-intl", async () => { + const actual = await vi.importActual("next-intl"); + const messages = (await import("@/../locales/en.json")).default; + return { + ...actual, + useTranslations: (namespace: "ModernPages.common") => + actual.createTranslator({ locale: "en", messages, namespace }), + }; +}); + afterEach(() => { cleanup(); }); diff --git a/src/components/News/Pagination/index.tsx b/src/components/News/Pagination/index.tsx index ee25c64e..726a0442 100644 --- a/src/components/News/Pagination/index.tsx +++ b/src/components/News/Pagination/index.tsx @@ -1,4 +1,6 @@ +// Some portions generated by Co-Pilot import React from "react"; +import { useTranslations } from "next-intl"; import { Link } from "@/i18n/navigation"; import { FaChevronLeft, FaChevronRight } from "react-icons/fa"; @@ -21,6 +23,7 @@ const Pagination: React.FC = ({ baseUrl, queryString, }) => { + const t = useTranslations("ModernPages.common"); // Helper to build a link for a given page number. // If page 1, return the baseUrl; otherwise append "/page/{page}". const createPageLink = (page: number): string => { @@ -75,31 +78,39 @@ const Pagination: React.FC = ({ } return ( -
+ ); }; diff --git a/src/components/PowerOfTemurin/__tests__/__snapshots__/PowerOfTemurin.test.tsx.snap b/src/components/PowerOfTemurin/__tests__/__snapshots__/PowerOfTemurin.test.tsx.snap index 979e9f32..d207e807 100644 --- a/src/components/PowerOfTemurin/__tests__/__snapshots__/PowerOfTemurin.test.tsx.snap +++ b/src/components/PowerOfTemurin/__tests__/__snapshots__/PowerOfTemurin.test.tsx.snap @@ -2,240 +2,162 @@ exports[`PowerOfTemurin component > should render correctly 1`] = `
-
- Description - scroll divider -
-

+ + + +

Text -

-
+

Text -

-

-
-
- Description - scroll divider -
+ +
-

+ + + + +

Text -

-
+

Text -

-

-
-
- Description - scroll divider -
+ +
-

+ + + +

Text -

-
+

Text -

-

+

+
- -
+ + + + +
`; diff --git a/src/components/PowerOfTemurin/index.tsx b/src/components/PowerOfTemurin/index.tsx index 7675ef40..e7e1fd12 100644 --- a/src/components/PowerOfTemurin/index.tsx +++ b/src/components/PowerOfTemurin/index.tsx @@ -1,37 +1,48 @@ -"use client"; - -import React from "react"; +// Some portions generated by Co-Pilot import { Link } from "@/i18n/navigation"; import { useTranslations } from "next-intl"; -import { motion } from "motion/react"; +import { FiArrowRight, FiCode, FiLayers, FiTrendingUp } from "react-icons/fi"; +import SectionHeading from "@/components/Common/SectionHeading"; -import UiVirtualScroll from "@/components/UiVirtualScroll"; +const benefits = [ + { key: "performance", icon: FiTrendingUp }, + { key: "cost", icon: FiLayers }, + { key: "developers", icon: FiCode }, +]; const PowerOfTemurin = () => { const t = useTranslations("PowerOfTemurin"); return ( -
- + +
+ {benefits.map(({ key, icon: Icon }) => ( +
+
+ ))} +
+ -

- {t("title")} -

-

- {t("description")} -

- - - -
- -
+ {t("button")} +
- Priority{" "} - - {sortDirection === "asc" ? "\u25B2" : "\u25BC"} - + - Type + {tModern("type")} - Component + {tModern("component")} - Issue + {tModern("issue")} - Title + {tModern("summary")}
{row.priority && row.priority !== "6" @@ -363,7 +379,7 @@ const ReleaseNotesRender = () => { data-field="type" className="px-5 py-3.5 text-white/60 text-sm" > - {row.type || "Hidden"} + {row.type || tModern("hidden")} { colSpan={5} className="px-5 py-16 text-center text-white/30 text-sm" > - No results found + {tModern("empty")}
+ + + + + {versions.map((version) => ( + + ))} + + + + {platform.distros.map((distro) => ( + + + {versions.map((version) => { + const info = ( + distro.versions as Record< + string, + { supported: boolean; docker: boolean } > - - JDK {version} - -
- {supported ? ( -
- -
+ )[version]; + return ( +
+ ); + })} + + ))} + +
+ {platform.category} — {t("title")} +
+ {tFilters("operating-system")} + + JDK {version} +
+ {distro.name} + +
+ {info?.supported ? ( +
- - ), - )} - - - ))} - +
- )} -
+
+ )}
- ))} -
+
+ ))}
-
+ ); -}; - -export default PlatformMatrix; +} diff --git a/src/components/Temurin/NightlyTable/__tests__/__snapshots__/TemurinNightlyTable.test.tsx.snap b/src/components/Temurin/NightlyTable/__tests__/__snapshots__/TemurinNightlyTable.test.tsx.snap index 1b56b9b3..fd3629cc 100644 --- a/src/components/Temurin/NightlyTable/__tests__/__snapshots__/TemurinNightlyTable.test.tsx.snap +++ b/src/components/Temurin/NightlyTable/__tests__/__snapshots__/TemurinNightlyTable.test.tsx.snap @@ -13,7 +13,10 @@ exports[`TemurinNightlyTable component > renders correctly - no data 1`] = ` exports[`TemurinNightlyTable component > renders correctly 1`] = `
+
diff --git a/src/components/Temurin/NightlyVersionSelector/index.tsx b/src/components/Temurin/NightlyVersionSelector/index.tsx index a2962b8d..6e123a66 100644 --- a/src/components/Temurin/NightlyVersionSelector/index.tsx +++ b/src/components/Temurin/NightlyVersionSelector/index.tsx @@ -1,3 +1,4 @@ +// Some portions generated by Co-Pilot "use client"; import { useState, useEffect } from "react"; @@ -18,6 +19,7 @@ export default function NightlyVersionSelector({ latestLTS, }: NightlyVersionSelectorProps) { const t = useTranslations("Temurin.Nightly"); + const tModern = useTranslations("ModernPages.nightly"); const [version, setVersion] = useState(latestLTS.toString()); const [numBuilds, setNumBuilds] = useState(5); const [buildDate, setBuildDate] = useState(() => { @@ -48,77 +50,75 @@ export default function NightlyVersionSelector({ return (
-
-

- {t("select-options-filter")} -

-
-
-
- - -
-
- - -
-
- - setBuildDate(e.target.value)} - /> - -
+
+

+ {tModern("filter-title")} +

+
+
+ + +
+
+ + +
+
+ + setBuildDate(e.target.value)} + /> +
-
+ Date: Fri, 6 Nov 2026 15:10:27 +0000 Subject: [PATCH 2/2] Remove unused UI and Swiper, and fix render warnings Remove 18 orphaned component source files with obsolete tests, styles, mocks and declarations. Keep active replacement components and remove only Swiper from the dependency graph. Fix news-card keys, discard AsciiDoc script nodes before rendering, and assert the expected invalid-download log in tests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/copilot-instructions.md | 1 - package-lock.json | 20 -- package.json | 1 - .../__tests__/client-redirects.test.tsx | 59 ++++-- src/components/BannerMiddle/announcements.ts | 38 ---- src/components/BannerMiddle/index.tsx | 87 -------- .../CommonSelector/__tests__/index.test.tsx | 88 -------- .../Common/CommonSelector/index.tsx | 140 ------------- .../SelectorHeader/__tests__/index.test.tsx | 130 ------------ .../Common/SelectorHeader/index.tsx | 83 -------- .../__tests__/AsciiDocFormatter.test.tsx | 18 +- .../__tests__/index.test.tsx | 10 - .../Content/AsciiDocFormatter/index.tsx | 13 +- .../Content/InstallTabs/InstallTabs.css | 53 ----- .../Content/InstallTabs/LinuxPanel/index.tsx | 46 ---- .../Content/InstallTabs/MacOSPanel/index.tsx | 41 ---- .../InstallTabs/WindowsPanel/index.tsx | 48 ----- .../__snapshots__/linux-panel.test.tsx.snap | 64 ------ .../__snapshots__/macos-panel.test.tsx.snap | 65 ------ .../__snapshots__/windows-panel.test.tsx.snap | 80 ------- .../__tests__/linux-panel.test.tsx | 11 - .../__tests__/macos-panel.test.tsx | 11 - .../__tests__/windows-panel.test.tsx | 11 - .../Content/SyntaxHighlighter/index.tsx | 2 +- src/components/Cta/__tests__/index.test.tsx | 39 ---- src/components/Cta/index.tsx | 31 --- src/components/Download/ShellBox/ShellBox.css | 88 -------- .../__snapshots__/shell-box.test.tsx.snap | 37 ---- .../ShellBox/__tests__/shell-box.test.tsx | 61 ------ src/components/Download/ShellBox/index.tsx | 32 --- .../ImageText/__tests__/ImageText.test.tsx | 196 ------------------ src/components/ImageText/index.tsx | 53 ----- src/components/Membership/Header/index.tsx | 22 -- .../NewsCardList/__tests__/index.test.tsx | 46 +++- src/components/News/NewsCardList/index.tsx | 2 +- .../__tests__/PowerOfTemurin.test.tsx | 23 +- .../ProfilePic/__tests__/ProfilePic.test.tsx | 29 --- .../__snapshots__/ProfilePic.test.tsx.snap | 37 ---- src/components/ProfilePic/index.tsx | 23 -- .../TemurinFeatures/__tests__/index.test.tsx | 47 ----- src/components/TemurinFeatures/index.tsx | 176 ---------------- src/components/TemurinFeatures/styles.css | 32 --- .../UiVirtualScroll/UiVirtualContent.tsx | 185 ----------------- .../__tests__/UiVirtualContent.test.tsx | 32 --- src/components/UiVirtualScroll/index.tsx | 34 --- src/components/UiVirtualScroll/mobile.tsx | 44 ---- .../WaysToSupport/__tests__/index.test.tsx | 33 --- src/components/WaysToSupport/index.tsx | 47 ----- src/components/WorkingGroup/Support/index.tsx | 49 ----- .../WorkingGroup/Support/styles.css | 16 -- src/types/swiper-css.d.ts | 10 - vitest-setup.tsx | 28 --- 52 files changed, 104 insertions(+), 2468 deletions(-) delete mode 100644 src/components/BannerMiddle/announcements.ts delete mode 100644 src/components/BannerMiddle/index.tsx delete mode 100644 src/components/Common/CommonSelector/__tests__/index.test.tsx delete mode 100644 src/components/Common/CommonSelector/index.tsx delete mode 100644 src/components/Common/SelectorHeader/__tests__/index.test.tsx delete mode 100644 src/components/Common/SelectorHeader/index.tsx delete mode 100644 src/components/Content/InstallTabs/InstallTabs.css delete mode 100644 src/components/Content/InstallTabs/LinuxPanel/index.tsx delete mode 100644 src/components/Content/InstallTabs/MacOSPanel/index.tsx delete mode 100644 src/components/Content/InstallTabs/WindowsPanel/index.tsx delete mode 100644 src/components/Content/InstallTabs/__tests__/__snapshots__/linux-panel.test.tsx.snap delete mode 100644 src/components/Content/InstallTabs/__tests__/__snapshots__/macos-panel.test.tsx.snap delete mode 100644 src/components/Content/InstallTabs/__tests__/__snapshots__/windows-panel.test.tsx.snap delete mode 100644 src/components/Content/InstallTabs/__tests__/linux-panel.test.tsx delete mode 100644 src/components/Content/InstallTabs/__tests__/macos-panel.test.tsx delete mode 100644 src/components/Content/InstallTabs/__tests__/windows-panel.test.tsx delete mode 100644 src/components/Cta/__tests__/index.test.tsx delete mode 100644 src/components/Cta/index.tsx delete mode 100644 src/components/Download/ShellBox/ShellBox.css delete mode 100644 src/components/Download/ShellBox/__tests__/__snapshots__/shell-box.test.tsx.snap delete mode 100644 src/components/Download/ShellBox/__tests__/shell-box.test.tsx delete mode 100644 src/components/Download/ShellBox/index.tsx delete mode 100644 src/components/ImageText/__tests__/ImageText.test.tsx delete mode 100644 src/components/ImageText/index.tsx delete mode 100644 src/components/Membership/Header/index.tsx delete mode 100644 src/components/ProfilePic/__tests__/ProfilePic.test.tsx delete mode 100644 src/components/ProfilePic/__tests__/__snapshots__/ProfilePic.test.tsx.snap delete mode 100644 src/components/ProfilePic/index.tsx delete mode 100644 src/components/TemurinFeatures/__tests__/index.test.tsx delete mode 100644 src/components/TemurinFeatures/index.tsx delete mode 100644 src/components/TemurinFeatures/styles.css delete mode 100644 src/components/UiVirtualScroll/UiVirtualContent.tsx delete mode 100644 src/components/UiVirtualScroll/__tests__/UiVirtualContent.test.tsx delete mode 100644 src/components/UiVirtualScroll/index.tsx delete mode 100644 src/components/UiVirtualScroll/mobile.tsx delete mode 100644 src/components/WaysToSupport/__tests__/index.test.tsx delete mode 100644 src/components/WaysToSupport/index.tsx delete mode 100644 src/components/WorkingGroup/Support/index.tsx delete mode 100644 src/components/WorkingGroup/Support/styles.css delete mode 100644 src/types/swiper-css.d.ts diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index a6bd01fb..9db0db8a 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -196,7 +196,6 @@ export default ComponentName; - **Check existing mocks first**: Before adding `vi.mock()` statements to individual test files, check `vitest-setup.tsx` for existing global mocks. Common mocks already available include: - `@/i18n/navigation` (Link component, useRouter, etc.) - `next-intl` (useTranslations, useLocale, etc.) - - `swiper/react` - `@/hooks/useAdoptiumContributorsApi` - `react-slick` and slick CSS files - Only add component-specific mocks when they're not already covered globally diff --git a/package-lock.json b/package-lock.json index d2c1b1bb..e640c7e7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -41,7 +41,6 @@ "schema-dts": "^2.1.0", "slick-carousel": "^2.0.0", "sugar-high": "^2.6.1", - "swiper": "^14.3.0", "unified": "^11.0.5" }, "devDependencies": { @@ -11157,25 +11156,6 @@ "url": "https://opencollective.com/svgo" } }, - "node_modules/swiper": { - "version": "14.3.0", - "resolved": "https://registry.npmjs.org/swiper/-/swiper-14.3.0.tgz", - "integrity": "sha512-qw0Xv1+sylM8KCQxWxV2iYAK2G6XjFGPZ/8F1baEsY8DK4A3sTnLx6jUJ0G71rDbVQ05JHMWkcWmJ5NvlxZO0w==", - "funding": [ - { - "type": "custom", - "url": "https://sponsors.nolimits4web.com" - }, - { - "type": "github", - "url": "https://github.com/sponsors/nolimits4web" - } - ], - "license": "MIT", - "engines": { - "node": ">= 4.7.0" - } - }, "node_modules/tabbable": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/tabbable/-/tabbable-6.2.0.tgz", diff --git a/package.json b/package.json index 4895dc55..0b0932a8 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,6 @@ "schema-dts": "^2.1.0", "slick-carousel": "^2.0.0", "sugar-high": "^2.6.1", - "swiper": "^14.3.0", "unified": "^11.0.5" }, "devDependencies": { diff --git a/src/app/[locale]/download/__tests__/client-redirects.test.tsx b/src/app/[locale]/download/__tests__/client-redirects.test.tsx index 9a5bc387..62db63e8 100644 --- a/src/app/[locale]/download/__tests__/client-redirects.test.tsx +++ b/src/app/[locale]/download/__tests__/client-redirects.test.tsx @@ -1,48 +1,63 @@ +// Some portions generated by Co-Pilot /** * Component-level tests for the redirect paths in DownloadPageClient. * These live in a separate file so they can use their own vi.mock() factory * without conflicting with the hoisted mock in page.test.tsx. */ -import React from "react" -import { render } from "@testing-library/react" -import { describe, expect, it, vi, beforeEach } from "vitest" +import React from "react"; +import { render } from "@testing-library/react"; +import { afterEach, describe, expect, it, vi, beforeEach } from "vitest"; -const redirectMock = vi.fn() +const redirectMock = vi.fn(); // Factory returns a fresh useSearchParams stub whose `get` behaviour is // controlled by `linkValue` — updated before each test via mockReturnValue. -const linkValueRef = { current: "https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.3%2B9/OpenJDK21U.tar.gz" } +const linkValueRef = { + current: + "https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.3%2B9/OpenJDK21U.tar.gz", +}; vi.mock("next/navigation", () => ({ useSearchParams: () => ({ get: (key: string): string | null => { - if (key === "link") return linkValueRef.current - if (key === "vendor") return "Adoptium" - return null + if (key === "link") return linkValueRef.current; + if (key === "vendor") return "Adoptium"; + return null; }, }), redirect: redirectMock, -})) +})); // Re-import after mock is set up -const { default: Download } = await import("../page") +const { default: Download } = await import("../page"); + +afterEach(() => vi.restoreAllMocks()); describe("DownloadPageClient redirect paths", () => { beforeEach(() => { - redirectMock.mockClear() + redirectMock.mockClear(); // Reset to a valid URL so tests start from a known state. - linkValueRef.current = "https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.3%2B9/OpenJDK21U.tar.gz" - }) + linkValueRef.current = + "https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.3%2B9/OpenJDK21U.tar.gz"; + }); it("redirects to /temurin/releases when link is an unparseable string", () => { - linkValueRef.current = "not-a-url" - expect(() => render()).not.toThrow() - expect(redirectMock).toHaveBeenCalledWith("/temurin/releases") - }) + linkValueRef.current = "not-a-url"; + expect(() => render()).not.toThrow(); + expect(redirectMock).toHaveBeenCalledWith("/temurin/releases"); + }); it("redirects to /temurin/releases when link is off the allowlist", () => { - linkValueRef.current = "https://evil.example.com/malware.exe" - expect(() => render()).not.toThrow() - expect(redirectMock).toHaveBeenCalledWith("/temurin/releases") - }) -}) + linkValueRef.current = "https://evil.example.com/malware.exe"; + const consoleError = vi + .spyOn(console, "error") + .mockImplementation(() => {}); + expect(() => render()).not.toThrow(); + expect(redirectMock).toHaveBeenCalledWith("/temurin/releases"); + expect(consoleError).toHaveBeenCalledTimes(1); + expect(consoleError).toHaveBeenCalledWith( + "Invalid download link:", + linkValueRef.current, + ); + }); +}); diff --git a/src/components/BannerMiddle/announcements.ts b/src/components/BannerMiddle/announcements.ts deleted file mode 100644 index eee1c0e0..00000000 --- a/src/components/BannerMiddle/announcements.ts +++ /dev/null @@ -1,38 +0,0 @@ -export type BannerMiddleProps = { - title: string; - description: string; - cta: string; - ctaLink: string; - startDate?: string; - endDate?: string; -}; - -// ------------------------------------------------------- -// NOTE: Add your list of current announcements here -// ------------------------------------------------------- -export const currentAnnouncements: BannerMiddleProps[] = [ - { - title: "Become an Adoptium member", - description: - "Join the Adoptium Working Group and support the future of open source Java. Explore our membership options and benefits.", - cta: "Learn more", - ctaLink: "/members/", - }, - { - title: "Become a sustainer!", - description: - "Join the Eclipse Temurin Sustainer Program to support Eclipse Temurin, the fastest-growing open source JDK. Your support fuels stronger security, faster releases, ready-to-deploy builds, quality testing and community development.", - cta: "Learn more!", - ctaLink: "/sustainers/", - }, - { - title: "Case Study: Bloomberg’s shift to Open Source Java", - description: - "Discover how Eclipse Temurin helps power global financial infrastructure.", - cta: "Read the Case Study", - ctaLink: - "https://outreach.eclipse.foundation/bloomberg-temurin-case-study?utm_campaign=22235449-Bloomberg%20Adoptium%20Case%20Study&utm_source=banner&utm_medium=adoptium%20website", - startDate: "2025-11-16T00:00:00Z", - endDate: "2025-12-31T23:59:59Z", - }, -]; diff --git a/src/components/BannerMiddle/index.tsx b/src/components/BannerMiddle/index.tsx deleted file mode 100644 index 0f0017a0..00000000 --- a/src/components/BannerMiddle/index.tsx +++ /dev/null @@ -1,87 +0,0 @@ -"use client"; - -import React, { useState, useEffect } from "react"; -import { shuffle } from "@/utils/shuffle"; -import { filterByCurrentDate } from "@/utils/filterByDate"; -import { motion } from "motion/react"; -import { currentAnnouncements, BannerMiddleProps } from "./announcements"; - -const BannerMiddle = () => { - const [isMounted, setIsMounted] = useState(false); - const [announcement, setAnnouncement] = useState( - null, - ); - - // Track when component mounts to prevent hydration issues - useEffect(() => { - // Filter announcements based on current date and validity - const filteredAnnouncements = filterByCurrentDate(currentAnnouncements); - - // randomly select one announcement if multiple are valid - setAnnouncement( - filteredAnnouncements.length > 0 - ? shuffle(filteredAnnouncements)[0] - : null, - ); - setIsMounted(true); - }, []); - - // Don't render if no valid announcement - if (!announcement) { - return null; - } - - return ( -
-
- - {/* Glow effects */} -
-
- -
-
-

- {announcement.title} -

-

- {announcement.description} -

-
- -
-
-
-
- ); -}; - -export default BannerMiddle; diff --git a/src/components/Common/CommonSelector/__tests__/index.test.tsx b/src/components/Common/CommonSelector/__tests__/index.test.tsx deleted file mode 100644 index ed4120a4..00000000 --- a/src/components/Common/CommonSelector/__tests__/index.test.tsx +++ /dev/null @@ -1,88 +0,0 @@ -// Some portions generated by Co-Pilot -import { describe, it, expect, vi, afterEach, afterAll, beforeEach } from "vitest"; -import { render, screen, cleanup, fireEvent } from "@testing-library/react"; -import userEvent from "@testing-library/user-event"; -import CommonSelector, { ListItem } from "../index"; -import { mockAnimationsApi, configMocks } from "jsdom-testing-mocks"; - -configMocks({ afterEach, afterAll }); -mockAnimationsApi(); - -const list: ListItem[] = [ - { name: "Option 1", value: "1" }, - { name: "Option 2", value: "2" }, - { name: "Option 3", value: "3" }, -]; - -// Mock scrollIntoView and getBoundingClientRect for JSDOM -beforeEach(() => { - Element.prototype.scrollIntoView = vi.fn(); - Element.prototype.getBoundingClientRect = vi.fn(() => ({ - top: 100, - bottom: 150, - left: 0, - right: 200, - width: 200, - height: 50, - x: 0, - y: 100, - toJSON: () => {}, - })); -}); - -afterEach(() => { - cleanup(); -}); - -describe("CommonSelector", () => { - it("renders with the default value if provided", () => { - render( - {}} - /> - ); - expect(screen.getByText("Option 2")).toBeInTheDocument(); - }); - - it("renders the first option if no defaultValue is provided", () => { - render( {}} />); - expect(screen.getByText("Option 1")).toBeInTheDocument(); - }); - - it("calls selectorUpdater when an option is selected", async () => { - const updater = vi.fn(); - render(); - - // Open the dropdown using fireEvent for more direct control - const button = screen.getByRole("button"); - fireEvent.click(button); - - // Wait for the dropdown options to appear - const listbox = await screen.findByRole("listbox"); - expect(listbox).toBeInTheDocument(); - - // Find and click the option using fireEvent - const option2 = await screen.findByRole("option", { name: "Option 2" }); - expect(option2).toBeInTheDocument(); - - // Use fireEvent.click for more direct interaction - fireEvent.click(option2); - - // Wait for the callback to be called - await vi.waitFor( - () => { - expect(updater).toHaveBeenCalledWith("2"); - }, - { timeout: 3000 } - ); - }); - - it("renders nothing if the list is empty", () => { - const { container } = render( - {}} /> - ); - expect(container.firstChild).toBeNull(); - }); -}); diff --git a/src/components/Common/CommonSelector/index.tsx b/src/components/Common/CommonSelector/index.tsx deleted file mode 100644 index 1de4cde5..00000000 --- a/src/components/Common/CommonSelector/index.tsx +++ /dev/null @@ -1,140 +0,0 @@ -"use client"; - -import React, { useMemo, useState, useEffect, useRef } from "react"; -import { - Listbox, - ListboxButton, - ListboxOption, - ListboxOptions, -} from "@headlessui/react"; -import { FaChevronDown } from "react-icons/fa"; - -export interface ListItem { - name: string; - value: string; -} - -interface ListBoxSelectProps { - list: ListItem[]; - defaultValue?: ListItem | undefined; - selectorUpdater: (value: string) => void; -} - -export default function CommonSelector({ - list, - defaultValue, - selectorUpdater, -}: ListBoxSelectProps) { - const initialSelected = useMemo(() => { - // First try to use defaultValue if provided - if (defaultValue) return defaultValue; - // If list has items, use the first one as default - if (list && list.length > 0) return list[0]; - // Fallback to a safe default - return { name: "Select an option", value: "" }; - }, [defaultValue, list]); - - const [selected, setSelected] = useState( - initialSelected, - ); - const [dropdownPosition, setDropdownPosition] = useState<"bottom" | "top">( - "bottom", - ); - const buttonRef = useRef(null); - - // Update selected when defaultValue changes (controlled from parent) - useEffect(() => { - if (defaultValue && selected && defaultValue.value !== selected.value) { - setSelected(defaultValue); - } else if (defaultValue && !selected) { - setSelected(defaultValue); - } - }, [defaultValue, selected]); - - const handleChange = (newValue: ListItem) => { - setSelected(newValue); - if (newValue && newValue.value !== undefined) { - selectorUpdater(newValue.value); - } - }; - - const handleButtonClick = () => { - if (buttonRef.current) { - const rect = buttonRef.current.getBoundingClientRect(); - const viewportHeight = window.innerHeight; - const spaceBelow = viewportHeight - rect.bottom; - const spaceAbove = rect.top; - const dropdownHeight = 320; // max-h-80 = 320px - - // Determine if dropdown should open upward or downward - if (spaceBelow < dropdownHeight && spaceAbove > spaceBelow) { - setDropdownPosition("top"); - } else { - setDropdownPosition("bottom"); - } - - // Scroll the button into view with some padding - // Use 'center' to ensure there's space both above and below - buttonRef.current.scrollIntoView({ - behavior: "smooth", - block: "center", - inline: "nearest", - }); - } - }; - - if (list.length === 0) return null; - - return ( - -
- - - {selected?.name || "Select an option"} - - - - - - - {list.map((obj, index) => ( - - `relative cursor-pointer select-none py-1 px-3 sm:py-2 sm:px-4 text-sm sm:text-base ${ - active - ? "text-white bg-[#3E3355]" - : "text-white hover:bg-[#2a223a]" - }` - } - value={obj} - > - {({ selected }) => ( - <> - - {obj.name} - - - )} - - ))} - -
-
- ); -} diff --git a/src/components/Common/SelectorHeader/__tests__/index.test.tsx b/src/components/Common/SelectorHeader/__tests__/index.test.tsx deleted file mode 100644 index 9b5e9051..00000000 --- a/src/components/Common/SelectorHeader/__tests__/index.test.tsx +++ /dev/null @@ -1,130 +0,0 @@ -// Some portions generated by Co-Pilot -import { describe, it, expect, afterEach, afterAll, vi, beforeEach } from "vitest"; -import { fireEvent } from "@testing-library/react"; -import { render, screen, cleanup } from "@testing-library/react"; -import userEvent from "@testing-library/user-event"; -import SelectorHeader from "../index"; -import { mockAnimationsApi, configMocks } from "jsdom-testing-mocks"; - -configMocks({ afterEach, afterAll }); -mockAnimationsApi(); - -const titles = ["First", "Second"]; -const data = [ - [ - { name: "A", value: "a" }, - { name: "B", value: "b" }, - ], - [ - { name: "X", value: "x" }, - { name: "Y", value: "y" }, - ], -]; - -// Mock scrollIntoView and getBoundingClientRect for JSDOM -beforeEach(() => { - Element.prototype.scrollIntoView = vi.fn(); - Element.prototype.getBoundingClientRect = vi.fn(() => ({ - top: 100, - bottom: 150, - left: 0, - right: 200, - width: 200, - height: 50, - x: 0, - y: 100, - toJSON: () => {}, - })); -}); - -afterEach(() => { - cleanup(); -}); - -describe("SelectorHeader", () => { - it("renders all selectors and titles", () => { - render( - - ); - expect(screen.getByText("First")).toBeInTheDocument(); - expect(screen.getByText("Second")).toBeInTheDocument(); - // Only count selector buttons (aria-haspopup="listbox") - const selectorButtons = screen - .getAllByRole("button") - .filter((btn) => btn.getAttribute("aria-haspopup") === "listbox"); - expect(selectorButtons.length).toBe(2); - }); - - it("calls the correct selectorUpdater when an option is selected", async () => { - const updater1 = vi.fn(); - const updater2 = vi.fn(); - render( - - ); - - // Open the first selector and select the second option using fireEvent - const selectorButtons = screen - .getAllByRole("button") - .filter((btn) => btn.getAttribute("aria-haspopup") === "listbox"); - - fireEvent.click(selectorButtons[0]); - - // Wait for the dropdown to appear and find the option - const optionB = await screen.findByRole("option", { name: "B" }); - fireEvent.click(optionB); - - // Wait for the callback to be called - await vi.waitFor(() => { - expect(updater1).toHaveBeenCalledWith("b"); - }); - - // Open the second selector and select the second option - fireEvent.click(selectorButtons[1]); - - const optionY = await screen.findByRole("option", { name: "Y" }); - fireEvent.click(optionY); - - await vi.waitFor(() => { - expect(updater2).toHaveBeenCalledWith("y"); - }); - }); - - it("applies default values if provided", () => { - render( - - ); - expect(screen.getByText("B")).toBeInTheDocument(); - expect(screen.getByText("Y")).toBeInTheDocument(); - }); - - it("toggles mobile filters visibility", () => { - render( - - ); - const filterBtn = screen.getByRole("button", { name: /filter/i }); - // Should be hidden initially on mobile - const filterPanel = screen.getByText("First").closest(".hidden"); - expect(filterPanel).not.toBeNull(); - // Click to open - fireEvent.click(filterBtn); - // Now should be visible - expect(screen.getByText("First").closest(".block")).not.toBeNull(); - }); -}); diff --git a/src/components/Common/SelectorHeader/index.tsx b/src/components/Common/SelectorHeader/index.tsx deleted file mode 100644 index f67c932b..00000000 --- a/src/components/Common/SelectorHeader/index.tsx +++ /dev/null @@ -1,83 +0,0 @@ -"use client" - -import React, { useState } from "react" -import CommonSelector, { ListItem } from "@/components/Common/CommonSelector" - -interface SelectorHeaderProps { - title: string[] - data: ListItem[][] - selectorUpdater: ((value: string) => void)[] - defaultValues?: string[] -} - -const SelectorHeader: React.FC = ({ - title, - data, - selectorUpdater, - defaultValues, -}) => { - const [mobileFiltersOpen, setMobileFiltersOpen] = useState(false) - - const toggleMobileFilters = () => { - setMobileFiltersOpen(!mobileFiltersOpen) - } - - return ( -
- -
-
- {data.map((list, index) => { - let defaultVal: ListItem | undefined - if (defaultValues && defaultValues[index]) { - defaultVal = list.find(item => item.value === defaultValues[index]) - } - return ( -
-

- {title[index]} -

- -
- ) - })} -
-
-
- ) -} - -export default SelectorHeader diff --git a/src/components/Content/AsciiDocFormatter/__tests__/AsciiDocFormatter.test.tsx b/src/components/Content/AsciiDocFormatter/__tests__/AsciiDocFormatter.test.tsx index 86319d28..f4da5d5a 100644 --- a/src/components/Content/AsciiDocFormatter/__tests__/AsciiDocFormatter.test.tsx +++ b/src/components/Content/AsciiDocFormatter/__tests__/AsciiDocFormatter.test.tsx @@ -1,9 +1,11 @@ // Some portions generated by Co-Pilot import React from "react"; import { render } from "@testing-library/react"; -import { describe, it, expect } from "vitest"; +import { afterEach, describe, it, expect, vi } from "vitest"; import AsciiDocFormatter from "../index"; +afterEach(() => vi.restoreAllMocks()); + describe("AsciiDocFormatter", () => { it("renders plain HTML content", () => { const { container } = render( @@ -28,12 +30,16 @@ describe("AsciiDocFormatter", () => { ); }); - it("suppresses script tags and keeps surrounding content", () => { - const { container } = render( - , - ); - // Safe sibling content still renders + it.each([ + "

Safe

", + '

Safe

', + '

Safe

', + ])("suppresses script tags without React warnings: %s", (content) => { + const consoleError = vi.spyOn(console, "error"); + const { container } = render(); + expect(container.querySelector("script")).toBeNull(); expect(container.querySelector("p")?.textContent).toBe("Safe"); + expect(consoleError).not.toHaveBeenCalled(); }); it("transforms h1-h6 headings to add hoverable anchors", () => { diff --git a/src/components/Content/AsciiDocFormatter/__tests__/index.test.tsx b/src/components/Content/AsciiDocFormatter/__tests__/index.test.tsx index 06d7e548..90d02147 100644 --- a/src/components/Content/AsciiDocFormatter/__tests__/index.test.tsx +++ b/src/components/Content/AsciiDocFormatter/__tests__/index.test.tsx @@ -4,16 +4,6 @@ import { render, screen } from "@testing-library/react"; import { describe, expect, it, vi } from "vitest"; import AsciiDocFormatter from ".."; -// Mock next-intl's useTranslations hook -vi.mock("next-intl", () => ({ - useTranslations: () => (key: string) => { - const translations: Record = { - "table-of-contents": "Table of Contents", - }; - return translations[key] || key; - }, -})); - // Mock AccordionItem component vi.mock("@/components/Content/Asciidoc/AccordionItem", () => ({ __esModule: true, diff --git a/src/components/Content/AsciiDocFormatter/index.tsx b/src/components/Content/AsciiDocFormatter/index.tsx index ede833d5..d583ce14 100644 --- a/src/components/Content/AsciiDocFormatter/index.tsx +++ b/src/components/Content/AsciiDocFormatter/index.tsx @@ -1,8 +1,8 @@ +// Some portions generated by Co-Pilot "use client"; import React from "react"; import { Link } from "@/i18n/navigation"; -import { useTranslations } from "next-intl"; import parse, { domToReact, HTMLReactParserOptions, @@ -21,10 +21,12 @@ interface AsciiDocFormatterProps { } const AsciiDocFormatter: React.FC = ({ content }) => { - const t = useTranslations("Asciidoc"); - const options: HTMLReactParserOptions = { replace: (node) => { + if (node.type === "script") { + return <>; + } + if (!isElement(node)) { return undefined; } @@ -62,11 +64,6 @@ const AsciiDocFormatter: React.FC = ({ content }) => { } } - // Prevent script execution + hydration mismatches from AsciiDoc output - if (node.name === "script") { - return