Skip to content

Comments

sync: resolve conflicts by taking main branch for all news indexes and sitemap#494

Closed
Copilot wants to merge 12 commits intomainfrom
copilot/fix-meta-keywords-localization
Closed

sync: resolve conflicts by taking main branch for all news indexes and sitemap#494
Copilot wants to merge 12 commits intomainfrom
copilot/fix-meta-keywords-localization

Conversation

Copy link
Contributor

Copilot AI commented Feb 24, 2026

This branch had merge conflicts in 15 files (14 news index HTML files + sitemap.xml) that needed to be resolved by taking the current main branch versions.

Changes

  • news/index*.html (14 files) — replaced with origin/main versions for all language variants: en, ar, da, de, es, fi, fr, he, ja, ko, nl, no, sv, zh
  • sitemap.xml — replaced with origin/main version

All files were checked out directly via git checkout origin/main -- <files>, ensuring byte-for-byte parity with main before this branch's other changes are layered on top.

Original prompt

This section details on the original issue you should resolve

<issue_title>fix(i18n): Meta keywords not localized — English keywords used in all 14 language article variants</issue_title>
<issue_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

  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

<agent_instructions>Fix meta keywords localization in all news articles.

Key tasks:

  1. Add keyword translations to the LABELS object in scripts/data-transformers.ts for all 14 languages. Create language-specific keyword sets for each article type (committee-reports, government-propositions, opposition-motions, etc.).
  2. Update scripts/article-template.ts to use localized keywords based on the lang parameter.
  3. Remove duplicate keywords (e.g., "reports" appears twice in committee reports).
  4. Update all news-type generators in scripts/news-types/*.ts to pass language-aware keywords.
  5. Run npx vitest run to verify all tests pass.

The current code at scripts/article-template.ts line ~318 just does keywords.join(', ') without any localization.</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💡 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] Fix localized meta keywords for all language articles fix(i18n): Localize meta keywords for all 14 language article variants Feb 24, 2026
@pethers pethers requested a review from Copilot February 24, 2026 11:48
@github-actions github-actions bot added deployment Deployment configuration refactor Code refactoring size-xl Extra large change (> 1000 lines) labels Feb 24, 2026
@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

This PR fixes a critical i18n bug where all 14 language variants of articles were emitting identical English <meta name="keywords"> tags, negatively impacting SEO for non-English content. The fix introduces comprehensive keyword localization infrastructure and eliminates a duplicate "reports" keyword that appeared in committee-reports articles.

Changes:

  • Added ARTICLE_TYPE_KEYWORDS map with localized keywords for all 8 article types across all 14 supported languages
  • Added COMMON_KEYWORDS map for localized shared footer keywords (e.g., "Swedish Parliament", "Riksdag", "politics", "Sweden")
  • Refactored generateMetadata to look up keywords by language with English fallback, replacing hardcoded English keyword pushes in the switch statement
  • Implemented Set-based deduplication to eliminate duplicate keywords

zh: ['议会', '下周展望', '日历', '活动'],
},
'committee-reports': {
en: ['committee', 'committee reports', 'parliament', 'legislation'],
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

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

The keyword 'committee reports' contains a space, making it a multi-word keyword. Consider whether this should be two separate keywords 'committee' and 'reports' for consistency with other entries, or if the multi-word phrase is intentional for SEO purposes.

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.

Split into two separate single-word entries 'committee' and 'reports' (commit 605bfea), consistent with all other keyword arrays in the map.

Comment on lines 3208 to 3211
const typeKw: string[] =
ARTICLE_TYPE_KEYWORDS[type]?.[lang] ??
ARTICLE_TYPE_KEYWORDS[type]?.en ??
[];
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

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

The nested optional chaining with double fallback could be simplified using a helper function to improve readability, especially since this pattern is repeated for both typeKw and commonKw.

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.

Extracted a getLocalizedKeywords(map, type, lang) helper (commit 605bfea) that encapsulates the double-fallback. The typeKw lookup now becomes a single call; COMMON_KEYWORDS uses a compact inline expression since it has a different shape.

@pethers
Copy link
Member

pethers commented Feb 24, 2026

@copilot apply changes based on the comments in this thread

@github-actions github-actions bot added the size-m Medium change (50-250 lines) label Feb 24, 2026
@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

@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 1 out of 1 changed files in this pull request and generated 1 comment.

Comment on lines 3289 to 3290
// Deduplicate while preserving insertion order (also eliminates duplicate 'reports'
// that previously arose when data.reports was present alongside the committee-reports type)
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

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

The deduplication comment mentions the 'reports' duplication fix, but there's still an i18n issue: lines 3280 and 3283 (just above the changed region) add English-only keywords ('calendar', 'events', 'debates', 'committees', 'reports') when data.events or data.reports are present. These will appear in all 14 language variants. Consider creating a DATA_DRIVEN_KEYWORDS map similar to ARTICLE_TYPE_KEYWORDS to localize these data-driven keywords as well.

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.

Added DATA_DRIVEN_KEYWORDS map (commit e8e344f) with entries for 'events' (calendar/events/debates) and 'reports' (committees/reports) in all 14 languages. The if (data.events) and if (data.reports) blocks now call getLocalizedKeywords(DATA_DRIVEN_KEYWORDS, …, lang) instead of pushing English strings directly.

@pethers
Copy link
Member

pethers commented Feb 24, 2026

@copilot apply changes based on the comments in this thread

@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 3 changed files in this pull request and generated no new comments.

@github-actions github-actions bot added html-css HTML/CSS changes i18n Internationalization/localization translation Translation updates rtl RTL language support (Arabic, Hebrew) news News articles and content generation labels Feb 24, 2026
…s, tests, index_ja.html, sitemap.xml

Co-authored-by: pethers <[email protected]>
Copilot AI changed the title fix(i18n): Localize meta keywords for all 14 language article variants sync: resolve merge conflicts and TS2345 in data-transformers.ts Feb 24, 2026
@pethers
Copy link
Member

pethers commented Feb 24, 2026

@copilot — This PR has merge conflicts in 15 files that must all be resolved before it can merge. For each conflicting file listed below, resolve the conflict by taking the version from main since these are all generated output files:

news/index.html
news/index_ar.html
news/index_da.html
news/index_de.html
news/index_es.html
news/index_fi.html
news/index_fr.html
news/index_he.html
news/index_ja.html
news/index_ko.html
news/index_nl.html
news/index_no.html
news/index_sv.html
news/index_zh.html
sitemap.xml
For each file: read the current version from main branch and update the file on this branch (copilot/fix-meta-keywords-localization) to match main's version exactly. Do this for ALL 15 files — do not stop after a few.

Copilot AI changed the title sync: resolve merge conflicts and TS2345 in data-transformers.ts sync: resolve conflicts by taking main branch for all news indexes and sitemap Feb 24, 2026
Copy link
Contributor Author

Copilot AI commented Feb 24, 2026

@copilot — This PR has merge conflicts in 15 files that must all be resolved before it can merge. For each conflicting file listed below, resolve the conflict by taking the version...

All 15 files have been resolved by taking the main branch versions — done in commit b4720f0. Running git diff origin/main against all 15 files produces no output, confirming byte-for-byte parity with main.

@github-actions github-actions bot added the size-xs Extra small change (< 10 lines) label Feb 24, 2026
@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

@pethers pethers closed this Feb 24, 2026
@pethers pethers deleted the copilot/fix-meta-keywords-localization branch February 24, 2026 21:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cis-controls CIS Controls deployment Deployment configuration documentation Documentation updates html-css HTML/CSS changes i18n Internationalization/localization isms ISMS compliance changes iso-27001 ISO 27001 controls news News articles and content generation nist-csf NIST CSF compliance refactor Code refactoring rtl RTL language support (Arabic, Hebrew) security Security improvements size-m Medium change (50-250 lines) size-xl Extra large change (> 1000 lines) size-xs Extra small change (< 10 lines) testing Test coverage translation Translation updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants