Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH Explicitly set i18n locale to en_US for supported modules #295

Merged
merged 1 commit into from
Jan 23, 2025

Conversation

emteknetnz
Copy link
Member

@emteknetnz emteknetnz commented Jan 21, 2025

Issue silverstripe/.github#357

Similar to - using 3.x-dev of cwp-core causes the default locale to be en_GB instead of en_US

Fixes behat tests that break because of this e.g. https://github.com/creative-commoners/recipe-kitchen-sink/actions/runs/12879104438/job/35906088458

After merging, create 5.5 branch and tag 5.5.0

Needs silverstripe/silverstripe-framework#11576 merged for unit tests to pass

CI sink run with this PR https://github.com/creative-commoners/recipe-kitchen-sink/actions/runs/12938896222 - broken userforms behat is unrelated

@GuySartorelli
Copy link
Member

This will affect project behat tests as well (not common but they do exist) - please make sure to add a quick note about this in the 5.4 changelog.

@emteknetnz emteknetnz changed the title NEW Set the default locale to en_US ENH Explicitly set i18n locale to en_US for supported modules Jan 22, 2025
src/Controllers/ModuleSuiteLocator.php Outdated Show resolved Hide resolved
src/Controllers/ModuleSuiteLocator.php Outdated Show resolved Hide resolved
src/Controllers/ModuleSuiteLocator.php Outdated Show resolved Hide resolved
Comment on lines +221 to +223
i18n::config()->set('default_locale', 'en_US');
i18n::set_locale('en_US');
Copy link
Member

Choose a reason for hiding this comment

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

Is the kernel booted by this stage? Will this work for the in-browser test instances which boot separate kernels from the one running the CLI instance?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think so though honestly I don't know. On my local which uses a headless chrome inside the docker container it seems to works fine i.e. broken behat tests linked to in the description now pass, and it also works fine on CI which is a similar sort of setup.

@emteknetnz emteknetnz force-pushed the pulls/5/setlocale branch 2 times, most recently from 6760344 to c36e546 Compare January 23, 2025 01:39
Copy link
Member

@GuySartorelli GuySartorelli left a comment

Choose a reason for hiding this comment

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

LGTM

Failing CI unrelated (See silverstripe/silverstripe-framework#11576)

@GuySartorelli GuySartorelli merged commit 9564bce into silverstripe:5 Jan 23, 2025
6 of 9 checks passed
@GuySartorelli GuySartorelli deleted the pulls/5/setlocale branch January 23, 2025 23:22
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