Add Arabic and Hebrew news index pages with RTL support#103
Conversation
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 RTL-capable Arabic and Hebrew localized news index pages to extend the site’s multi-language news section.
Changes:
- Created
news/index_ar.html(Arabic) andnews/index_he.html(Hebrew) withdir="rtl"and RTL-specific CSS overrides. - Implemented localized UI strings, filtering/sorting UI, and locale-specific month-name date formatting.
- Added SEO metadata (Open Graph/Twitter) and expanded hreflang sets (but currently pointing to non-existent pages).
Reviewed changes
Copilot reviewed 2 out of 5 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| news/index_ar.html | New Arabic RTL news index page with filters, article rendering, and SEO tags. |
| news/index_he.html | New Hebrew RTL news index page with filters, article rendering, and SEO tags. |
news/index_ar.html
Outdated
| <link rel="alternate" hreflang="da" href="https://riksdagsmonitor.com/news/index_da.html"> | ||
| <link rel="alternate" hreflang="no" href="https://riksdagsmonitor.com/news/index_no.html"> | ||
| <link rel="alternate" hreflang="fi" href="https://riksdagsmonitor.com/news/index_fi.html"> | ||
| <link rel="alternate" hreflang="de" href="https://riksdagsmonitor.com/news/index_de.html"> | ||
| <link rel="alternate" hreflang="fr" href="https://riksdagsmonitor.com/news/index_fr.html"> | ||
| <link rel="alternate" hreflang="es" href="https://riksdagsmonitor.com/news/index_es.html"> | ||
| <link rel="alternate" hreflang="nl" href="https://riksdagsmonitor.com/news/index_nl.html"> | ||
| <link rel="alternate" hreflang="ar" href="https://riksdagsmonitor.com/news/index_ar.html"> | ||
| <link rel="alternate" hreflang="he" href="https://riksdagsmonitor.com/news/index_he.html"> | ||
| <link rel="alternate" hreflang="ja" href="https://riksdagsmonitor.com/news/index_ja.html"> | ||
| <link rel="alternate" hreflang="ko" href="https://riksdagsmonitor.com/news/index_ko.html"> | ||
| <link rel="alternate" hreflang="zh" href="https://riksdagsmonitor.com/news/index_zh.html"> |
There was a problem hiding this comment.
The hreflang block references multiple news index pages (da/no/fi/de/fr/es/nl/ja/ko/zh) that do not exist in this repo (news/ currently only contains index.html, index_sv.html, index_ar.html, index_he.html). This will create broken alternate links for crawlers and can fail link checking. Either add the missing localized news index pages in the same PR, or limit hreflang entries to pages that actually exist (plus x-default).
| <link rel="alternate" hreflang="da" href="https://riksdagsmonitor.com/news/index_da.html"> | |
| <link rel="alternate" hreflang="no" href="https://riksdagsmonitor.com/news/index_no.html"> | |
| <link rel="alternate" hreflang="fi" href="https://riksdagsmonitor.com/news/index_fi.html"> | |
| <link rel="alternate" hreflang="de" href="https://riksdagsmonitor.com/news/index_de.html"> | |
| <link rel="alternate" hreflang="fr" href="https://riksdagsmonitor.com/news/index_fr.html"> | |
| <link rel="alternate" hreflang="es" href="https://riksdagsmonitor.com/news/index_es.html"> | |
| <link rel="alternate" hreflang="nl" href="https://riksdagsmonitor.com/news/index_nl.html"> | |
| <link rel="alternate" hreflang="ar" href="https://riksdagsmonitor.com/news/index_ar.html"> | |
| <link rel="alternate" hreflang="he" href="https://riksdagsmonitor.com/news/index_he.html"> | |
| <link rel="alternate" hreflang="ja" href="https://riksdagsmonitor.com/news/index_ja.html"> | |
| <link rel="alternate" hreflang="ko" href="https://riksdagsmonitor.com/news/index_ko.html"> | |
| <link rel="alternate" hreflang="zh" href="https://riksdagsmonitor.com/news/index_zh.html"> | |
| <link rel="alternate" hreflang="ar" href="https://riksdagsmonitor.com/news/index_ar.html"> | |
| <link rel="alternate" hreflang="he" href="https://riksdagsmonitor.com/news/index_he.html"> |
There was a problem hiding this comment.
Fixed in commit 0d36ff5. Removed hreflang references to non-existent pages (DA, NO, FI, DE, FR, ES, NL, JA, KO, ZH). Now only includes existing pages: EN, SV, AR, HE + x-default.
news/index_he.html
Outdated
| <link rel="alternate" hreflang="da" href="https://riksdagsmonitor.com/news/index_da.html"> | ||
| <link rel="alternate" hreflang="no" href="https://riksdagsmonitor.com/news/index_no.html"> | ||
| <link rel="alternate" hreflang="fi" href="https://riksdagsmonitor.com/news/index_fi.html"> | ||
| <link rel="alternate" hreflang="de" href="https://riksdagsmonitor.com/news/index_de.html"> | ||
| <link rel="alternate" hreflang="fr" href="https://riksdagsmonitor.com/news/index_fr.html"> | ||
| <link rel="alternate" hreflang="es" href="https://riksdagsmonitor.com/news/index_es.html"> | ||
| <link rel="alternate" hreflang="nl" href="https://riksdagsmonitor.com/news/index_nl.html"> | ||
| <link rel="alternate" hreflang="ar" href="https://riksdagsmonitor.com/news/index_ar.html"> | ||
| <link rel="alternate" hreflang="he" href="https://riksdagsmonitor.com/news/index_he.html"> | ||
| <link rel="alternate" hreflang="ja" href="https://riksdagsmonitor.com/news/index_ja.html"> | ||
| <link rel="alternate" hreflang="ko" href="https://riksdagsmonitor.com/news/index_ko.html"> | ||
| <link rel="alternate" hreflang="zh" href="https://riksdagsmonitor.com/news/index_zh.html"> |
There was a problem hiding this comment.
The hreflang block references multiple news index pages (da/no/fi/de/fr/es/nl/ja/ko/zh) that do not exist in this repo (news/ currently only contains index.html, index_sv.html, index_ar.html, index_he.html). This will create broken alternate links for crawlers and can fail link checking. Either add the missing localized news index pages in the same PR, or limit hreflang entries to pages that actually exist (plus x-default).
| <link rel="alternate" hreflang="da" href="https://riksdagsmonitor.com/news/index_da.html"> | |
| <link rel="alternate" hreflang="no" href="https://riksdagsmonitor.com/news/index_no.html"> | |
| <link rel="alternate" hreflang="fi" href="https://riksdagsmonitor.com/news/index_fi.html"> | |
| <link rel="alternate" hreflang="de" href="https://riksdagsmonitor.com/news/index_de.html"> | |
| <link rel="alternate" hreflang="fr" href="https://riksdagsmonitor.com/news/index_fr.html"> | |
| <link rel="alternate" hreflang="es" href="https://riksdagsmonitor.com/news/index_es.html"> | |
| <link rel="alternate" hreflang="nl" href="https://riksdagsmonitor.com/news/index_nl.html"> | |
| <link rel="alternate" hreflang="ar" href="https://riksdagsmonitor.com/news/index_ar.html"> | |
| <link rel="alternate" hreflang="he" href="https://riksdagsmonitor.com/news/index_he.html"> | |
| <link rel="alternate" hreflang="ja" href="https://riksdagsmonitor.com/news/index_ja.html"> | |
| <link rel="alternate" hreflang="ko" href="https://riksdagsmonitor.com/news/index_ko.html"> | |
| <link rel="alternate" hreflang="zh" href="https://riksdagsmonitor.com/news/index_zh.html"> | |
| <link rel="alternate" hreflang="ar" href="https://riksdagsmonitor.com/news/index_ar.html"> | |
| <link rel="alternate" hreflang="he" href="https://riksdagsmonitor.com/news/index_he.html"> |
There was a problem hiding this comment.
Fixed in commit 0d36ff5. Removed hreflang references to non-existent pages (DA, NO, FI, DE, FR, ES, NL, JA, KO, ZH). Now only includes existing pages: EN, SV, AR, HE + x-default.
| <div class="article-meta"> | ||
| <time class="article-date" datetime="${article.date}">${formatDate(article.date)}</time> | ||
| <span class="article-type">${article.type}</span> | ||
| </div> |
There was a problem hiding this comment.
The article type badge renders the internal type key (e.g., "prospective", "analysis") rather than a localized label. Since the filter UI is translated, showing untranslated type keys in each card is inconsistent for users. Add a mapping from type -> localized label when rendering (or store a localized displayType per article).
There was a problem hiding this comment.
Fixed in commit 0d36ff5. Added typeLabels mapping to display localized article type badges: 'استباقي' (prospective), 'استعراضي' (retrospective), 'تحليل' (analysis).
| <div class="article-meta"> | ||
| <time class="article-date" datetime="${article.date}">${formatDate(article.date)}</time> | ||
| <span class="article-type">${article.type}</span> | ||
| </div> |
There was a problem hiding this comment.
The article type badge renders the internal type key (e.g., "prospective", "analysis") rather than a localized label. Since the filter UI is translated, showing untranslated type keys in each card is inconsistent for users. Add a mapping from type -> localized label when rendering (or store a localized displayType per article).
There was a problem hiding this comment.
Fixed in commit 0d36ff5. Added typeLabels mapping to display localized article type badges: 'פרוספקטיבי' (prospective), 'רטרוספקטיבי' (retrospective), 'ניתוח' (analysis).
| function formatDate(dateStr) { | ||
| const date = new Date(dateStr); | ||
| const months = ['يناير', 'فبراير', 'مارس', 'أبريل', 'مايو', 'يونيو', 'يوليو', 'أغسطس', 'سبتمبر', 'أكتوبر', 'نوفمبر', 'ديسمبر']; | ||
| return `${date.getDate()} ${months[date.getMonth()]} ${date.getFullYear()}`; | ||
| } |
There was a problem hiding this comment.
new Date(dateStr) with an ISO date-only string (YYYY-MM-DD) is parsed as UTC in modern browsers, which can display the previous/next day for users in certain time zones. To keep dates stable, parse the components and construct a local Date (or append "T00:00:00" and treat consistently) before formatting.
There was a problem hiding this comment.
Fixed in commit 0d36ff5. Changed date parsing to parse components (dateStr.split('-').map(Number)) and construct local Date to avoid timezone issues with ISO date strings.
| function formatDate(dateStr) { | ||
| const date = new Date(dateStr); | ||
| const months = ['ינואר', 'פברואר', 'מרץ', 'אפריל', 'מאי', 'יוני', 'יולי', 'אוגוסט', 'ספטמבר', 'אוקטובר', 'נובמבר', 'דצמבר']; | ||
| return `${date.getDate()} ${months[date.getMonth()]} ${date.getFullYear()}`; | ||
| } |
There was a problem hiding this comment.
new Date(dateStr) with an ISO date-only string (YYYY-MM-DD) is parsed as UTC in modern browsers, which can display the previous/next day for users in certain time zones. To keep dates stable, parse the components and construct a local Date (or append "T00:00:00" and treat consistently) before formatting.
There was a problem hiding this comment.
Fixed in commit 0d36ff5. Changed date parsing to parse components (dateStr.split('-').map(Number)) and construct local Date to avoid timezone issues with ISO date strings.
|
@copilot apply changes based on the comments in this thread |
…cle type badges, fix date parsing Co-authored-by: pethers <[email protected]>
🔍 Lighthouse Performance Audit
📥 Download full Lighthouse report Budget Compliance: Performance budgets enforced via |


✅ PR Review Comments Addressed
Changes Made
1. Fixed Hreflang Tags (Comments #2794199418, #2794199483)
Before:
After:
2. Localized Article Type Badges (Comments #2794199523, #2794199546)
Arabic (index_ar.html):
Hebrew (index_he.html):
Before: Article cards showed "prospective", "analysis" (English internal keys)
After: Article cards show "استباقي", "تحليل" (Arabic) or "פרוספקטיבי", "ניתוח" (Hebrew)
3. Fixed Date Parsing Timezone Issue (Comments #2794199570, #2794199601)
new Date(dateStr)to component-based parsingBefore:
After:
📸 Updated Screenshots
Arabic News Page (news/index_ar.html)
Key improvements visible:
Hebrew News Page (news/index_he.html)
Key improvements visible:
✅ Validation Results
HTML Validation
Changes Summary
Files Modified
news/index_ar.html
news/index_he.html
🎯 All PR Review Comments Addressed
All issues raised in the PR review have been resolved. The pages now:
Original prompt
This section details on the original issue you should resolve
<issue_title>Create news/index pages for Arabic and Hebrew with RTL support (AR, HE)</issue_title>
<issue_description>## 📋 Issue Type
Feature Implementation
🎯 Objective
Create news/index_*.html pages for Arabic and Hebrew with proper RTL (Right-to-Left) support to expand AI-disrupted political journalism coverage to Middle Eastern audiences.
📊 Current State
🚀 Desired State
🌐 Translation & Content Alignment
Translation Guide(s):
Related Homepage Page(s):
Multi-Language Scope: 2 RTL languages (AR, HE)
Implementation Notes:
📊 CIA Data Integration Context
CIA Product(s): All 19 visualization products (Party Performance, Top 10 Rankings, Risk Assessments, etc.)
Data Source: JSON exports from https://github.com/Hack23/cia
Sample Data: service.data.impl/sample-data/
Methodology: OSINT methodologies from DATA_ANALYSIS_INTOP_OSINT.md
Implementation Notes:
🔧 Implementation Approach
Pages to Create:
news/index_ar.html (Arabic)
<html lang="ar" dir="rtl">news/index_he.html (Hebrew)
<html lang="he" dir="rtl">RTL-Specific CSS Adaptations:
Arabic-Specific Translations:
Hebrew-Specific Translations:
Technical Requirements:
dir="rtl"to<html>tag<html lang="ar">/<html lang="he">attribute✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.