~cytrogen/masto-fe

ref: b922ad7a1b4bc8d968d0df2c7f307d4fec53435d masto-fe/app/javascript/mastodon/locales/index.js -rw-r--r-- 567 bytes
b922ad7a — Claire Fix crash when S3_ALIAS_HOST or S3_CLOUDFRONT_HOST have a path component (#25018) 2 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
let theLocale;

export function setLocale(locale) {
  theLocale = locale;
}

export function getLocale() {
  return theLocale;
}

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);
}