Skip to content

Comments

Fix article metadata, translations, language switchers, and CSS standardization#304

Merged
pethers merged 6 commits intonews-evening/2026-02-18-2bd1d50436a1fdabfrom
copilot/sub-pr-303
Feb 18, 2026
Merged

Fix article metadata, translations, language switchers, and CSS standardization#304
pethers merged 6 commits intonews-evening/2026-02-18-2bd1d50436a1fdabfrom
copilot/sub-pr-303

Conversation

Copy link
Contributor

Copilot AI commented Feb 18, 2026

Addresses multiple content quality issues across 305 news articles: incorrect type classification, incomplete translations, broken language navigation, and design system violations.

Changes

Article Type Classification

  • Fixed 14 news index files: 2026-02-18-evening-analysis incorrectly classified as prospective (should be analysis)
  • Impacts UI filtering and type labels across all language versions

SEO Structured Data

  • Added BreadcrumbList JSON-LD to 2026-02-18-evening-analysis-en.html
  • 3-level structure: Home → News → Article Title

Translation Completeness

  • Completed Norwegian (NO), Dutch (NL), French (FR), Chinese (ZH), Korean (KO) translations for 2026-02-18-evening-analysis
  • Previously had large English sections in non-English versions (body paragraphs, context boxes, watch lists)

Language Switcher Implementation

Problem: 179 articles missing language switchers entirely, preventing cross-language navigation

Solution: Auto-discovery script generates switchers between <body> and <article> tags:

<nav class="language-switcher" role="navigation" aria-label="Language versions">
  <a href="article-en.html" class="lang-link active" hreflang="en">🇬🇧 English</a>
  <a href="article-sv.html" class="lang-link" hreflang="sv">🇸🇪 Svenska</a>
  <!-- Only languages that exist for this article -->
</nav>

Accurate Language Discovery

Problem: Language switchers showed all 14 languages regardless of available translations

  • Example: 2026-02-10-biodiversity-citizenship has EN/SV only, but showed all 14 links
  • Result: ~2,100 broken 404 links across 305 articles

Solution: Script scans filenames to detect available translations, generates switchers with only existing languages

Before:

<!-- Shows all 14 languages, 12 are 404s -->
<a href="...da.html">🇩🇰 Dansk</a>
<a href="...no.html">🇳🇴 Norsk</a>
<!-- ... 10 more broken links -->

After:

<!-- Only shows 2 available languages -->
<a href="...en.html" class="lang-link active">🇬🇧 English</a>
<a href="...sv.html" class="lang-link">🇸🇪 Svenska</a>

Design System Compliance

  • Removed embedded <style> blocks from 28 articles (2026-02-10, 2026-02-13, 2026-02-14, generic patterns)
  • All articles now use centralized styles.css
  • Regex-based extraction: <style>.*?</style> with multiline/dotall flags

Scripts Created

  • scripts/add-language-switchers.py - Initial 2026-02-18 articles
  • scripts/add-all-language-switchers.py - Remaining 179 articles
  • scripts/fix-language-switchers-and-css.py - Accurate discovery + CSS cleanup

Impact

  • 305 articles: Language switchers show only existing translations (0 broken links)
  • 28 articles: Embedded CSS removed, design system standardized
  • 14 index files: Correct article type classification

Screenshot

Fixed Language Switcher

Language switcher now displays only 2 available languages (EN, SV) instead of all 14, eliminating broken links.


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

Copilot AI changed the title [WIP] Update foreign policy declaration analysis for Ukraine commitment Fix Evening Analysis type classification and complete multi-language translations Feb 18, 2026
Copilot AI requested a review from pethers February 18, 2026 19:09
Copilot AI changed the title Fix Evening Analysis type classification and complete multi-language translations Add language switchers to 2026-02-18 news articles Feb 18, 2026
Copilot AI changed the title Add language switchers to 2026-02-18 news articles Add language switchers to all 179 articles missing them Feb 18, 2026
Copilot AI changed the title Add language switchers to all 179 articles missing them Fix article metadata, translations, language switchers, and CSS standardization Feb 18, 2026
@pethers pethers marked this pull request as ready for review February 18, 2026 19:53
@pethers pethers merged commit ad31ebf into news-evening/2026-02-18-2bd1d50436a1fdab Feb 18, 2026
@pethers pethers deleted the copilot/sub-pr-303 branch February 18, 2026 19:53
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.

2 participants