Fix /share
and cleanup and reorganize frontend locale loading (#25240)
This commit is contained in:
parent
5fae2de454
commit
b0780cfeed
25 changed files with 152 additions and 638 deletions
|
@ -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>
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue