Skip to content

Use global locale for starter projects#717

Closed
zetter-rpf wants to merge 1 commit intomainfrom
correctly-model-starting-projects-locale
Closed

Use global locale for starter projects#717
zetter-rpf wants to merge 1 commit intomainfrom
correctly-model-starting-projects-locale

Conversation

@zetter-rpf
Copy link
Contributor

Status

Description

There's currently a caching issue when switching between locales on the project site [1]. To fix this we can only load the project if it has the expected locale.

However, this would break caching for projects that aren't localised. The code editor only uses the project cache when you've not yet logged in or saved a project. The projects you're likely to be editing in this case are the blank starter projects. Since these projects are blank with no instructions they aren't really localizable so I have decided to flag them as having a 'global' localization.

Adding this to the list of locales will mean we can also set this on any imported projects we want this behaviour for.

I'll amend [1] to allow using the cache when when the project is set to global.

[1] RaspberryPiFoundation/editor-ui#1342

Steps to perform after deploying to production

Deploy separate migration to update locale for the two blank projects.

There's currently a caching issue when switching between locales on the project site [1]. To fix this we can only load the project if it has the expected locale.

However, this would break caching for projects that aren't localized. The code editor only uses the project cache when you've not yet logged in or saved a project. The projects you're likely to be editing in this case are the blank starter projects. Since these projects are blank with no instructions they aren't really localizable so I have decided to flag them as having a 'global' localization.

Adding this to the list of locales will mean we can also set this on any imported projects we want this behaviour for.

I'll amend [1] to allow using the cache when when the project is set to global.

### After deploy

Deploy separate migration to update locale for the two blank projects.

[1] RaspberryPiFoundation/editor-ui#1342
@cla-bot cla-bot bot added the cla-signed label Mar 4, 2026
@github-actions
Copy link

github-actions bot commented Mar 4, 2026

Test coverage

89.9% line coverage reported by SimpleCov.
Run: https://github.com/RaspberryPiFoundation/editor-api/actions/runs/22669003591

@zetter-rpf
Copy link
Contributor Author

This was something I wanted to try, but I don't think it's needed as the starter projects do have seperate locales configured in production

@zetter-rpf zetter-rpf closed this Mar 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant