-
Notifications
You must be signed in to change notification settings - Fork 823
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
base: 5
Are you sure you want to change the base?
MNT Ensure default_locale to en_US #11570
Conversation
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
@@ -282,7 +282,9 @@ protected function setUp(): void | |||
|
|||
// i18n needs to be set to the defaults or tests fail | |||
if (class_exists(i18n::class)) { | |||
i18n::set_locale(i18n::config()->uninherited('default_locale')); | |||
$defaultLocale = 'en_US'; | |||
i18n::config()->set('default_locale', $defaultLocale); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we changing the config here? We don't need to set the active locale, done we?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Requirements_Backend::add_i18n_javascript()
reads i18n::config()->get('default_locale')
directly, it's what caused the unit test to fail in the first place
I've just realised why |
ca79a73
to
ce43f89
Compare
ce43f89
to
6f2b81c
Compare
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/35902983814Note 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/12899443197 (broken behat test is unrelated)