mirror of
https://git.bsd.gay/fef/nyastodon.git
synced 2024-12-28 12:23:52 +01:00
15 lines
401 B
JavaScript
15 lines
401 B
JavaScript
|
import { setLocale } from "./locales";
|
||
|
|
||
|
export async function loadLocale() {
|
||
|
const locale = document.querySelector('html').lang || 'en';
|
||
|
|
||
|
const localeData = await import(
|
||
|
/* webpackMode: "lazy" */
|
||
|
/* webpackChunkName: "locale/[request]" */
|
||
|
/* webpackInclude: /\.json$/ */
|
||
|
/* webpackPreload: true */
|
||
|
`mastodon/locales/${locale}.json`);
|
||
|
|
||
|
setLocale({ messages: localeData });
|
||
|
}
|