Fix locale files

GitLab: #81
Change-Id: I785904be3ac8f2e83cbc52858416c45041623b5f
diff --git a/client/src/components/AlertSnackbar.tsx b/client/src/components/AlertSnackbar.tsx
index 287cd60..a4781ff 100644
--- a/client/src/components/AlertSnackbar.tsx
+++ b/client/src/components/AlertSnackbar.tsx
@@ -38,11 +38,7 @@
       }}
     >
       <Alert severity={severity} {...alertProps}>
-        {/* For i18n-parser.
-          t('severity_error')
-          t('severity_success')
-        */}
-        <AlertTitle>{t(`severity_${severity}`)}</AlertTitle>
+        <AlertTitle>{t('severity', { context: `${severity}` })}</AlertTitle>
         {children}
       </Alert>
     </Snackbar>
diff --git a/client/src/components/Input.tsx b/client/src/components/Input.tsx
index db11fb6..40d55b6 100644
--- a/client/src/components/Input.tsx
+++ b/client/src/components/Input.tsx
@@ -30,6 +30,7 @@
 import { ChangeEvent, ReactElement, useCallback, useEffect, useState } from 'react';
 import { useTranslation } from 'react-i18next';
 
+import { StrengthValueCode } from '../utils/auth';
 import { InfoButton, ToggleVisibilityButton } from './Button';
 import RulesDialog from './RulesDialog';
 import { CheckedIcon, LockIcon, PenIcon, PersonIcon, RoundSaltireIcon } from './SvgIcon';
@@ -48,7 +49,11 @@
 const StyledPersonIconLight = styled(PersonIcon)({ height: iconsHeight, color: '#03B9E9' });
 const StyledLockIcon = styled(LockIcon)({ height: iconsHeight, color: '#03B9E9' });
 
-export type InputProps = TextFieldProps & {
+export type NameStatus = 'default' | 'success' | 'taken' | 'invalid' | 'registration_failed';
+export type PasswordStatus = StrengthValueCode | 'registration_failed';
+
+export type InputProps<StatusType extends NameStatus | PasswordStatus> = TextFieldProps & {
+  status: StatusType;
   infoButtonProps?: IconButtonProps;
   success?: boolean;
   tooltipTitle: string;
@@ -58,9 +63,10 @@
   infoButtonProps,
   onChange: _onChange,
   success,
+  status,
   tooltipTitle,
   ...props
-}: InputProps) => {
+}: InputProps<NameStatus>) => {
   const { t } = useTranslation();
   const [isSelected, setIsSelected] = useState(false);
   const [input, setInput] = useState(props.defaultValue);
@@ -89,6 +95,14 @@
     setStartAdornment(<Icon sx={{ visibility }} />);
   }, [props.error, success, isSelected, input]);
 
+  /*
+  t('username_input_helper_text_success')
+  t('username_input_helper_text_taken')
+  t('username_input_helper_text_invalid')
+  t('username_input_helper_text_registration_failed')
+ */
+  const helperText = t('username_input_helper_text', { context: `${status}` });
+
   return (
     <>
       <RulesDialog
@@ -99,20 +113,25 @@
         <UsernameRules />
       </RulesDialog>
       <TextField
-        {...props}
         color={inputColor(props.error, success)}
         label={t('username_input_label')}
         variant="standard"
-        InputLabelProps={{ shrink: !!(isSelected || input) }}
+        helperText={status !== 'default' ? helperText : ''}
         onChange={onChange}
+        onFocus={() => setIsSelected(true)}
+        onBlur={() => setIsSelected(false)}
+        {...props}
+        InputLabelProps={{
+          shrink: !!(isSelected || input),
+          ...props.InputLabelProps,
+        }}
         InputProps={{
           startAdornment,
           endAdornment: (
             <InfoButton tooltipTitle={tooltipTitle} {...infoButtonProps} onClick={() => setIsDialogOpened(true)} />
           ),
+          ...props.InputProps,
         }}
-        onFocus={() => setIsSelected(true)}
-        onBlur={() => setIsSelected(false)}
       />
     </>
   );
@@ -123,8 +142,9 @@
   onChange: _onChange,
   success,
   tooltipTitle,
+  status,
   ...props
-}: InputProps) => {
+}: InputProps<PasswordStatus>) => {
   const { t } = useTranslation();
   const [showPassword, setShowPassword] = useState(false);
   const [isSelected, setIsSelected] = useState(false);
@@ -158,6 +178,15 @@
     setStartAdornment(<Icon sx={{ visibility }} />);
   }, [props.error, success, isSelected, input]);
 
+  /*
+  t('password_input_helper_text_too_weak')
+  t('password_input_helper_text_weak')
+  t('password_input_helper_text_medium')
+  t('password_input_helper_text_strong')
+  t('password_input_helper_text_registration_failed')
+   */
+  const helperText = t('password_input_helper_text', { context: `${status}` });
+
   return (
     <>
       <RulesDialog
@@ -168,14 +197,17 @@
         <PasswordRules />
       </RulesDialog>
       <TextField
-        {...props}
         color={inputColor(props.error, success)}
         label={t('password_input_label')}
         type={showPassword ? 'text' : 'password'}
         variant="standard"
         autoComplete="current-password"
-        InputLabelProps={{ shrink: !!(isSelected || input) }}
+        helperText={status !== 'default' ? helperText : ''}
         onChange={onChange}
+        onFocus={() => setIsSelected(true)}
+        onBlur={() => setIsSelected(false)}
+        {...props}
+        InputLabelProps={{ shrink: !!(isSelected || input), ...props.InputLabelProps }}
         InputProps={{
           startAdornment,
           endAdornment: (
@@ -184,9 +216,8 @@
               <ToggleVisibilityButton visible={showPassword} onClick={toggleShowPassword} />
             </Stack>
           ),
+          ...props.InputProps,
         }}
-        onFocus={() => setIsSelected(true)}
-        onBlur={() => setIsSelected(false)}
       />
     </>
   );
diff --git a/client/src/locale/en/translation.json b/client/src/locale/en/translation.json
index 7933acc..69e8e0e 100644
--- a/client/src/locale/en/translation.json
+++ b/client/src/locale/en/translation.json
@@ -1,5 +1,7 @@
 {
+  "severity": "",
   "share_screen": "Share your screen",
+  "share_window": "",
   "share_screen_area": "Share an area of your screen",
   "share_file": "Share a file",
   "dummy_option_string": "Test option",
@@ -15,8 +17,19 @@
   "conversation_title_three": "{{member0}}, {{member1}} and {{member2}}",
   "conversation_title_four": "{{member0}}, {{member1}}, {{member2}}, +1 other member",
   "conversation_title_more": "{{member0}}, {{member1}}, {{member2}}, +{{excess}} other members",
+  "username_input_helper_text_success": "Username available",
+  "username_input_helper_text_taken": "Username already taken",
+  "username_input_helper_text_invalid": "Username doesn't follow required pattern",
+  "username_input_helper_text_registration_failed": "Username not correct!",
+  "username_input_helper_text": "",
   "username_rules_dialog_title": "Username rules",
   "username_input_label": "Choose an identifier",
+  "password_input_helper_text_too_weak": "Too weak",
+  "password_input_helper_text_weak": "Weak",
+  "password_input_helper_text_medium": "Medium",
+  "password_input_helper_text_strong": "Strong",
+  "password_input_helper_text_registration_failed": "Choose another password!",
+  "password_input_helper_text": "",
   "password_rules_dialog_title": "Password rules",
   "password_input_label": "Password",
   "password_rule_one": "The password must contain at least 1 lowercase alphabetical character.",
@@ -35,6 +48,7 @@
   "message_call_incoming": "Incoming call - {{duration}}",
   "message_swarm_created": "Swarm created",
   "message_user_joined": "{{user}} joined",
+  "messages_scroll_to_end": "",
   "dialog_close": "Close",
   "message_input_placeholder_one": "Write to {{member0}}",
   "message_input_placeholder_two": "Write to {{member0}} and {{member1}}",
@@ -51,22 +65,11 @@
   "login_form_to_registration_link": "REGISTER",
   "registration_success": "You've successfully registered! — Logging you in...",
   "registration_form_title": "REGISTRATION",
-  "username_input_helper_text": "",
   "registration_form_username_tooltip": "Username may be from 3 to 32 chraracters long and contain a-z, A-Z, -, _\n\nClick for more details",
-  "password_input_helper_text": "",
   "registration_form_password_tooltip": "Choose a password hard to guess for others but easy to remember for you, it must be at least 10 characters. Your account won't be recovered if you forget it!\n\nClick for more details",
   "registration_form_submit_button": "REGISTER",
   "registration_form_to_login_text": "Already have an account?",
   "registration_form_to_login_link": "LOG IN",
-  "username_input_helper_text_success": "Username available",
-  "username_input_helper_text_taken": "Username already taken",
-  "username_input_helper_text_invalid": "Username doesn't follow required pattern",
-  "username_input_helper_text_registration_failed": "Username not correct!",
-  "password_input_helper_text_too_weak": "Too weak",
-  "password_input_helper_text_weak": "Weak",
-  "password_input_helper_text_medium": "Medium",
-  "password_input_helper_text_strong": "Strong",
-  "password_input_helper_text_registration_failed": "Choose another password!",
   "severity_error": "Error",
   "severity_success": "Success"
 }
diff --git a/client/src/locale/fr/translation.json b/client/src/locale/fr/translation.json
index 5d9c556..61c3a73 100644
--- a/client/src/locale/fr/translation.json
+++ b/client/src/locale/fr/translation.json
@@ -1,5 +1,7 @@
 {
+  "severity": "",
   "share_screen": "Partager votre écran",
+  "share_window": "",
   "share_screen_area": "Partager une partie de l'écran",
   "share_file": "Partager le fichier",
   "dummy_option_string": "Option test",
@@ -15,8 +17,19 @@
   "conversation_title_three": "{{member0}}, {{member1}} et {{member2}}",
   "conversation_title_four": "{{member0}}, {{member1}}, {{member2}}, +1 autre membre",
   "conversation_title_more": "{{member01}}, {{member1}}, {{member2}}, +{{excess}} autres membres",
+  "username_input_helper_text_success": "Nom d'utilisateur disponible",
+  "username_input_helper_text_taken": "Nom d'utilisateur déjà pris",
+  "username_input_helper_text_invalid": "Le nom d'utilisateur ne suit pas le modèle",
+  "username_input_helper_text_registration_failed": "Nom d'utilisateur incorrect!",
+  "username_input_helper_text": "",
   "username_rules_dialog_title": "Règles du nom d'utilisateur",
   "username_input_label": "Choisir un identifiant",
+  "password_input_helper_text_too_weak": "Trop faible",
+  "password_input_helper_text_weak": "Faible",
+  "password_input_helper_text_medium": "Moyen",
+  "password_input_helper_text_strong": "Fort",
+  "password_input_helper_text_registration_failed": "Choisissez un autre mot de passe!",
+  "password_input_helper_text": "",
   "password_rules_dialog_title": "Règles du mot de passe",
   "password_input_label": "Mot de passe",
   "password_rule_one": "Le mot de passe doit contenir au moins 1 caractère alphabétique minuscule.",
@@ -35,6 +48,7 @@
   "message_call_incoming": "Appel sortant - {{duration}}",
   "message_swarm_created": "Le Swarm a été créé",
   "message_user_joined": "{{user}} s'est joint",
+  "messages_scroll_to_end": "",
   "dialog_close": "Fermer",
   "message_input_placeholder_one": "Écrire à {{member0}}",
   "message_input_placeholder_two": "Écrire à {{member0}} et {{member1}}",
@@ -51,22 +65,11 @@
   "login_form_to_registration_link": "S'INSCRIRE",
   "registration_success": "Inscription réussie! — Connexion en cours...",
   "registration_form_title": "INSCRIPTION",
-  "username_input_helper_text": "",
   "registration_form_username_tooltip": "Le nom d'utilisateur doit avoir de 3 à 32 caractères et contenir a-z, A-Z, -, _\n\nCliquer pour plus de détails",
-  "password_input_helper_text": "",
   "registration_form_password_tooltip": "Choisissez un mot de passe difficile à deviner pour les autres, mais facile à retenir pour vous, il doit avoir au moins 10 caractères. Votre compte ne sera pas récupéré si vous l'oubliez!\n\nCliquer pour plus de détails",
   "registration_form_submit_button": "S'INSCRIRE",
   "registration_form_to_login_text": "Déjà inscrit?",
   "registration_form_to_login_link": "SE CONNECTER",
-  "username_input_helper_text_success": "Nom d'utilisateur disponible",
-  "username_input_helper_text_taken": "Nom d'utilisateur déjà pris",
-  "username_input_helper_text_invalid": "Le nom d'utilisateur ne suit pas le modèle",
-  "username_input_helper_text_registration_failed": "Nom d'utilisateur incorrect!",
-  "password_input_helper_text_too_weak": "Trop faible",
-  "password_input_helper_text_weak": "Faible",
-  "password_input_helper_text_medium": "Moyen",
-  "password_input_helper_text_strong": "Fort",
-  "password_input_helper_text_registration_failed": "Choisissez un autre mot de passe!",
   "severity_error": "Erreur",
   "severity_success": "Succès"
 }
diff --git a/client/src/pages/JamiRegistration.tsx b/client/src/pages/JamiRegistration.tsx
index 71c38bd..a1024d5 100644
--- a/client/src/pages/JamiRegistration.tsx
+++ b/client/src/pages/JamiRegistration.tsx
@@ -22,22 +22,12 @@
 import { Form, useNavigate } from 'react-router-dom';
 
 import { AlertSnackbar } from '../components/AlertSnackbar';
-import { PasswordInput, UsernameInput } from '../components/Input';
+import { NameStatus, PasswordInput, PasswordStatus, UsernameInput } from '../components/Input';
 import ProcessingRequest from '../components/ProcessingRequest';
-import {
-  checkPasswordStrength,
-  isNameRegistered,
-  loginUser,
-  registerUser,
-  setAccessToken,
-  StrengthValueCode,
-} from '../utils/auth';
+import { checkPasswordStrength, isNameRegistered, loginUser, registerUser, setAccessToken } from '../utils/auth';
 import { inputWidth, jamiUsernamePattern } from '../utils/constants';
 import { InvalidPassword, UsernameNotFound } from '../utils/errors';
 
-type NameStatus = 'default' | 'success' | 'taken' | 'invalid' | 'registration_failed';
-type PasswordStatus = StrengthValueCode | 'registration_failed';
-
 type JamiRegistrationProps = {
   login: () => void;
 };
@@ -181,38 +171,23 @@
 
         <Form method="post" id="register-form">
           <div>
-            {/* For i18n-parser.
-              t('username_input_helper_text_default')
-              t('username_input_helper_text_success')
-              t('username_input_helper_text_taken')
-              t('username_input_helper_text_invalid')
-              t('username_input_helper_text_registration_failed')
-            */}
             <UsernameInput
               value={username}
               onChange={handleUsername}
               error={usernameError}
               success={usernameSuccess}
-              helperText={usernameStatus === 'default' ? '' : t(`username_input_helper_text_${usernameStatus}`)}
+              status={usernameStatus}
               sx={{ width: theme.typography.pxToRem(inputWidth) }}
               tooltipTitle={t('registration_form_username_tooltip')}
             />
           </div>
           <div>
-            {/* For i18n-parser.
-              t('password_input_helper_text_default')
-              t('password_input_helper_text_too_weak')
-              t('password_input_helper_text_weak')
-              t('password_input_helper_text_medium')
-              t('password_input_helper_text_strong')
-              t('password_input_helper_text_registration_failed')
-            */}
             <PasswordInput
               value={password}
               onChange={handlePassword}
               error={passwordError}
               success={passwordSuccess}
-              helperText={passwordStatus === 'default' ? '' : t(`password_input_helper_text_${passwordStatus}`)}
+              status={passwordStatus}
               sx={{ width: theme.typography.pxToRem(inputWidth) }}
               tooltipTitle={t('registration_form_password_tooltip')}
             />