mirror of
https://github.com/funamitech/mastodon
synced 2024-12-14 06:38:39 +09: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} });
|
|
}
|