Skip to content

fix(i18n): show stored locale on addons instructions at initial load#197

Closed
dobby-coder[bot] wants to merge 1 commit into
mainfrom
fix/issue-164-i18n-initial-load
Closed

fix(i18n): show stored locale on addons instructions at initial load#197
dobby-coder[bot] wants to merge 1 commit into
mainfrom
fix/issue-164-i18n-initial-load

Conversation

@dobby-coder

@dobby-coder dobby-coder Bot commented May 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Closes Language on initial load is not always correct #164
  • The addons page wraps the install instruction block in {#key activeItem}, which only re-creates the block when the user clicks a different tab. Marketing pages are prerendered in en-US, so the {@html \$_('addons.\${activeItem}')} content is baked in English. After client hydration, even if the visitor's stored preference is nl-NL, the keyed block was not re-evaluating the translation expression, so users saw English instructions until they switched tabs (which is exactly the behaviour reported in the issue).
  • Include \$locale in the {#key} expression so the block is torn down and re-rendered when the locale store changes after hydration. The fix is local to this template — it does not touch the global i18n setup or any locale JSON files, so it should not conflict with the other in-flight Outlook/Thunderbird translation PRs.

Test plan

  • npm run check — 0 errors / 0 warnings
  • npm run lint — Prettier + ESLint clean
  • npm run build — adapter-static build succeeds
  • Manual verification: visit /addons/ with localStorage.preferredLanguage = 'nl-NL' in a fresh tab and confirm the Thunderbird instructions render in Dutch on first paint, without needing a tab switch.

Reviewer quickstart

git fetch origin && git checkout fix/issue-164-i18n-initial-load && npm install --legacy-peer-deps && npm run dev

Then in the browser console: localStorage.setItem('preferredLanguage', 'nl-NL') and reload /addons/.

🤖 Generated with Claude Code

The {@html $_('addons.${activeItem}')} block on the addons page was
wrapped in {#key activeItem}, so it was only torn down and recreated
when the active addon tab changed. On prerendered pages the HTML is
baked at build time in en-US; once the client hydrates with a stored
nl-NL preference, the keyed block did not re-evaluate the @html
expression until the user manually switched tabs, leaving Dutch users
on the English instructions until interaction.

Include $locale in the key so the block re-renders whenever the active
locale changes after hydration, ensuring the correct language is shown
on initial load.

Closes #164
@dobby-coder dobby-coder Bot requested a review from rubenhensen May 9, 2026 14:02
@dobby-coder dobby-coder Bot marked this pull request as ready for review May 9, 2026 14:05
@dobby-coder

dobby-coder Bot commented May 9, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #204 (consolidation per encryption4all/dobby#53). Closing to keep the queue tidy.

@dobby-coder dobby-coder Bot closed this May 9, 2026
rubenhensen pushed a commit that referenced this pull request May 9, 2026
* docs: clarify Outlook add-in is under the Apps menu

Closes #173

Outlook now lists custom add-ins under the "Apps" menu in the ribbon
rather than as a dedicated ribbon button. Update the install
instructions on the addons page (en + nl) so users know to open the
add-in via Apps -> PostGuard Add-in for both sending and decrypting.

* fix: make Thunderbird/Outlook addon tabs look clickable

Closes #170

* fix(i18n): clarify Thunderbird add-on install step references cog icon

The English instruction said "click on the sign, after Manage Your Extensions" which is unclear. Replace with "click on the cog icon next to Manage Your Extensions" and align the Dutch translation.

Closes #168

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* fix(addons): consolidate install-doc, i18n, and UX fixes

Apply changes from PRs #190, #191, #193, #195, #196, #197, #199 on top
of #189 and #192. Specifically:
- Outlook: clarify add-in lives under Apps menu (#189)
- Outlook: NL terminology aligned with current Outlook UI (#190)
- Outlook: instruct user to restart after install (#191)
- Outlook: save manifest as manifest.xml via download attr (#193)
- Outlook: open aka.ms/olksideload in new tab (#196)
- Outlook: warn users when custom add-ins are blocked (#199)
- Thunderbird: clarify Manage Extensions cog icon (#195)
- Addons page: rerun {#key} on locale change so instructions reflect stored locale (#197)

---------

Co-authored-by: dobby-yivi-agent[bot] <275734547+dobby-yivi-agent[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
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.

Language on initial load is not always correct

0 participants