2023-05-28 21:18:23 +09:00
|
|
|
import { PureComponent } from 'react';
|
2021-10-15 03:44:59 +09:00
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import { IntlProvider, addLocaleData } from 'react-intl';
|
|
|
|
import { getLocale } from 'mastodon/locales';
|
|
|
|
|
|
|
|
const { localeData, messages } = getLocale();
|
|
|
|
addLocaleData(localeData);
|
|
|
|
|
2023-05-28 21:18:23 +09:00
|
|
|
export default class AdminComponent extends PureComponent {
|
2021-10-15 03:44:59 +09:00
|
|
|
|
|
|
|
static propTypes = {
|
|
|
|
locale: PropTypes.string.isRequired,
|
|
|
|
children: PropTypes.node.isRequired,
|
|
|
|
};
|
|
|
|
|
|
|
|
render () {
|
|
|
|
const { locale, children } = this.props;
|
|
|
|
|
|
|
|
return (
|
|
|
|
<IntlProvider locale={locale} messages={messages}>
|
|
|
|
{children}
|
|
|
|
</IntlProvider>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|