Socket
Book a DemoInstallSign in
Socket

ra-auth-cognito-language-french

Package Overview
Dependencies
Maintainers
0
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ra-auth-cognito-language-french

French translations for [ra-auth-cognito](https://www.npmjs.com/package/ra-auth-cognito).

latest
Source
npmnpm
Version
2.0.0
Version published
Weekly downloads
0
-100%
Maintainers
0
Weekly downloads
 
Created
Source

ra-auth-cognito-language-french

French translations for ra-auth-cognito.

Installation

npm install ra-auth-cognito-language-french
# or
yarn add ra-auth-cognito-language-french

Usage

// in i18nProvider.js
import { raAuthCognitoEnglishMessages } from 'ra-auth-cognito-language-english';
import { raAuthCognitoFrenchMessages } from 'ra-auth-cognito-language-french';
import { mergeTranslations } from 'react-admin';
import polyglotI18nProvider from 'ra-i18n-polyglot';
import englishMessages from 'ra-language-english';
import frenchMessages from 'ra-language-french';

const allEnglishMessages = mergeTranslations(
    englishMessages,
    raAuthCognitoEnglishMessages
);
const allFrenchMessages = mergeTranslations(
    frenchMessages,
    raAuthCognitoFrenchMessages
);

export const i18nProvider = polyglotI18nProvider(
    locale => (locale === 'fr' ? allFrenchMessages : allEnglishMessages),
    'en'
);

// in App.js
import { Admin, Resource, ListGuesser } from 'react-admin';
import { authRoutes } from 'ra-auth-cognito';
import { dataProvider } from './dataProvider';
import { authProvider } from './authProvider';
import { i18nProvider } from './i18nProvider';

export const MyAdmin = () => (
    <Admin
        dataProvider={dataProvider}
        authProvider={authProvider}
        i18nProvider={i18nProvider}
        customRoutes={authRoutes}
    >
        <Resource name="posts" list={ListGuesser} />
        <Resource name="authors" list={ListGuesser} />
    </Admin>
);

FAQs

Package last updated on 19 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts