From e27655aeea1c74f544eff39b042aed4a45bd4a01 Mon Sep 17 00:00:00 2001 From: Amruth Pillai Date: Mon, 30 Mar 2020 12:02:22 +0530 Subject: [PATCH] extracted strings from about tab --- src/components/RightSidebar/RightSidebar.js | 6 +- src/components/RightSidebar/tabs/About.js | 70 ++++++++----------- src/i18n/resources/en/rightSidebar/about.json | 36 ++++++++++ src/i18n/resources/en/rightSidebar/index.js | 2 + 4 files changed, 70 insertions(+), 44 deletions(-) create mode 100644 src/i18n/resources/en/rightSidebar/about.json diff --git a/src/components/RightSidebar/RightSidebar.js b/src/components/RightSidebar/RightSidebar.js index 7ecb8575..81f0d6e3 100644 --- a/src/components/RightSidebar/RightSidebar.js +++ b/src/components/RightSidebar/RightSidebar.js @@ -21,9 +21,9 @@ const RightSidebar = () => { t('colors.title'), t('fonts.title'), t('actions.title'), - 'About', + t('about.title'), ]; - const [currentTab, setCurrentTab] = useState(t('actions.title')); + const [currentTab, setCurrentTab] = useState(t('about.title')); const onChange = (key, value) => { dispatch({ type: 'on_input', @@ -46,7 +46,7 @@ const RightSidebar = () => { return ; case t('actions.title'): return ; - case 'About': + case t('about.title'): return ; default: return null; diff --git a/src/components/RightSidebar/tabs/About.js b/src/components/RightSidebar/tabs/About.js index 5230c463..c58f063a 100644 --- a/src/components/RightSidebar/tabs/About.js +++ b/src/components/RightSidebar/tabs/About.js @@ -1,16 +1,15 @@ import React from 'react'; +import { Trans, useTranslation } from 'react-i18next'; const AboutTab = () => { + const { t } = useTranslation('rightSidebar'); + return (
-
Documentation
+
{t('about.documentation.heading')}
-
- Want to know more about the app? Wouldn't it be nice if there was a guide to setting - it up on your local machine? Need information on how to contribute to the project? Look no - further, there's a comprehensive documentation made just for you. -
+
{t('about.documentation.body')}
{ >
description - Documentation + {t('about.documentation.buttons.documentation')}
@@ -28,13 +27,9 @@ const AboutTab = () => {
-
Bug? Feature Request?
+
{t('about.bugOrFeatureRequest.heading')}
-
- Something halting your progress from making a resume? Found a pesky bug that just - won't quit? Talk about it on the GitHub Issues section, or send me and email using - the actions below. -
+
{t('about.bugOrFeatureRequest.body')}
{ >
bug_report - Raise an Issue + {t('about.bugOrFeatureRequest.buttons.raiseIssue')}
@@ -57,7 +52,7 @@ const AboutTab = () => { >
email - Send an Email + {t('about.bugOrFeatureRequest.buttons.sendEmail')}
@@ -66,12 +61,9 @@ const AboutTab = () => {
-
Source Code
+
{t('about.sourceCode.heading')}
-
- Want to run the project from it's source? Are you a developer willing to contribute - to the open source development of this project? Click the button below. -
+
{t('about.sourceCode.body')}
{ >
code - GitHub Repo + {t('about.sourceCode.buttons.githubRepo')}
@@ -89,13 +81,9 @@ const AboutTab = () => {
-
License Information
+
{t('about.license.heading')}
-
- The project is governed under the MIT License, which you can read more about below. - Basically, you are allowed to use the project anywhere provided you give credits to the - original author. -
+
{t('about.license.body')}
{ >
policy - MIT License + {t('about.license.buttons.mitLicense')}

- Reactive Resume is a project by{' '} - - Amruth Pillai - {' '} - in hopes of allowing anyone to make beautiful resumes and get equal job opportunities. -
-
- Thank you for using Reactive Resume! + + Reactive Resume is a project by + + Amruth Pillai + + . +

+

{t('about.footer.thanks')}

); diff --git a/src/i18n/resources/en/rightSidebar/about.json b/src/i18n/resources/en/rightSidebar/about.json new file mode 100644 index 00000000..639cb3c1 --- /dev/null +++ b/src/i18n/resources/en/rightSidebar/about.json @@ -0,0 +1,36 @@ +{ + "title": "About", + "documentation": { + "heading": "Documentation", + "body": "Want to know more about the app? Wouldn't it be nice if there was a guide to setting it up on your local machine? Need information on how to contribute to the project? Look no further, there's a comprehensive documentation made just for you.", + "buttons": { + "documentation": "Documentation" + } + }, + "bugOrFeatureRequest": { + "heading": "Bug? Feature Request?", + "body": "Something halting your progress from making a resume? Found a pesky bug that just won't quit? Talk about it on the GitHub Issues section, or send me and email using the actions below.", + "buttons": { + "raiseIssue": "Raise an Issue", + "sendEmail": "Send an Email" + } + }, + "sourceCode": { + "heading": "Source Code", + "body": " Want to run the project from it's source? Are you a developer willing to contribute to the open source development of this project? Click the button below.", + "buttons": { + "githubRepo": "GitHub Repo" + } + }, + "license": { + "heading": "License Information", + "body": "The project is governed under the MIT License, which you can read more about below. Basically, you are allowed to use the project anywhere provided you give credits to the original author.", + "buttons": { + "mitLicense": "MIT License" + } + }, + "footer": { + "credit": "Reactive Resume is a project by <1>Amruth Pillai.", + "thanks": "Thank you for using Reactive Resume!" + } +} diff --git a/src/i18n/resources/en/rightSidebar/index.js b/src/i18n/resources/en/rightSidebar/index.js index 275bd62a..29ea04a9 100644 --- a/src/i18n/resources/en/rightSidebar/index.js +++ b/src/i18n/resources/en/rightSidebar/index.js @@ -2,10 +2,12 @@ import templates from './templates.json'; import colors from './colors.json'; import fonts from './fonts.json'; import actions from './actions.json'; +import about from './about.json'; export default { templates, colors, fonts, actions, + about, };