From e619850fbd511fc69e25869ebee0a31a2cb096d5 Mon Sep 17 00:00:00 2001 From: pyphilia Date: Fri, 13 May 2022 15:10:26 +0200 Subject: [PATCH] feat: add auth frontend translations --- src/constants/auth.ts | 12 ++++++++++++ src/index.ts | 1 + src/langs/en/auth.ts | 14 ++++++++++++++ src/langs/fr/auth.ts | 15 +++++++++++++++ src/langs/index.ts | 11 ++++++++--- 5 files changed, 50 insertions(+), 3 deletions(-) create mode 100644 src/constants/auth.ts create mode 100644 src/langs/en/auth.ts create mode 100644 src/langs/fr/auth.ts diff --git a/src/constants/auth.ts b/src/constants/auth.ts new file mode 100644 index 00000000..91557847 --- /dev/null +++ b/src/constants/auth.ts @@ -0,0 +1,12 @@ +export const AUTH = { + SIGN_IN_BUTTON: 'Sign In', + SIGN_IN_HEADER: 'Sign In', + SIGN_UP_LINK_TEXT: 'Not registered? Click here to register', + SIGN_IN_LINK_TEXT: 'Already have an account? Click here to sign in', + EMAIL_SIGN_IN_METHOD: 'Email Sign In', + PASSWORD_SIGN_IN_METHOD: 'Password Sign In', + NAME_FIELD_LABEL: 'Name', + SIGN_UP_BUTTON: 'Sign Up', + SIGN_UP_HEADER: 'Sign Up', + EMAIL_FIELD_TEXT: 'Email', +}; diff --git a/src/index.ts b/src/index.ts index 071081e1..7d970e3a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -5,5 +5,6 @@ export { } from './constants/messages'; export { CHATBOX } from './constants/chatbox'; +export { AUTH } from './constants/auth'; export { namespaces } from './langs'; export { default, langs } from './i18n'; diff --git a/src/langs/en/auth.ts b/src/langs/en/auth.ts new file mode 100644 index 00000000..a07c632a --- /dev/null +++ b/src/langs/en/auth.ts @@ -0,0 +1,14 @@ +import { AUTH } from '../../constants/auth'; + +export default { + [AUTH.SIGN_IN_BUTTON]: 'Sign In', + [AUTH.SIGN_IN_HEADER]: 'Sign In', + [AUTH.SIGN_UP_LINK_TEXT]: 'Not registered? Click here to register', + [AUTH.SIGN_IN_LINK_TEXT]: 'Already have an account? Click here to sign in', + [AUTH.EMAIL_SIGN_IN_METHOD]: 'Email Sign In', + [AUTH.PASSWORD_SIGN_IN_METHOD]: 'Password Sign In', + [AUTH.NAME_FIELD_LABEL]: 'Name', + [AUTH.SIGN_UP_BUTTON]: 'Sign Up', + [AUTH.SIGN_UP_HEADER]: 'Sign Up', + [AUTH.EMAIL_FIELD_TEXT]: 'Email', +}; diff --git a/src/langs/fr/auth.ts b/src/langs/fr/auth.ts new file mode 100644 index 00000000..0035017a --- /dev/null +++ b/src/langs/fr/auth.ts @@ -0,0 +1,15 @@ +import { AUTH } from '../../constants/auth'; + +export default { + [AUTH.SIGN_IN_BUTTON]: 'Se Connecter', + [AUTH.SIGN_IN_HEADER]: 'Se Connecter', + [AUTH.SIGN_UP_LINK_TEXT]: + 'Pas encore enregistré ? Cliquez ici pour vous enregistrer', + [AUTH.SIGN_IN_LINK_TEXT]: 'Déjà un compte? Cliquez ici pour vous connecter', + [AUTH.EMAIL_SIGN_IN_METHOD]: 'Connexion avec email', + [AUTH.PASSWORD_SIGN_IN_METHOD]: 'Connexion avec mot de passe', + [AUTH.NAME_FIELD_LABEL]: 'Nom', + [AUTH.SIGN_UP_BUTTON]: "S'enregistrer", + [AUTH.SIGN_UP_HEADER]: "S'enregistrer", + [AUTH.EMAIL_FIELD_TEXT]: 'Email', +}; diff --git a/src/langs/index.ts b/src/langs/index.ts index 406f4445..0236216b 100644 --- a/src/langs/index.ts +++ b/src/langs/index.ts @@ -2,21 +2,26 @@ import messagesEN from './en/messages'; import messagesFR from './fr/messages'; import chatboxEN from './en/chatbox'; import chatboxFR from './fr/chatbox'; +import authEN from './en/auth'; +import authFR from './fr/auth'; // define namespaces export const namespaces = { - messages: 'messages', + auth: 'auth', chatbox: 'chatbox', + messages: 'messages', }; const en = { - [namespaces.messages]: messagesEN, + [namespaces.auth]: authEN, [namespaces.chatbox]: chatboxEN, + [namespaces.messages]: messagesEN, }; const fr = { - [namespaces.messages]: messagesFR, + [namespaces.auth]: authFR, [namespaces.chatbox]: chatboxFR, + [namespaces.messages]: messagesFR, }; // other supported languages here