keycloak-scim/src/i18n.ts
Erik Jan de Wit 890d322312
Refactored dynamic components a bit more (#1462)
* moved to component folder

* replaced iteration with component

* fixed merge error

* renamed file

* tried to improve the test

* made field label lower case
2021-11-08 10:46:03 +01:00

76 lines
2.1 KiB
TypeScript

import i18n from "i18next";
import { initReactI18next } from "react-i18next";
// import backend from "i18next-http-backend";
import common from "./common-messages";
import help from "./common-help";
import dashboard from "./dashboard/messages";
import clients from "./clients/messages";
import clientsHelp from "./clients/help";
import clientScopes from "./client-scopes/messages";
import clientScopesHelp from "./client-scopes/help";
import groups from "./groups/messages";
import realm from "./realm/messages";
import roles from "./realm-roles/messages";
import users from "./user/messages";
import usersHelp from "./user/help";
import sessions from "./sessions/messages";
import events from "./events/messages";
import realmSettings from "./realm-settings/messages";
import realmSettingsHelp from "./realm-settings/help";
import authentication from "./authentication/messages";
import authenticationHelp from "./authentication/help";
import userFederation from "./user-federation/messages";
import userFederationHelp from "./user-federation/help";
import identityProviders from "./identity-providers/messages";
import identityProvidersHelp from "./identity-providers/help";
import dynamicLabels from "./components/dynamic/labels";
export const DEFAULT_LOCALE = "en";
const initOptions = {
defaultNS: "common",
resources: {
en: {
...common,
...help,
...dashboard,
...clients,
...clientsHelp,
...clientScopes,
...clientScopesHelp,
...groups,
...realm,
...roles,
...groups,
...users,
...usersHelp,
...sessions,
...userFederation,
...events,
...realmSettings,
...realmSettingsHelp,
...authentication,
...authenticationHelp,
...identityProviders,
...identityProvidersHelp,
...userFederation,
...userFederationHelp,
...dynamicLabels,
},
},
lng: DEFAULT_LOCALE,
fallbackLng: DEFAULT_LOCALE,
interpolation: {
escapeValue: false,
},
};
i18n
.use(initReactI18next)
// .use(backend)
.init(initOptions);
export default i18n;