Upgrade react-intl (#24906)
This commit is contained in:
parent
00c222377d
commit
44cd88adc4
130 changed files with 413 additions and 5046 deletions
14
app/javascript/mastodon/load_locale.js
Normal file
14
app/javascript/mastodon/load_locale.js
Normal file
|
@ -0,0 +1,14 @@
|
|||
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 });
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue