From 9d45d3e2b9d26b73c40f73aca8abe4c1ba3fdd4f Mon Sep 17 00:00:00 2001 From: David Ralph Date: Sun, 28 Feb 2021 16:18:17 +0000 Subject: [PATCH] WIP translations update --- CONTRIBUTING.md | 3 +- src/App.jsx | 8 +- src/components/modals/Feedback.jsx | 10 +- src/components/modals/Main.jsx | 10 +- .../modals/settings/sections/About.jsx | 7 + .../modals/settings/sections/Quote.jsx | 10 +- .../modals/settings/sections/Time.jsx | 16 +- src/components/modals/tabs/Settings.jsx | 22 +- src/components/widgets/Widgets.jsx | 4 +- src/components/widgets/navbar/Navbar.jsx | 8 +- src/modules/helpers/settings.js | 8 +- src/modules/languages.json | 8 +- src/modules/other_contributors.json | 6 + src/translations/en-GB.json | 199 ++++++++++++++++++ src/translations/en-US.json | 18 ++ src/translations/en.json | 168 --------------- 16 files changed, 287 insertions(+), 218 deletions(-) create mode 100644 src/modules/other_contributors.json create mode 100644 src/translations/en-GB.json create mode 100644 src/translations/en-US.json delete mode 100644 src/translations/en.json diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7e6ef1f1..a72434b8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -11,7 +11,8 @@ A bug fix? See if it has fixed the issue fully on both Chromium and Firefox. For implemented. ### Translations -Please don't use Google Translate. When submitting new translations, we'd prefer it if you waited until it's finished before pull requesting or if you opened it as a draft. +Please don't use Google Translate. When submitting new translations, we'd prefer it if you waited until it's finished before pull requesting or if you opened it as a draft. +All translation work should be done by copying the ``en-GB.json`` file to a file with your language code as the name, e.g ``fr.json``. ## Development ### Code diff --git a/src/App.jsx b/src/App.jsx index 2904be68..8074e8b8 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -82,8 +82,8 @@ export default class App extends React.PureComponent { const overlayClassList = (localStorage.getItem('animations') === 'true') ? 'Overlay modal-animation' : 'Overlay'; /// language - const languagecode = localStorage.getItem('language') || 'en'; - const language = merge(require('./translations/en.json'), require(`./translations/${languagecode}.json`)); + const languagecode = localStorage.getItem('language') || 'en-GB'; + const language = merge(require('./translations/en-GB.json'), require(`./translations/${languagecode}.json`)); const toastDisplayTime = localStorage.getItem('toastDisplayTime') || 2500; @@ -94,7 +94,7 @@ export default class App extends React.PureComponent {
this.setState({ [modal]: true })} language={language} /> - + this.setState({ mainModal: false })} isOpen={this.state.mainModal} className={modalClassList} overlayClassName={overlayClassList} ariaHideApp={false}>
this.setState({ mainModal: false })} /> @@ -103,7 +103,7 @@ export default class App extends React.PureComponent { this.setState({ updateModal: false })} /> this.closeWelcome()} isOpen={this.state.welcomeModal} className={modalClassList} overlayClassName={overlayClassList} ariaHideApp={false}> - this.closeWelcome()} language={language.welcome} /> + this.closeWelcome()} language={language.modals.welcome} /> {/* this.setState({ feedbackModal: false })} isOpen={this.state.feedbackModal} className={modalClassList} overlayClassName={overlayClassList} ariaHideApp={false}> this.setState({ feedbackModal: false })} /> diff --git a/src/components/modals/Feedback.jsx b/src/components/modals/Feedback.jsx index cb01a940..e7c65892 100644 --- a/src/components/modals/Feedback.jsx +++ b/src/components/modals/Feedback.jsx @@ -3,21 +3,21 @@ import React from 'react'; export default function FeedbackModal(props) { return (
-

Give us feedback

+

{props.language.modals.feedback.title}

× - +



- +



- +




- +
); } \ No newline at end of file diff --git a/src/components/modals/Main.jsx b/src/components/modals/Main.jsx index aca35d5c..7dce7ccb 100644 --- a/src/components/modals/Main.jsx +++ b/src/components/modals/Main.jsx @@ -11,16 +11,16 @@ export default class MainModal extends React.PureComponent { return (
× -

{this.props.language.modals.title}

+

Options

-
- +
+
-
+
-
+
diff --git a/src/components/modals/settings/sections/About.jsx b/src/components/modals/settings/sections/About.jsx index a82c7ba3..fe4ba3ba 100644 --- a/src/components/modals/settings/sections/About.jsx +++ b/src/components/modals/settings/sections/About.jsx @@ -4,6 +4,8 @@ import Tooltip from '@material-ui/core/Tooltip'; import * as Constants from '../../../../modules/constants'; +const other_contributors = require('../../../../modules/other_contributors.json'); + export default class About extends React.PureComponent { constructor(...args) { super(...args); @@ -49,6 +51,11 @@ export default class About extends React.PureComponent { {item.login} )} + {other_contributors.map((item) => // for those who contributed without opening a pull request + + {item.login} + + )}

Supporters

to be implemented

diff --git a/src/components/modals/settings/sections/Quote.jsx b/src/components/modals/settings/sections/Quote.jsx index 201f52bc..96f6adbb 100644 --- a/src/components/modals/settings/sections/Quote.jsx +++ b/src/components/modals/settings/sections/Quote.jsx @@ -5,12 +5,12 @@ import Checkbox from '../Checkbox'; export default function QuoteSettings (props) { return (
-

Quote

+

{props.language.title}

-

Buttons

- - - +

{props.language.buttons}

+ + +
); } \ No newline at end of file diff --git a/src/components/modals/settings/sections/Time.jsx b/src/components/modals/settings/sections/Time.jsx index c48dc4c9..80046ffb 100644 --- a/src/components/modals/settings/sections/Time.jsx +++ b/src/components/modals/settings/sections/Time.jsx @@ -6,15 +6,15 @@ import Dropdown from '../Dropdown'; export default function TimeSettings (props) { return (
-

Time

+

{props.language.title}

- - - - - - -

Date

+ + + + + + +

{props.language.date.title}

localStorage.setItem('dateFormat', document.getElementById('dateformat').value)}> diff --git a/src/components/modals/tabs/Settings.jsx b/src/components/modals/tabs/Settings.jsx index 5ef58822..027fd62a 100644 --- a/src/components/modals/tabs/Settings.jsx +++ b/src/components/modals/tabs/Settings.jsx @@ -15,31 +15,31 @@ export default function Settings (props) { return ( -
-