mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
MINOR Update add_i18n_javascript to load lowercase-dash language files
This commit is contained in:
parent
09554d9e27
commit
c6214b855f
@ -18,6 +18,7 @@ use SilverStripe\Core\Path;
|
||||
use SilverStripe\Dev\Debug;
|
||||
use SilverStripe\Dev\Deprecation;
|
||||
use SilverStripe\i18n\i18n;
|
||||
use SilverStripe\ORM\FieldType\DBField;
|
||||
|
||||
class Requirements_Backend
|
||||
{
|
||||
@ -1004,13 +1005,21 @@ class Requirements_Backend
|
||||
|
||||
$files = array();
|
||||
$candidates = array(
|
||||
'en.js',
|
||||
'en_US.js',
|
||||
i18n::getData()->langFromLocale(i18n::config()->get('default_locale')) . '.js',
|
||||
i18n::config()->get('default_locale') . '.js',
|
||||
i18n::getData()->langFromLocale(i18n::get_locale()) . '.js',
|
||||
i18n::get_locale() . '.js',
|
||||
'en',
|
||||
'en_US',
|
||||
i18n::getData()->langFromLocale(i18n::config()->get('default_locale')),
|
||||
i18n::config()->get('default_locale'),
|
||||
i18n::getData()->langFromLocale(i18n::get_locale()),
|
||||
i18n::get_locale(),
|
||||
strtolower(DBField::create_field('Locale', i18n::get_locale())->RFC1766()),
|
||||
strtolower(DBField::create_field('Locale', i18n::config()->get('default_locale'))->RFC1766())
|
||||
);
|
||||
|
||||
$candidates = array_map(
|
||||
function ($candiate) { return $candiate . '.js'; },
|
||||
$candidates
|
||||
);
|
||||
|
||||
foreach ($candidates as $candidate) {
|
||||
$relativePath = Path::join($langDir, $candidate);
|
||||
$absolutePath = Director::getAbsFile($relativePath);
|
||||
|
Loading…
Reference in New Issue
Block a user