synapse-admin/src/App.js

25 lines
691 B
JavaScript
Raw Normal View History

import React from "react";
import { Admin, Resource, resolveBrowserLocale } from "react-admin";
import polyglotI18nProvider from "ra-i18n-polyglot";
import dataProvider from "./dataProvider";
import germanMessages from "./i18n/de";
import englishMessages from "./i18n/en";
// TODO: Can we use lazy loading together with browser locale?
const messages = {
de: germanMessages,
en: englishMessages,
};
const i18nProvider = polyglotI18nProvider(
locale => (messages[locale] ? messages[locale] : messages.en),
resolveBrowserLocale()
);
const App = () => (
<Admin dataProvider={dataProvider} i18nProvider={i18nProvider}>
<Resource name="data" />
</Admin>
);
export default App;