Skip to content

fix: translate YouTube section heading on language switch in music.html#175

Merged
DavidKRK merged 1 commit intogh-pagesfrom
copilot/add-latest-youtube-videos-section
Apr 15, 2026
Merged

fix: translate YouTube section heading on language switch in music.html#175
DavidKRK merged 1 commit intogh-pagesfrom
copilot/add-latest-youtube-videos-section

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 15, 2026

The <h3> heading "Dernières vidéos YouTube" was hardcoded in French and ignored by the switchLanguage() function, remaining untranslated when switching to any other language.

Changes

  • music.html
    • Wrapped heading text in <span id="youtube-title-text"> to make it JS-targetable
    • Added youtube_title key for all 6 languages (fr, en, es, eu, ar, uk) in the langContent object
    • Updated switchLanguage() to update the heading alongside the existing button text
const langContent = {
  fr: { youtube_title: 'Dernières vidéos YouTube', youtube_button: 'Voir toutes les vidéos' },
  en: { youtube_title: 'Latest YouTube Videos',   youtube_button: 'View all videos' },
  es: { youtube_title: 'Últimos vídeos de YouTube', ... },
  // ...
};

const titleEl = document.getElementById('youtube-title-text');
if (titleEl) titleEl.textContent = t.youtube_title;

@bolt-new-by-stackblitz
Copy link
Copy Markdown

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@DavidKRK DavidKRK marked this pull request as ready for review April 15, 2026 15:00
Copilot AI review requested due to automatic review settings April 15, 2026 15:00
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a language-switching gap in music.html where the YouTube section heading remained hardcoded in French by making the heading text JS-targetable and including it in the existing switchLanguage() translation updates.

Changes:

  • Wrapped the YouTube <h3> title text in a <span id="youtube-title-text"> so it can be updated dynamically.
  • Added a new youtube_title translation key for all supported languages in the langContent map.
  • Updated switchLanguage() to also update the YouTube heading text (in addition to the existing button text).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@DavidKRK DavidKRK merged commit 65a70e2 into gh-pages Apr 15, 2026
10 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants