2017-05-22 09:06:06 -04:00
|
|
|
let theLocale;
|
2017-05-02 20:04:16 -04:00
|
|
|
|
2017-05-22 09:06:06 -04:00
|
|
|
export function setLocale(locale) {
|
|
|
|
theLocale = locale;
|
|
|
|
}
|
2017-05-02 20:04:16 -04:00
|
|
|
|
2017-05-22 09:06:06 -04:00
|
|
|
export function getLocale() {
|
|
|
|
return theLocale;
|
|
|
|
}
|
2023-05-31 17:43:39 -04:00
|
|
|
|
|
|
|
export function onProviderError(error) {
|
|
|
|
// Silent the error, like upstream does
|
|
|
|
if(process.env.NODE_ENV === 'production') return;
|
|
|
|
|
|
|
|
// This browser does not advertise Intl support for this locale, we only print a warning
|
|
|
|
// As-per the spec, the browser should select the best matching locale
|
|
|
|
if(typeof error === "object" && error.message.match("MISSING_DATA")) {
|
|
|
|
console.warn(error.message);
|
|
|
|
}
|
|
|
|
|
|
|
|
console.error(error);
|
|
|
|
}
|