mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX Hard fallback to en_US.js in Requirements
Ideally we'll have region-less locales like en.js as fallbacks, but for now this prevents the UI becoming non-operational e.g. when both i18n::set_locale() and i18n::default_locale() are set to 'en_NZ'.
This commit is contained in:
parent
76e233de70
commit
5f8115f4c7
@ -768,6 +768,11 @@ class Requirements_Backend {
|
||||
$files[] = $langDir . i18n::default_locale() . '.js';
|
||||
$files[] = $langDir . i18n::get_locale() . '.js';
|
||||
|
||||
// If both files don't exist, hard fallback to en_US
|
||||
if(!Director::fileExists($files[0]) && !Director::fileExists($files[1])) {
|
||||
$files[] = $langDir . 'en_US.js';
|
||||
}
|
||||
|
||||
// Stub i18n implementation for when i18n is disabled.
|
||||
} else {
|
||||
if(!$langOnly) $files[] = FRAMEWORK_DIR . '/javascript/i18nx.js';
|
||||
|
Loading…
Reference in New Issue
Block a user