Skip to content

Comments

Add Arabic and Hebrew news index pages with RTL support#103

Merged
pethers merged 4 commits intomainfrom
copilot/create-arabic-hebrew-index-pages
Feb 11, 2026
Merged

Add Arabic and Hebrew news index pages with RTL support#103
pethers merged 4 commits intomainfrom
copilot/create-arabic-hebrew-index-pages

Conversation

Copy link
Contributor

Copilot AI commented Feb 11, 2026

✅ PR Review Comments Addressed

Changes Made

1. Fixed Hreflang Tags (Comments #2794199418, #2794199483)

  • ✅ Removed references to non-existent news pages (DA, NO, FI, DE, FR, ES, NL, JA, KO, ZH)
  • ✅ Limited hreflang tags to existing pages only: EN, SV, AR, HE + x-default
  • ✅ Prevents broken alternate links for crawlers

Before:

<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">
<!-- ... 10+ non-existent pages ... -->

After:

<link rel="alternate" hreflang="en" href="https://riksdagsmonitor.com/news/">
<link rel="alternate" hreflang="sv" href="https://riksdagsmonitor.com/news/index_sv.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="x-default" href="https://riksdagsmonitor.com/news/">

2. Localized Article Type Badges (Comments #2794199523, #2794199546)

  • ✅ Added type label mapping for Arabic and Hebrew
  • ✅ Article type badges now show translated labels instead of internal keys

Arabic (index_ar.html):

const typeLabels = {
  'prospective': 'استباقي',      // Prospective
  'retrospective': 'استعراضي',   // Retrospective
  'analysis': 'تحليل'             // Analysis
};

Hebrew (index_he.html):

const typeLabels = {
  'prospective': 'פרוספקטיבי',    // Prospective
  'retrospective': 'רטרוספקטיבי', // Retrospective
  'analysis': 'ניתוח'              // Analysis
};

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)

  • ✅ Changed from new Date(dateStr) to component-based parsing
  • ✅ Prevents date display shifting due to UTC interpretation

Before:

function formatDate(dateStr) {
  const date = new Date(dateStr); // UTC parsing can cause day shifts
  const months = ['يناير', 'فبراير', ...];
  return `${date.getDate()} ${months[date.getMonth()]} ${date.getFullYear()}`;
}

After:

function formatDate(dateStr) {
  // Parse date components to avoid timezone issues
  const [year, month, day] = dateStr.split('-').map(Number);
  const date = new Date(year, month - 1, day);
  const months = ['يناير', 'فبراير', ...];
  return `${date.getDate()} ${months[date.getMonth()]} ${date.getFullYear()}`;
}

📸 Updated Screenshots

Arabic News Page (news/index_ar.html)

Arabic with Localized Type Badges

Key improvements visible:

  • ✅ Article type badges now show "استباقي" (prospective), "استعراضي" (retrospective), "تحليل" (analysis)
  • ✅ RTL layout maintained
  • ✅ All UI elements in Modern Standard Arabic

Hebrew News Page (news/index_he.html)

Hebrew with Localized Type Badges

Key improvements visible:

  • ✅ Article type badges now show "פרוספקטיבי" (prospective), "רטרוספקטיבי" (retrospective), "ניתוח" (analysis)
  • ✅ RTL layout maintained
  • ✅ All UI elements in Modern Israeli Hebrew

✅ Validation Results

HTML Validation

✅ PASSED - Scanned 2 files, no errors found

Changes Summary

news/index_ar.html | 23 +++++++++++------------
news/index_he.html | 23 +++++++++++------------
2 files changed, 22 insertions(+), 24 deletions(-)

Files Modified

  1. news/index_ar.html

    • Reduced hreflang tags from 15 to 5 (existing pages only)
    • Added typeLabels mapping for Arabic
    • Fixed formatDate() to parse date components
  2. news/index_he.html

    • Reduced hreflang tags from 15 to 5 (existing pages only)
    • Added typeLabels mapping for Hebrew
    • Fixed formatDate() to parse date components

🎯 All PR Review Comments Addressed

Comment ID Issue Status
#2794199418 Hreflang references non-existent pages (AR) ✅ Fixed
#2794199483 Hreflang references non-existent pages (HE) ✅ Fixed
#2794199523 Article type badges not localized (AR) ✅ Fixed
#2794199546 Article type badges not localized (HE) ✅ Fixed
#2794199570 Date parsing timezone issue (AR) ✅ Fixed
#2794199601 Date parsing timezone issue (HE) ✅ Fixed

All issues raised in the PR review have been resolved. The pages now:

  • ✅ Only reference existing hreflang alternates
  • ✅ Display fully localized UI including article type badges
  • ✅ Use timezone-safe date parsing for consistent display
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

  • 2 new news index pages created with RTL layout support
  • Each page based on current news/index.html structure
  • Fully translated UI with proper Arabic/Hebrew typography
  • RTL-aware CSS (dir="rtl", text-align: right, flex-direction: row-reverse)
  • Proper hreflang tags for SEO
  • Consistent cyberpunk theme with RTL adaptations
  • Mirror layout for RTL languages while maintaining visual hierarchy

🌐 Translation & Content Alignment

Translation Guide(s):

  • Swedish-Translation-Guide.md (for terminology consistency)
  • CIA Triad terminology in Arabic/Hebrew

Related Homepage Page(s):

  • cia-features.html (AR/HE versions)
  • cia-docs.html (documentation terminology)
  • swedish-election-2026.html (AR/HE versions)

Multi-Language Scope: 2 RTL languages (AR, HE)

Implementation Notes:

  • Arabic: Use Modern Standard Arabic (MSA / الفصحى) for formal political journalism
  • Avoid dialectal variations (Egyptian, Levantine, Gulf, etc.)
  • Hebrew: Use Modern Israeli Hebrew for political terminology
  • RTL layout requires CSS mirroring: navigation, filters, cards, footers
  • Numbers in Arabic may use Eastern Arabic numerals (٠-٩) or Western (0-9) - prefer Western for consistency
  • Dates: AR uses "DD شهر YYYY", HE uses "DD חודש YYYY"

📊 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:

  1. news/index_ar.html (Arabic)

    • Title: "الأخبار - Riksdagsmonitor"
    • Subtitle: "آخر التحليلات من البرلمان السويدي (ريكسداغ)"
    • Description: "صحافة سياسية مدفوعة بالذكاء الاصطناعي مع قدرات CIA OSINT"
    • RTL attributes: <html lang="ar" dir="rtl">
    • Filter labels: "الكل", "الأسبوع القادم", "اللجان", "المقترحات", إلخ.
    • Date format: "DD شهر YYYY" (e.g., "١٠ فبراير ٢٠٢٦" or "10 فبراير 2026")
  2. news/index_he.html (Hebrew)

    • Title: "חדשות - Riksdagsmonitor"
    • Subtitle: "ניתוחים אחרונים מהפרלמנט השוודי (ריקסדאג)"
    • Description: "עיתונות פוליטית מונעת AI עם יכולות CIA OSINT"
    • RTL attributes: <html lang="he" dir="rtl">
    • Filter labels: "הכל", "השבוע הבא", "ועדות", "הצעות", וכו'.
    • Date format: "DD חודש YYYY" (e.g., "10 פברואר 2026")

RTL-Specific CSS Adaptations:

/* Apply to AR/HE pages */
[dir="rtl"] {
  text-align: right;
  direction: rtl;
}

[dir="rtl"] .filter-bar {
  flex-direction: row-reverse;
}

[dir="rtl"] .breadcrumb {
  flex-direction: row-reverse;
}

[dir="rtl"] .article-card {
  text-align: right;
}

[dir="rtl"] .language-switcher {
  left: auto;
  right: 1rem;
}

/* Mirror navigation arrows */
[dir="rtl"] .arrow-right::before {
  content: "←";
}

[dir="rtl"] .arrow-left::before {
  content: "→";
}

Arabic-Specific Translations:

  • "News" → "الأخبار" (al-Akhbār)
  • "AI-Disrupted Political Journalism" → "صحافة سياسية مدفوعة بالذكاء الاصطناعي"
  • "Parliament" → "البرلمان" (al-Barlamān)
  • "Government" → "الحكومة" (al-Ḥukūmah)
  • "Agencies" → "الوكالات" (al-Wakālāt)
  • "Week Ahead" → "الأسبوع القادم"
  • "Committee Reports" → "تقارير اللجان"
  • "Read more" → "اقرأ المزيد"

Hebrew-Specific Translations:

  • "News" → "חדשות" (Hadashot)
  • "AI-Disrupted Political Journalism" → "עיתונות פוליטית מונעת AI"
  • "Parliament" → "פרלמנט" (Parlament)
  • "Government" → "ממשלה" (Memshalah)
  • "Agencies" → "סוכנויות" (Sokhnut)
  • "Week Ahead" → "השבוע הבא"
  • "Committee Reports" → "דוחות ועדה"
  • "Read more" → "קרא עוד"

Technical Requirements:

  • Base structure on news/index.html
  • Add dir="rtl" to <html> tag
  • Update <html lang="ar"> / <html lang="he"> attribute
  • Include RTL-specific CSS overrides
  • Translate al...

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Create news/index pages for Arabic and Hebrew with RTL support Add Arabic and Hebrew news index pages with RTL support Feb 11, 2026
Copilot AI requested a review from pethers February 11, 2026 16:11
@pethers pethers requested a review from Copilot February 11, 2026 16:16
@github-actions
Copy link
Contributor

🔍 Lighthouse Performance Audit

Category Score Status
Performance 85/100 🟡
Accessibility 95/100 🟢
Best Practices 90/100 🟢
SEO 95/100 🟢

📥 Download full Lighthouse report

Budget Compliance: Performance budgets enforced via budget.json

Copy link
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

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) and news/index_he.html (Hebrew) with dir="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.

Comment on lines 30 to 41
<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">
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

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

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).

Suggested change
<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">

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

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.

Comment on lines 30 to 41
<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">
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

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

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).

Suggested change
<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">

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

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.

Comment on lines 413 to 416
<div class="article-meta">
<time class="article-date" datetime="${article.date}">${formatDate(article.date)}</time>
<span class="article-type">${article.type}</span>
</div>
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

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

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).

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in commit 0d36ff5. Added typeLabels mapping to display localized article type badges: 'استباقي' (prospective), 'استعراضي' (retrospective), 'تحليل' (analysis).

Arabic localized badges

Comment on lines 413 to 416
<div class="article-meta">
<time class="article-date" datetime="${article.date}">${formatDate(article.date)}</time>
<span class="article-type">${article.type}</span>
</div>
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

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

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).

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in commit 0d36ff5. Added typeLabels mapping to display localized article type badges: 'פרוספקטיבי' (prospective), 'רטרוספקטיבי' (retrospective), 'ניתוח' (analysis).

Hebrew localized badges

Comment on lines 428 to 432
function formatDate(dateStr) {
const date = new Date(dateStr);
const months = ['يناير', 'فبراير', 'مارس', 'أبريل', 'مايو', 'يونيو', 'يوليو', 'أغسطس', 'سبتمبر', 'أكتوبر', 'نوفمبر', 'ديسمبر'];
return `${date.getDate()} ${months[date.getMonth()]} ${date.getFullYear()}`;
}
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

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.

Comment on lines 428 to 432
function formatDate(dateStr) {
const date = new Date(dateStr);
const months = ['ינואר', 'פברואר', 'מרץ', 'אפריל', 'מאי', 'יוני', 'יולי', 'אוגוסט', 'ספטמבר', 'אוקטובר', 'נובמבר', 'דצמבר'];
return `${date.getDate()} ${months[date.getMonth()]} ${date.getFullYear()}`;
}
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

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.

@pethers
Copy link
Member

pethers commented Feb 11, 2026

@copilot apply changes based on the comments in this thread

…cle type badges, fix date parsing

Co-authored-by: pethers <[email protected]>
@github-actions
Copy link
Contributor

🔍 Lighthouse Performance Audit

Category Score Status
Performance 85/100 🟡
Accessibility 95/100 🟢
Best Practices 90/100 🟢
SEO 95/100 🟢

📥 Download full Lighthouse report

Budget Compliance: Performance budgets enforced via budget.json

Copy link
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

Copilot reviewed 2 out of 7 changed files in this pull request and generated no new comments.

@pethers pethers marked this pull request as ready for review February 11, 2026 16:42
@pethers pethers merged commit f07abe3 into main Feb 11, 2026
16 checks passed
@pethers pethers deleted the copilot/create-arabic-hebrew-index-pages branch February 11, 2026 16:43
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.

Create news/index pages for Arabic and Hebrew with RTL support (AR, HE)

2 participants