mirror of
https://github.com/vale981/Vulcan
synced 2025-03-09 04:16:37 -04:00
21 lines
No EOL
709 B
JavaScript
21 lines
No EOL
709 B
JavaScript
import Telescope from './config.js';
|
|
|
|
var areIntlLocalesSupported = require('intl-locales-supported');
|
|
|
|
var localesMyAppSupports = [
|
|
Telescope.settings.get("locale", "en")
|
|
];
|
|
|
|
if (global.Intl) {
|
|
// Determine if the built-in `Intl` has the locale data we need.
|
|
if (!areIntlLocalesSupported(localesMyAppSupports)) {
|
|
// `Intl` exists, but it doesn't have the data we need, so load the
|
|
// polyfill and replace the constructors with need with the polyfill's.
|
|
var IntlPolyfill = require('intl');
|
|
Intl.NumberFormat = IntlPolyfill.NumberFormat;
|
|
Intl.DateTimeFormat = IntlPolyfill.DateTimeFormat;
|
|
}
|
|
} else {
|
|
// No `Intl`, so use and load the polyfill.
|
|
global.Intl = require('intl');
|
|
} |