mirror of
https://github.com/lunaisnotaboy/mastodon.git
synced 2024-12-22 13:17:13 +00:00
85722a918d
Conflicts: - `.github/dependabot.yml`: Updated upstream, but we've deleted it. Keep it deleted. - `app/javascript/mastodon/locales/index.js`: Reworked upstream, but the code was mostly in `app/javascript/locales/index.js` in glitch-soc. Updated that file accordingly. - `app/javascript/packs/public.jsx`: Not a real conflict, but different imports in glitch-soc and upstream. - `app/views/layouts/application.html.haml`: Conflict due to locales loading and theme system discrepancies. Updated in our own way. - `app/views/layouts/embedded.html.haml`: Conflict due to locales loading and theme system discrepancies. Updated in our own way. - `config/webpack/generateLocalePacks.js`: Deleted upstream, as upstream now directly loads the JSON at runtime. Deleted as well, will switch to runtime loading in an upcoming commit. - `config/webpack/shared.js`: Not a real conflict, but different imports in glitch-soc and upstream. - `config/webpack/translationRunner.js`: Mostly deleted upstream, to be replaced with `formatjs-formatter.js` instead. Moved the glitch-soc logic there and deleted the file.
23 lines
567 B
JavaScript
23 lines
567 B
JavaScript
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);
|
|
}
|