-
Notifications
You must be signed in to change notification settings - Fork 1
Description
📋 Issue Type
Bug Fix / i18n Quality
🎯 Objective
Fix meta keywords in all news articles to be localized per language instead of using English-only keywords across all 14 language variants. Currently, Japanese, Arabic, Chinese, Korean, and other non-English articles all have identical English meta keywords, hurting SEO and article quality.
📊 Current State — Evidence from Recent PRs
Affected PRs: #480 (committee reports, merged), #482 (propositions, merged), #483 (motions, open), #485 (breaking news, open)
Example — Committee Reports (all 14 language files have identical English keywords):
<!-- In 2026-02-24-committee-reports-ja.html (Japanese article!) -->
<meta name="keywords" content="committee, reports, betänkanden, parliament, committees, reports, Swedish Parliament, Riksdag, politics, Sweden">
<!-- Same in Arabic, Chinese, Korean, German, French... -->
<meta name="keywords" content="committee, reports, betänkanden, parliament, committees, reports, Swedish Parliament, Riksdag, politics, Sweden">Additional bug: Duplicate keyword "reports" appears twice in committee reports keywords.
Root cause: scripts/article-template.ts line ~318:
<meta name="keywords" content="${keywords.join(', ')}">Keywords are passed in as a static English array from the news-type generators and never localized.
Affected article types: All types — committee-reports, government-propositions, opposition-motions, breaking-news, evening-analysis, week-ahead, month-ahead, weekly-review, monthly-review.
🚀 Desired State
-
Localize meta keywords for each language variant. For example:
ja:"委員会, 報告, 議会, スウェーデン議会, 政治, スウェーデン"ar:"لجنة, تقارير, برلمان, البرلمان السويدي, سياسة, السويد"de:"Ausschuss, Berichte, Parlament, Schwedisches Parlament, Riksdag, Politik, Schweden"
-
Remove duplicate keywords (e.g., "reports" appearing twice)
-
Add keyword localization map to the
LABELSobject indata-transformers.tsor a dedicated keyword translation module
🔧 Implementation Approach
- Add keyword translations to
LABELSobject inscripts/data-transformers.tsfor all 14 languages - Update
scripts/article-template.tsto acceptlangparameter and look up localized keywords - Update all news-type generators (
scripts/news-types/*.ts) to pass language-aware keywords - De-duplicate any existing keyword arrays
- Run
npx vitest runto verify
🤖 Recommended Agent
code-quality-engineer — systematic fix across article template and all news-type generators
✅ Acceptance Criteria
- Meta keywords are localized for all 14 languages in generated articles
- No duplicate keywords in any article
- Keywords include topic-specific terms (not just generic "parliament, politics")
- Existing tests pass (
npx vitest run) - At least core languages (EN, SV, DE, FR, ES, JA, AR, ZH, KO) have keyword translations
📚 References
- Template:
scripts/article-template.tsline ~318 - LABELS:
scripts/data-transformers.tslines 400–1400 - Example bad output:
news/2026-02-24-committee-reports-ja.html— English keywords in Japanese article - PR evidence: 📋 Committee Reports: Energy and Migration Dominate Riksdag Agenda (2026-02-24) #480 (merged), feat(news): Government propositions analysis — 2026-02-24 (14 languages) #482 (merged), feat(news): Opposition Motions Analysis – 24 February 2026 #483, 🔴 Breaking: Sweden files five propositions on civilian defence, psychological violence — 2026-02-24 #485 (open)