Skip to content

Update to fix CCP locale switching#1342

Open
cocomarine wants to merge 4 commits intomainfrom
hj/testing-locale-switch-3
Open

Update to fix CCP locale switching#1342
cocomarine wants to merge 4 commits intomainfrom
hj/testing-locale-switch-3

Conversation

@cocomarine
Copy link
Contributor

@cocomarine cocomarine commented Feb 25, 2026

Changes

Locale switching fix

Initial load problem fix

  • Before: when an editor page with locales other than en was first loaded in CCP, it rendered en page rather than the locale page (editor-standalone was fine)
  • Updated to make sure initial attributes like locale are passed to React by reading them from the DOM in reactProps() of web-component.js
    • This is so that the first render uses the host's value even when attributeChangedCallback hasn't been run yet

Copilot AI review requested due to automatic review settings February 25, 2026 14:51
@cocomarine cocomarine temporarily deployed to previews/1342/merge February 25, 2026 14:52 — with GitHub Actions Inactive
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 updates the project-loading hook to make localStorage cache usage dependent on the active i18n locale, aiming to prevent incorrect cached content from being loaded after CCP locale switching.

Changes:

  • Adds a locale match check (cachedProject?._cachedLocale === i18n.language) before loading a cached project.
  • Simplifies the cache eligibility logic into a single shouldUseCache condition.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@cocomarine cocomarine temporarily deployed to previews/1342/merge February 25, 2026 15:21 — with GitHub Actions Inactive
@cocomarine cocomarine temporarily deployed to previews/1342/merge February 25, 2026 15:43 — with GitHub Actions Inactive
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