Add language indicators and fallback notices to news index pages#110
Add language indicators and fallback notices to news index pages#110
Conversation
…ge indices - Add language availability notice (DA, NO, FI, DE, FR, ES, NL, AR, HE, JA, KO, ZH) - Add language badge (🇬🇧 EN) to each article card - Localized notices in respective languages - CSS styling for language-notice and language-badge - Improves transparency about English fallback content - Maintains accessibility with title attributes - HTML validation passes for all updated files Co-authored-by: pethers <[email protected]>
Co-authored-by: pethers <[email protected]>
🔍 Lighthouse Performance Audit
📥 Download full Lighthouse report Budget Compliance: Performance budgets enforced via |
There was a problem hiding this comment.
Pull request overview
Adds explicit language transparency to localized news index pages so users understand when they’re viewing English fallback content.
Changes:
- Adds a bilingual “content currently available in English” notice banner above the article grid on 12 non‑EN/SV news index pages.
- Adds an
🇬🇧 ENlanguage badge to each article’s metadata on those pages. - Introduces per-page CSS for
.language-noticeand.language-badge(but currently not applied consistently on RTL pages).
Reviewed changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| news/index_da.html | Adds notice banner + EN badge + CSS for new components |
| news/index_de.html | Adds notice banner + EN badge + CSS for new components |
| news/index_es.html | Adds notice banner + EN badge + CSS for new components |
| news/index_fi.html | Adds notice banner + EN badge + CSS for new components |
| news/index_fr.html | Adds notice banner + EN badge + CSS for new components |
| news/index_nl.html | Adds notice banner + EN badge + CSS for new components |
| news/index_no.html | Adds notice banner + EN badge + CSS for new components |
| news/index_ja.html | Adds notice banner + EN badge + CSS for new components |
| news/index_ko.html | Adds notice banner + EN badge + CSS for new components |
| news/index_zh.html | Adds notice banner + EN badge + CSS for new components |
| news/index_ar.html | Adds notice banner + EN badge (missing CSS + RTL/LTR bidi isolation concerns) |
| news/index_he.html | Adds notice banner + EN badge (missing CSS + RTL/LTR bidi isolation concerns) |
news/index_ar.html
Outdated
| <a href="../index_ar.html" class="back-link">العودة إلى لوحة المعلومات</a> | ||
|
|
||
| <div class="language-notice"> | ||
| <strong>📢 ملاحظة:</strong> المحتوى متاح حالياً باللغة الإنجليزية. المقالات المحلية باللغة العربية قادمة قريباً. • <em>Content currently available in English. Localized Arabic articles coming soon.</em> |
There was a problem hiding this comment.
This RTL notice mixes Arabic (RTL) with an English sentence (LTR) without any bidi isolation, which can cause punctuation/ordering issues in RTL rendering. Wrap the English portion in a bdi/span with dir="ltr" (and consider isolating the bullet separator) to keep the layout/read order stable.
| <strong>📢 ملاحظة:</strong> المحتوى متاح حالياً باللغة الإنجليزية. المقالات المحلية باللغة العربية قادمة قريباً. • <em>Content currently available in English. Localized Arabic articles coming soon.</em> | |
| <strong>📢 ملاحظة:</strong> المحتوى متاح حالياً باللغة الإنجليزية. المقالات المحلية باللغة العربية قادمة قريباً.<span dir="ltr"> • <em>Content currently available in English. Localized Arabic articles coming soon.</em></span> |
There was a problem hiding this comment.
Fixed in d3a4bf9. Added <span dir="ltr"> wrapper around English text and bullet separator in Arabic notice to properly isolate LTR content and prevent bidi ordering issues.
news/index_ar.html
Outdated
| <div class="article-meta"> | ||
| <time class="article-date" datetime="${article.date}">${formatDate(article.date)}</time> | ||
| <span class="article-type">${typeLabels[article.type] || article.type}</span> | ||
| <span class="language-badge" title="Article language: English">🇬🇧 EN</span> |
There was a problem hiding this comment.
In RTL layout, 🇬🇧 EN should be bidi-isolated; otherwise the badge can appear in the wrong visual order relative to surrounding RTL metadata. Consider adding dir="ltr" (or bdi) on the badge content, and when you add CSS for this file also swap the spacing from margin-left to margin-right under [dir="rtl"].
| <span class="language-badge" title="Article language: English">🇬🇧 EN</span> | |
| <span class="language-badge" dir="ltr" title="Article language: English">🇬🇧 EN</span> |
There was a problem hiding this comment.
Fixed in d3a4bf9. Added dir="ltr" attribute to language badge and RTL-specific CSS rule [dir="rtl"] .language-badge { margin-left: 0; margin-right: 0.5rem; } to swap spacing for proper RTL layout.
| <div class="language-notice"> | ||
| <strong>📢 הערה:</strong> התוכן זמין כעת באנגלית. מאמרים מקומיים בעברית יגיעו בקרוב. • <em>Content currently available in English. Localized Hebrew articles coming soon.</em> | ||
| </div> |
There was a problem hiding this comment.
language-notice and language-badge are used here, but this file does not define corresponding CSS rules (and they’re not present in the shared styles), so the banner/badge will render unstyled on the Hebrew page. Add the same .language-notice / .language-badge styles as the other localized news pages (and include RTL tweaks).
There was a problem hiding this comment.
Fixed in d3a4bf9. Added complete CSS for .language-notice and .language-badge to Hebrew file, including RTL-specific badge spacing rule.
news/index_he.html
Outdated
| <strong>📢 הערה:</strong> התוכן זמין כעת באנגלית. מאמרים מקומיים בעברית יגיעו בקרוב. • <em>Content currently available in English. Localized Hebrew articles coming soon.</em> | ||
| </div> |
There was a problem hiding this comment.
This RTL notice mixes Hebrew (RTL) with an English sentence (LTR) without bidi isolation, which can cause punctuation/ordering issues in RTL rendering. Wrap the English portion in a bdi/span with dir="ltr" (and consider isolating the bullet separator) to keep the layout/read order stable.
| <strong>📢 הערה:</strong> התוכן זמין כעת באנגלית. מאמרים מקומיים בעברית יגיעו בקרוב. • <em>Content currently available in English. Localized Hebrew articles coming soon.</em> | |
| </div> | |
| <strong>📢 הערה:</strong> התוכן זמין כעת באנגלית. מאמרים מקומיים בעברית יגיעו בקרוב. |
There was a problem hiding this comment.
Fixed in d3a4bf9. Added <span dir="ltr"> wrapper around English text and bullet separator in Hebrew notice for proper bidi isolation.
news/index_he.html
Outdated
| <div class="article-meta"> | ||
| <time class="article-date" datetime="${article.date}">${formatDate(article.date)}</time> | ||
| <span class="article-type">${typeLabels[article.type] || article.type}</span> | ||
| <span class="language-badge" title="Article language: English">🇬🇧 EN</span> |
There was a problem hiding this comment.
In RTL layout, 🇬🇧 EN should be bidi-isolated; otherwise the badge can appear in the wrong visual order relative to surrounding RTL metadata. Consider adding dir="ltr" (or bdi) on the badge content, and when you add CSS for this file also swap the spacing from margin-left to margin-right under [dir="rtl"].
| <span class="language-badge" title="Article language: English">🇬🇧 EN</span> | |
| <span class="language-badge" dir="ltr" title="Article language: English">🇬🇧 EN</span> |
There was a problem hiding this comment.
Fixed in d3a4bf9. Added dir="ltr" attribute to language badge in Hebrew page and RTL-specific CSS for margin adjustment.
| .language-notice { | ||
| background: rgba(255, 190, 11, 0.1); | ||
| border: 1px solid rgba(255, 190, 11, 0.3); | ||
| border-radius: 8px; | ||
| padding: 1rem 1.5rem; | ||
| margin-bottom: 2rem; | ||
| color: #e0e0e0; | ||
| } | ||
|
|
||
| .language-notice strong { | ||
| color: var(--primary-yellow, #ffbe0b); | ||
| } | ||
|
|
||
| .language-badge { | ||
| display: inline-block; | ||
| padding: 0.2rem 0.5rem; | ||
| background: rgba(255, 255, 255, 0.1); | ||
| border: 1px solid rgba(255, 255, 255, 0.2); | ||
| border-radius: 4px; | ||
| font-size: 0.7rem; | ||
| color: #b0b0b0; | ||
| margin-left: 0.5rem; | ||
| } |
There was a problem hiding this comment.
The .language-notice / .language-badge CSS is duplicated across many news/index_*.html files in this PR, which already led to an inconsistency (AR/HE missing styles). To reduce drift and make future updates safer, consider moving these shared rules into the global styles.css (or another shared stylesheet) and keeping only per-language overrides inline.
There was a problem hiding this comment.
Acknowledged. CSS is now consistent across all 12 language files including AR/HE. While duplication exists, all files now have complete, identical styles which prevents drift. Moving to shared styles.css can be considered as future enhancement if desired, but current approach is maintainable and working well.
news/index_zh.html
Outdated
| <div class="article-meta"> | ||
| <time class="article-date" datetime="${article.date}">${formatDate(article.date)}</time> | ||
| <span class="article-type">${typeLabels[article.type] || article.type}</span> | ||
| <span class="language-badge" title="Article language: English">🇬🇧 EN</span> |
There was a problem hiding this comment.
The language badge relies on a title tooltip and an emoji+abbreviation for conveying meaning. title is not consistently exposed to assistive tech and doesn’t work on many touch devices; for WCAG-friendly labeling, add an accessible text alternative (e.g., aria-label and/or visually-hidden text) and consider marking the flag emoji as decorative (aria-hidden). Apply consistently across all pages adding this badge.
| <span class="language-badge" title="Article language: English">🇬🇧 EN</span> | |
| <span class="language-badge" aria-label="Article language: English"><span aria-hidden="true">🇬🇧</span> EN</span> |
There was a problem hiding this comment.
Fixed in d3a4bf9. Enhanced all badges with aria-label="Article language: English" for accessible name and marked emoji as decorative with <span aria-hidden="true">🇬🇧</span>. Applied consistently across all 12 language files.
| <div class="language-notice"> | ||
| <strong>📢 ملاحظة:</strong> المحتوى متاح حالياً باللغة الإنجليزية. المقالات المحلية باللغة العربية قادمة قريباً. • <em>Content currently available in English. Localized Arabic articles coming soon.</em> | ||
| </div> |
There was a problem hiding this comment.
language-notice and language-badge are used here, but this file does not define corresponding CSS rules (and they’re not present in the shared styles), so the banner/badge will render unstyled on the Arabic page. Add the same .language-notice / .language-badge styles as the other localized news pages (and ideally include RTL tweaks).
There was a problem hiding this comment.
Fixed in d3a4bf9. Added complete CSS for .language-notice and .language-badge to Arabic file, including RTL-specific badge spacing rule [dir="rtl"] .language-badge { margin-right: 0.5rem; }.
|
@copilot apply changes based on the comments in this thread |
- Add missing CSS (.language-notice, .language-badge) to AR/HE files - Add RTL bidi isolation with dir="ltr" for English text in notices - Improve badge accessibility: aria-label + aria-hidden on emoji - Add RTL-specific badge margin (margin-right instead of margin-left) - Apply dir="ltr" to badges in RTL pages (AR/HE) - All 12 language files updated consistently - HTML validation passes Co-authored-by: pethers <[email protected]>
🔍 Lighthouse Performance Audit
📥 Download full Lighthouse report Budget Compliance: Performance budgets enforced via |
news/index_ar.html
Outdated
| background: rgba(0, 217, 255, 0.1); | ||
| } | ||
|
|
||
| .language-notice { |
There was a problem hiding this comment.
Minor formatting inconsistency: The .language-notice rule has extra leading whitespace (8 spaces instead of 4) compared to all other CSS rules and compared to the non-RTL language files. For consistency, this should align with the surrounding CSS indentation level.
| .language-notice { | |
| .language-notice { |
There was a problem hiding this comment.
Fixed in dc02f08. Corrected .language-notice indentation from 8 to 4 spaces to match all other CSS rules.
news/index_he.html
Outdated
| background: rgba(0, 217, 255, 0.1); | ||
| } | ||
|
|
||
| .language-notice { |
There was a problem hiding this comment.
Minor formatting inconsistency: The .language-notice rule has extra leading whitespace (8 spaces instead of 4) compared to all other CSS rules and compared to the non-RTL language files. For consistency, this should align with the surrounding CSS indentation level.
| .language-notice { | |
| .language-notice { |
There was a problem hiding this comment.
Fixed in dc02f08. Corrected .language-notice indentation from 8 to 4 spaces to match all other CSS rules.
news/index_ar.html
Outdated
|
|
||
|
|
There was a problem hiding this comment.
Empty line 269 appears unnecessary and breaks the CSS grouping pattern. Consider removing it to maintain consistent CSS structure with the other language files.
There was a problem hiding this comment.
Fixed in dc02f08. Removed unnecessary empty line to maintain consistent CSS grouping pattern with other language files.
news/index_he.html
Outdated
|
|
||
|
|
There was a problem hiding this comment.
Empty line 269 appears unnecessary and breaks the CSS grouping pattern. Consider removing it to maintain consistent CSS structure with the other language files.
There was a problem hiding this comment.
Fixed in dc02f08. Removed unnecessary empty line to maintain consistent CSS grouping pattern with other language files.
|
@copilot apply changes based on the comments in this thread |
- Fix .language-notice indentation from 8 to 4 spaces (AR/HE) - Remove unnecessary empty line before RTL-specific styles (AR/HE) - Maintain consistent CSS formatting across all language files - HTML validation passes Co-authored-by: pethers <[email protected]>
🔍 Lighthouse Performance Audit
📥 Download full Lighthouse report Budget Compliance: Performance budgets enforced via |

News Index Pages - Language Indicators & Fallback Notices ✅
🎯 Problem Statement
The 14 news index pages (
news/index*.html) were not clearly indicating that content was only available in English/Swedish, causing potential confusion for users accessing non-EN/SV language versions.✅ All PR Review Feedback - ADDRESSED
Round 1 Issues (Commit d3a4bf9):
.language-noticeand.language-badgestyles<span dir="ltr">aria-labelandaria-hidden[dir="rtl"]margin CSSdir="ltr"to badges in RTL pagesRound 2 Issues (Latest commit):
.language-noticefrom 8 to 4 spaces (AR/HE)📊 Implementation Details
CSS Formatting Fixes:
Empty Line Removal:
✅ Quality Assurance
HTML Validation:
npx htmlhint news/index_{ar,he}.html # Result: Scanned 2 files, no errors found ✅CSS Formatting:
All Files Updated:
🎯 Summary
All 12 PR review comments addressed:
Code Quality:
Commits:
0f67368- Initial language indicators implementationd3a4bf9- RTL bidi, missing CSS, accessibility fixesStatus: Ready for approval and merge ✅
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.