0
0
Fork 0

Fix /share and cleanup and reorganize frontend locale loading (#25240)

This commit is contained in:
Renaud Chaput 2023-06-02 15:00:27 +02:00 committed by GitHub
parent 5fae2de454
commit b0780cfeed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 152 additions and 638 deletions

View file

@ -1,24 +1,19 @@
import PropTypes from 'prop-types';
import { PureComponent } from 'react';
import { IntlProvider } from 'react-intl';
import { getLocale, onProviderError } from '../locales';
const { messages } = getLocale();
import { IntlProvider } from 'mastodon/locales';
export default class AdminComponent extends PureComponent {
static propTypes = {
locale: PropTypes.string.isRequired,
children: PropTypes.node.isRequired,
};
render () {
const { locale, children } = this.props;
const { children } = this.props;
return (
<IntlProvider locale={locale} messages={messages} onError={onProviderError}>
<IntlProvider>
{children}
</IntlProvider>
);