Skip to content

fix(i18n): Meta keywords not localized — English keywords used in all 14 language article variants #488

@pethers

Description

@pethers

📋 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

  1. Localize meta keywords for each language variant. For example:

    • ja: "委員会, 報告, 議会, スウェーデン議会, 政治, スウェーデン"
    • ar: "لجنة, تقارير, برلمان, البرلمان السويدي, سياسة, السويد"
    • de: "Ausschuss, Berichte, Parlament, Schwedisches Parlament, Riksdag, Politik, Schweden"
  2. Remove duplicate keywords (e.g., "reports" appearing twice)

  3. Add keyword localization map to the LABELS object in data-transformers.ts or a dedicated keyword translation module

🔧 Implementation Approach

  1. Add keyword translations to LABELS object in scripts/data-transformers.ts for all 14 languages
  2. Update scripts/article-template.ts to accept lang parameter and look up localized keywords
  3. Update all news-type generators (scripts/news-types/*.ts) to pass language-aware keywords
  4. De-duplicate any existing keyword arrays
  5. Run npx vitest run to 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

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions