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

MNT Ensure default_locale to en_US #11570

Merged

Conversation

emteknetnz
Copy link
Member

@emteknetnz emteknetnz commented Jan 21, 2025

Issue silverstripe/.github#357

For whatever reason, CMS 5 sink now uses cwp/cwp-core 3.x-dev instead of 3.0.2, and 3.x-dev sets the default_locale with yml rather than _config.php silverstripe/cwp-core@3.0.2...3

This causes a few i18n tests to fail https://github.com/silverstripe/recipe-kitchen-sink/actions/runs/12877846807/job/35902983644#step:12:334

Also causes a locale date test to fail - Failed asserting that '29/02/2020, 17:00' matches PCRE pattern "#2/29/20,\h5:00\hPM#iu". https://github.com/silverstripe/recipe-kitchen-sink/actions/runs/12877846807/job/35902983814

Note that CMS 6 doesn't have this issue as cwp-core is no longer in CMS 6 sink

New CI sink run with this PR and also this PR https://github.com/creative-commoners/recipe-kitchen-sink/actions/runs/12920534794

@GuySartorelli
Copy link
Member

This will affect project unit tests as well - please make sure to add a quick note about this in the 5.4 changelog.

src/Dev/SapphireTest.php Outdated Show resolved Hide resolved
@GuySartorelli
Copy link
Member

I've just realised why i18n::config()->get('default_locale') was being used - projects can of course run unit tests, and will likely want to run those tests against the default locale they have set for their project.

@emteknetnz emteknetnz force-pushed the pulls/5/default-locale branch 2 times, most recently from ce43f89 to 6f2b81c Compare January 22, 2025 01:16
src/Dev/SapphireTest.php Outdated Show resolved Hide resolved
src/Dev/SapphireTest.php Outdated Show resolved Hide resolved
@emteknetnz emteknetnz force-pushed the pulls/5/default-locale branch from 6f2b81c to 74e6705 Compare January 23, 2025 00:38
@emteknetnz emteknetnz force-pushed the pulls/5/default-locale branch from 74e6705 to 3db362a 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 - will update the commit message on merge (since it's not only affecting our tests it should either be FIX or ENH)

@GuySartorelli GuySartorelli merged commit 1ea87f8 into silverstripe:5 Jan 23, 2025
17 checks passed
@GuySartorelli GuySartorelli deleted the pulls/5/default-locale branch January 23, 2025 20:16
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