From 81e753f150c14cd1eff5d5d9e514735889d44dd2 Mon Sep 17 00:00:00 2001 From: Apostolof Date: Wed, 4 Nov 2020 00:03:53 +0200 Subject: [PATCH] Add i18next --- .../public/locales/en/translation.json | 4 + packages/concordia-app/src/App.jsx | 1 + .../src/components/SignUpForm.jsx | 10 +- packages/concordia-app/src/intl/index.js | 25 + yarn.lock | 2509 +++++++++-------- 5 files changed, 1446 insertions(+), 1103 deletions(-) create mode 100644 packages/concordia-app/public/locales/en/translation.json create mode 100644 packages/concordia-app/src/intl/index.js diff --git a/packages/concordia-app/public/locales/en/translation.json b/packages/concordia-app/public/locales/en/translation.json new file mode 100644 index 0000000..f612744 --- /dev/null +++ b/packages/concordia-app/public/locales/en/translation.json @@ -0,0 +1,4 @@ +{ + "topbar.button.signup": "Sign Up", + "signup.form.button.submit": "Sign Up" +} \ No newline at end of file diff --git a/packages/concordia-app/src/App.jsx b/packages/concordia-app/src/App.jsx index be5c160..be44b99 100644 --- a/packages/concordia-app/src/App.jsx +++ b/packages/concordia-app/src/App.jsx @@ -4,6 +4,7 @@ import { BrowserRouter as Router } from 'react-router-dom'; import PropTypes from 'prop-types'; import LoadingContainer from './components/LoadingContainer'; import Routes from './Routes'; +import './intl/index'; // CSS import './assets/css/app.css'; diff --git a/packages/concordia-app/src/components/SignUpForm.jsx b/packages/concordia-app/src/components/SignUpForm.jsx index 3c9fed3..5d7d45a 100644 --- a/packages/concordia-app/src/components/SignUpForm.jsx +++ b/packages/concordia-app/src/components/SignUpForm.jsx @@ -2,7 +2,7 @@ import React, { Component } from 'react'; import { Button, Form, Menu, Message, Modal, } from 'semantic-ui-react'; - +import { withTranslation } from 'react-i18next'; import { connect } from 'react-redux'; import AppContext from './AppContext'; @@ -78,7 +78,6 @@ class SignUpForm extends Component { const { user, account } = this.props; if (user.hasSignedUp) { - console.log('Signing up..'); this.contract.methods.signUp.cacheSend(usernameInput); } else { this.setState({ @@ -97,6 +96,7 @@ class SignUpForm extends Component { const { error, usernameInput, errorHeader, errorMessage, signingUp, } = this.state; + const { t } = this.props; return ( )} > @@ -127,7 +127,7 @@ class SignUpForm extends Component { header={errorHeader} content={errorMessage} /> -