Skip to content

Fix CSP inline-script/style, Dutch lang attrs, Swedish/French UI localisation#837

Merged
pethers merged 2 commits intoevening-analysis-2026-03-05-13bbbf9821635a4dfrom
copilot/sub-pr-836
Mar 5, 2026
Merged

Fix CSP inline-script/style, Dutch lang attrs, Swedish/French UI localisation#837
pethers merged 2 commits intoevening-analysis-2026-03-05-13bbbf9821635a4dfrom
copilot/sub-pr-836

Conversation

Copy link
Contributor

Copilot AI commented Mar 5, 2026

PR review on the 2026-03-05 evening analysis batch flagged four issues: 'unsafe-inline' in CSP, English UI strings on the Swedish page, a mismatched <h1> on the French page, and English body content in the Dutch page lacking lang attributes.

CSP hardening + theme-init extraction (all 14 files)

  • Removed 'unsafe-inline' from script-src and style-src
  • Extracted the anti-flash inline snippet into js/theme-init.js; all pages now reference it externally
  • Removed media="print" onload="this.media='all'" inline event handler from the Orbitron font link
<!-- before -->
<meta http-equiv="Content-Security-Policy" content="... script-src 'self' 'unsafe-inline' https:; style-src 'self' 'unsafe-inline' ...">
<link rel="stylesheet" href="https://fonts.googleapis.com/...Orbitron..." media="print" onload="this.media='all'">
<script>(function(){var key='riksdagsmonitor-theme';...})();</script>

<!-- after -->
<meta http-equiv="Content-Security-Policy" content="... script-src 'self' https:; style-src 'self' https://fonts.googleapis.com ...">
<link rel="stylesheet" href="https://fonts.googleapis.com/...Orbitron...">
<script src="../js/theme-init.js"></script>

Swedish UI localisation (sv.html)

  • Skip-link, theme-toggle aria-label/title/data-label-*, and language-switcher aria-label were all English; now Swedish ("Hoppa till huvudinnehåll", "Byt till mörkt/ljust läge", "Språkversioner")

French <h1> alignment (fr.html)

  • <h1> was missing the "Analyse du soir : " prefix present in <title>, OG, Twitter, and JSON-LD headline

Dutch content language tagging (nl.html)

  • Body paragraphs, English <h2> headings, and both list groups are in English while the page is declared lang="nl"; added lang="en" at paragraph, heading, and <ul> level so assistive tech switches pronunciation correctly

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

…localization

Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
Copilot AI changed the title [WIP] Add evening analysis for March 5, 2026 Fix CSP inline-script/style, Dutch lang attrs, Swedish/French UI localisation Mar 5, 2026
@pethers pethers marked this pull request as ready for review March 5, 2026 20:57
@pethers pethers merged commit 5bbedfa into evening-analysis-2026-03-05-13bbbf9821635a4d Mar 5, 2026
@pethers pethers deleted the copilot/sub-pr-836 branch March 5, 2026 20:57
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