-
Notifications
You must be signed in to change notification settings - Fork 1
Closed
Labels
Description
📋 Issue Type
Bug Fix / i18n Quality
🎯 Objective
Fix Twitter Card twitter:label1 ("Reading time") and twitter:label2 ("Article type") to be localized per language. Currently these labels remain in English for all non-English language variants while only the twitter:data1 and twitter:data2 values are translated.
📊 Current State — Evidence from Recent PRs
Affected PRs: All news article PRs — #480, #482, #483, #485
Example — Government Propositions articles:
<!-- In 2026-02-24-government-propositions-de.html (German) -->
<meta name="twitter:label1" content="Reading time"> <!-- ❌ Should be "Lesezeit" -->
<meta name="twitter:data1" content="5 Min. Lesezeit"> <!-- ✅ Correctly localized -->
<meta name="twitter:label2" content="Article type"> <!-- ❌ Should be "Artikeltyp" -->
<meta name="twitter:data2" content="Analyse"> <!-- ✅ Correctly localized -->
<!-- Same pattern in Japanese, Arabic, Chinese, Korean, French, etc. -->
<meta name="twitter:label1" content="Reading time"> <!-- ❌ English in all languages -->
<meta name="twitter:label2" content="Article type"> <!-- ❌ English in all languages -->Root cause: scripts/article-template.ts lines 347-349:
<meta name="twitter:label1" content="Reading time">
<meta name="twitter:label2" content="Article type">These are hardcoded English strings. The template already receives a lang parameter but doesn't use it for label localization.
🚀 Desired State
Twitter Card labels localized per language:
| Language | twitter:label1 | twitter:label2 |
|---|---|---|
| en | Reading time | Article type |
| sv | Lästid | Artikeltyp |
| de | Lesezeit | Artikeltyp |
| fr | Temps de lecture | Type d'article |
| es | Tiempo de lectura | Tipo de artículo |
| ja | 読了時間 | 記事タイプ |
| ar | وقت القراءة | نوع المقال |
| zh | 阅读时间 | 文章类型 |
| ko | 읽기 시간 | 기사 유형 |
| da | Læsetid | Artikeltype |
| no | Lesetid | Artikkeltype |
| fi | Lukuaika | Artikkelityyppi |
| nl | Leestijd | Artikeltype |
| he | זמן קריאה | סוג כתבה |
🔧 Implementation Approach
- Add
twitterLabel1andtwitterLabel2translations to theLABELSobject inscripts/data-transformers.ts - Update
scripts/article-template.tsto acceptlangand look up localized Twitter labels - Run
npx vitest runto verify
🤖 Recommended Agent
code-quality-engineer — systematic fix in article template with translation table
✅ Acceptance Criteria
-
twitter:label1is localized for all 14 languages -
twitter:label2is localized for all 14 languages - Existing
twitter:data1andtwitter:data2localization still works - Existing tests pass (
npx vitest run)
📚 References
- Template:
scripts/article-template.tslines 347-349 - LABELS:
scripts/data-transformers.tslines 400-1400 - Evidence: All articles in
news/2026-02-24-*-{de,fr,ja,ar,ko,zh}.html - PR evidence: 📋 Committee Reports: Energy and Migration Dominate Riksdag Agenda (2026-02-24) #480, feat(news): Government propositions analysis — 2026-02-24 (14 languages) #482, feat(news): Opposition Motions Analysis – 24 February 2026 #483, 🔴 Breaking: Sweden files five propositions on civilian defence, psychological violence — 2026-02-24 #485
Reactions are currently unavailable