mirror of
https://github.com/glitch-soc/mastodon.git
synced 2024-11-29 03:20:26 -05:00
9e133e2527
Port 44cd88adc4
to glitch-soc
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
22 lines
679 B
JavaScript
22 lines
679 B
JavaScript
import { setLocale } from 'locales';
|
|
|
|
export async function loadLocale() {
|
|
const locale = document.querySelector('html').lang || 'en';
|
|
|
|
const upstreamLocaleData = await import(
|
|
/* webpackMode: "lazy" */
|
|
/* webpackChunkName: "locales/vanilla/[request]" */
|
|
/* webpackInclude: /\.json$/ */
|
|
/* webpackPreload: true */
|
|
`mastodon/locales/${locale}.json`);
|
|
|
|
const localeData = await import(
|
|
/* webpackMode: "lazy" */
|
|
/* webpackChunkName: "locales/glitch/[request]" */
|
|
/* webpackInclude: /\.json$/ */
|
|
/* webpackPreload: true */
|
|
`flavours/glitch/locales/${locale}.json`);
|
|
|
|
setLocale({ messages: {...upstreamLocaleData, ...localeData} });
|
|
}
|