mirror of
https://github.com/UA-Fediland/synapse-admin.git
synced 2024-11-25 07:45:23 +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,
|
resolveBrowserLocale,
|
||||||
} from "react-admin";
|
} from "react-admin";
|
||||||
import polyglotI18nProvider from "ra-i18n-polyglot";
|
import polyglotI18nProvider from "ra-i18n-polyglot";
|
||||||
|
import merge from "lodash/merge";
|
||||||
import authProvider from "./synapse/authProvider";
|
import authProvider from "./synapse/authProvider";
|
||||||
import dataProvider from "./synapse/dataProvider";
|
import dataProvider from "./synapse/dataProvider";
|
||||||
import users from "./components/users";
|
import users from "./components/users";
|
||||||
|
@ -33,7 +34,8 @@ const messages = {
|
||||||
zh: chineseMessages,
|
zh: chineseMessages,
|
||||||
};
|
};
|
||||||
const i18nProvider = polyglotI18nProvider(
|
const i18nProvider = polyglotI18nProvider(
|
||||||
locale => (messages[locale] ? messages[locale] : messages.en),
|
locale =>
|
||||||
|
messages[locale] ? merge({}, messages.en, messages[locale]) : messages.en,
|
||||||
resolveBrowserLocale(),
|
resolveBrowserLocale(),
|
||||||
[
|
[
|
||||||
{ locale: "en", name: "English" },
|
{ locale: "en", name: "English" },
|
||||||
|
|
Loading…
Reference in a new issue