This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
2017-11-20 22:13:37 -08:00
|
|
|
let theLocale;
|
|
|
|
|
|
|
|
export function setLocale(locale) {
|
|
|
|
theLocale = locale;
|
|
|
|
}
|
|
|
|
|
|
|
|
export function getLocale() {
|
|
|
|
return theLocale;
|
|
|
|
}
|
2023-06-10 02:15:05 -07: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);
|
|
|
|
}
|