mirror of
https://github.com/UA-Fediland/synapse-admin.git
synced 2024-11-21 22:11:27 +00:00
Fallback to english if no translation in the current language is available
Change-Id: I94ecf5f2d742b1653177c49cef6b1b7fd6e96df0
This commit is contained in:
parent
441f7749a2
commit
e666c9c7bd
1 changed files with 3 additions and 1 deletions
|
@ -6,6 +6,7 @@ import {
|
|||
resolveBrowserLocale,
|
||||
} from "react-admin";
|
||||
import polyglotI18nProvider from "ra-i18n-polyglot";
|
||||
import merge from "lodash/merge";
|
||||
import authProvider from "./synapse/authProvider";
|
||||
import dataProvider from "./synapse/dataProvider";
|
||||
import users from "./components/users";
|
||||
|
@ -33,7 +34,8 @@ const messages = {
|
|||
zh: chineseMessages,
|
||||
};
|
||||
const i18nProvider = polyglotI18nProvider(
|
||||
locale => (messages[locale] ? messages[locale] : messages.en),
|
||||
locale =>
|
||||
messages[locale] ? merge({}, messages.en, messages[locale]) : messages.en,
|
||||
resolveBrowserLocale(),
|
||||
[
|
||||
{ locale: "en", name: "English" },
|
||||
|
|
Loading…
Reference in a new issue