From 4b9fe58a2d966596f9bbd3c8a3dd481e8be7d359 Mon Sep 17 00:00:00 2001 From: Liam Stevens <8955671+liamstevens111@users.noreply.github.com> Date: Wed, 15 Feb 2023 13:55:17 +0700 Subject: [PATCH] [#7] Add translations --- public/locales/en/translation.json | 8 +++++--- src/screens/Home/login.tsx | 20 +++++++++++++++----- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/public/locales/en/translation.json b/public/locales/en/translation.json index bab8636..8f819dd 100644 --- a/public/locales/en/translation.json +++ b/public/locales/en/translation.json @@ -1,6 +1,8 @@ { - "sample_page": { - "message": "Edit {{codeSample}} and save to reload", - "learn_react": "Learn React" + "login": { + "sign_in": "Sign in", + "email": "Email", + "password": "Password", + "forgot_password": "Forgot?" } } diff --git a/src/screens/Home/login.tsx b/src/screens/Home/login.tsx index ca6f777..8dda686 100644 --- a/src/screens/Home/login.tsx +++ b/src/screens/Home/login.tsx @@ -1,3 +1,5 @@ +import { useTranslation } from 'react-i18next'; + import logo from 'assets/images/logo.svg'; import Button from 'components/Button'; import Input from 'components/Input'; @@ -8,20 +10,28 @@ const tempHandler = () => { }; function LoginScreen() { + const { t } = useTranslation('translation'); + return ( <> logo -

Sign in to Nimble

+

{t('login.sign_in')} to Nimble

- +
- + {/* Change to React Router Link when implement #17 */} - Forgot? + {t('login.forgot_password')}
-