From 8ece0a7eb086d29682ec913d3fc725fad6a0089e Mon Sep 17 00:00:00 2001 From: David Ralph Date: Fri, 2 Jul 2021 21:59:58 +0100 Subject: [PATCH] feat(translations): add translation support to welcome modal, fix clock --- .../modals/main/scss/settings/_main.scss | 4 ++ src/components/modals/welcome/Welcome.jsx | 8 ++-- .../modals/welcome/WelcomeSections.jsx | 36 ++++++++-------- src/components/widgets/time/Clock.jsx | 2 +- src/translations/de_DE.json | 42 ++++++++++++++++--- src/translations/en_GB.json | 42 ++++++++++++++++--- src/translations/en_US.json | 42 ++++++++++++++++--- src/translations/es.json | 42 ++++++++++++++++--- src/translations/fr.json | 42 ++++++++++++++++--- src/translations/nl.json | 42 ++++++++++++++++--- src/translations/no.json | 42 ++++++++++++++++--- src/translations/ru.json | 42 ++++++++++++++++--- src/translations/zh_CN.json | 42 ++++++++++++++++--- 13 files changed, 351 insertions(+), 77 deletions(-) diff --git a/src/components/modals/main/scss/settings/_main.scss b/src/components/modals/main/scss/settings/_main.scss index 55feaf28..b15180fb 100644 --- a/src/components/modals/main/scss/settings/_main.scss +++ b/src/components/modals/main/scss/settings/_main.scss @@ -219,4 +219,8 @@ input[type=number] { vertical-align: sub; font-size: 1.4rem; } +} + +.MuiCheckbox-root { + color: yellow; } \ No newline at end of file diff --git a/src/components/modals/welcome/Welcome.jsx b/src/components/modals/welcome/Welcome.jsx index 1a1e7b0f..fb017201 100644 --- a/src/components/modals/welcome/Welcome.jsx +++ b/src/components/modals/welcome/Welcome.jsx @@ -23,7 +23,7 @@ export default class WelcomeModal extends React.PureComponent { return this.setState({ currentTab: this.state.currentTab - 1, image: this.images[this.state.currentTab - 1], - buttonText: 'Next' + buttonText: this.language.buttons.next }); } @@ -34,7 +34,7 @@ export default class WelcomeModal extends React.PureComponent { this.setState({ currentTab: this.state.currentTab + 1, image: this.images[this.state.currentTab + 1], - buttonText: (this.state.currentTab !== this.state.finalTab) ? 'Next' : 'Close' + buttonText: (this.state.currentTab !== this.state.finalTab) ? this.language.buttons.next : this.language.buttons.close }); } @@ -43,7 +43,7 @@ export default class WelcomeModal extends React.PureComponent { this.setState({ currentTab: tab, image: this.images[tab], - buttonText: 'Next' + buttonText: this.language.buttons.next }); } @@ -59,7 +59,7 @@ export default class WelcomeModal extends React.PureComponent { this.switchTab(tab)}/>
- {(this.state.currentTab !== 0) ? : null} + {(this.state.currentTab !== 0) ? : null}
diff --git a/src/components/modals/welcome/WelcomeSections.jsx b/src/components/modals/welcome/WelcomeSections.jsx index 2d19349e..8a527ad6 100644 --- a/src/components/modals/welcome/WelcomeSections.jsx +++ b/src/components/modals/welcome/WelcomeSections.jsx @@ -64,8 +64,8 @@ export default class WelcomeSections extends React.Component { const intro = ( <> -

{language.title} Mue Tab

-

{language.thankyoumessage1} {language.thankyoumessage2}

+

{language.sections.intro.title}

+

{language.sections.intro.description}

to be added

example mue setup @@ -75,16 +75,16 @@ export default class WelcomeSections extends React.Component { const chooseLanguage = ( <> -

Choose your language

-

to be added

+

{language.sections.language.title}

+

{language.sections.language.description}

); const theme = ( <> -

Select a theme

-

Mue is available in both light and dark theme, or this can be automatically set depending on your system theme.

+

{language.sections.theme.title}

+

{language.sections.theme.description}

this.changeTheme('auto')}> @@ -100,40 +100,40 @@ export default class WelcomeSections extends React.Component { Dark
-

Quick Tip

-

Using the Auto settings will use the theme on your computer. This setting will impact the modals and some of the widgets displayed on the screen, such as weather and notes.

+

{language.tip}

+

{language.sections.theme.tip}

); const settings = ( <> -

Import Settings

-

Installing Mue on a new device? Feel free to import your old settings!

+

{language.sections.settings.title}

+

{language.sections.settings.description}

this.importSettings(e)}/> -

Quick Tip

-

You can export your old settings by navigating to the Advanced tab in your old Mue setup. Then you need to click the export button which will download the JSON file. You can upload this file here to carry across your settings and preferences from your previous Mue installation.

+

{language.tip}

+

{language.sections.settings.tip}

); const privacy = ( <> -

Privacy Options

-

to be added

+

{language.sections.privacy.title}

+

{language.sections.privacy.description}

); const final = ( <> -

Final step

-

Your Mue Tab experience is finally about to begin.

-

Changes

-

To change settings later click on the settings icon in the top right corner of your tab.

+

{language.sections.final.title}

+

{language.sections.final.description}

+

{language.sections.final.changes}

+

{language.sections.final.changes_description}

this.props.switchTab(1)}>Language: {languages.find((i) => i.value === localStorage.getItem('language')).name}
this.props.switchTab(3)}>Theme: {this.getSetting('theme')}
diff --git a/src/components/widgets/time/Clock.jsx b/src/components/widgets/time/Clock.jsx index 314e5fb0..3921d70d 100644 --- a/src/components/widgets/time/Clock.jsx +++ b/src/components/widgets/time/Clock.jsx @@ -49,7 +49,7 @@ export default class Clock extends React.PureComponent { if (localStorage.getItem('timeformat') === 'twentyfourhour') { if (zero === 'false') { - time = `${now.getHours()}:${('00' + now.getMinutes()).slice(-2)}:${('00' + now.getMinutes()).slice(-2)}`; + time = `${now.getHours()}:${('00' + now.getMinutes()).slice(-2)}${sec}`; } else { time = `${('00' + now.getHours()).slice(-2)}:${('00' + now.getMinutes()).slice(-2)}${sec}`; } diff --git a/src/translations/de_DE.json b/src/translations/de_DE.json index 08864006..2b9cdd89 100644 --- a/src/translations/de_DE.json +++ b/src/translations/de_DE.json @@ -376,12 +376,42 @@ "contact_support": "Kontaktieren Sie uns hier" }, "welcome": { - "title": "Willkommen bei", - "information": "Information", - "thankyoumessage1": "Vielen Dank für die Installation von Mue Tab,", - "thankyoumessage2": "wir wünschen Ihnen viel Spaß mit unserer Erweiterung.", - "support": "Support", - "close": "Schließen" + "tip": "Quick Tip", + "sections": { + "intro": { + "title": "Willkommen bei Mue Tab", + "description": "Vielen Dank für die Installation, wir wünschen Ihnen viel Spaß mit unserer Erweiterung." + }, + "language": { + "title": "Choose your language", + "description": "to be added" + }, + "theme": { + "title": "Select a theme", + "description": "Mue is available in both light and dark theme, or this can be automatically set depending on your system theme.", + "tip": "Using the Auto settings will use the theme on your computer. This setting will impact the modals and some of the widgets displayed on the screen, such as weather and notes." + }, + "settings": { + "title": "Import Settings", + "description": "Installing Mue on a new device? Feel free to import your old settings!", + "tip": "You can export your old settings by navigating to the Advanced tab in your old Mue setup. Then you need to click the export button which will download the JSON file. You can upload this file here to carry across your settings and preferences from your previous Mue installation." + }, + "privacy": { + "title": "Privacy Options", + "description": "to be added" + }, + "final": { + "title": "Final step", + "description": "Your Mue Tab experience is about to begin.", + "changes": "Changes", + "changes_description": "To change settings later click on the settings icon in the top right corner of your tab." + } + }, + "buttons": { + "next": "Next", + "previous": "Previous", + "close": "Schließen" + } }, "feedback": { "title": "Geben Sie uns Feedback", diff --git a/src/translations/en_GB.json b/src/translations/en_GB.json index 7aa2e517..de617fa6 100644 --- a/src/translations/en_GB.json +++ b/src/translations/en_GB.json @@ -376,12 +376,42 @@ "contact_support": "Contact us here" }, "welcome": { - "title": "Welcome to", - "information": "Information", - "thankyoumessage1": "Thank you for installing Mue Tab,", - "thankyoumessage2": "we hope you enjoy your time with our extension.", - "support": "Support", - "close": "Close" + "tip": "Quick Tip", + "sections": { + "intro": { + "title": "Welcome to Mue Tab", + "description": "Thank you for installing, we hope you enjoy your time with out extension." + }, + "language": { + "title": "Choose your language", + "description": "to be added" + }, + "theme": { + "title": "Select a theme", + "description": "Mue is available in both light and dark theme, or this can be automatically set depending on your system theme.", + "tip": "Using the Auto settings will use the theme on your computer. This setting will impact the modals and some of the widgets displayed on the screen, such as weather and notes." + }, + "settings": { + "title": "Import Settings", + "description": "Installing Mue on a new device? Feel free to import your old settings!", + "tip": "You can export your old settings by navigating to the Advanced tab in your old Mue setup. Then you need to click the export button which will download the JSON file. You can upload this file here to carry across your settings and preferences from your previous Mue installation." + }, + "privacy": { + "title": "Privacy Options", + "description": "to be added" + }, + "final": { + "title": "Final step", + "description": "Your Mue Tab experience is about to begin.", + "changes": "Changes", + "changes_description": "To change settings later click on the settings icon in the top right corner of your tab." + } + }, + "buttons": { + "next": "Next", + "previous": "Previous", + "close": "Close" + } }, "feedback": { "title": "Give us feedback", diff --git a/src/translations/en_US.json b/src/translations/en_US.json index 2e62f899..665020e0 100644 --- a/src/translations/en_US.json +++ b/src/translations/en_US.json @@ -376,12 +376,42 @@ "contact_support": "Contact us here" }, "welcome": { - "title": "Welcome to", - "information": "Information", - "thankyoumessage1": "Thank you for installing Mue Tab,", - "thankyoumessage2": "we hope you enjoy your time with our extension.", - "support": "Support", - "close": "Close" + "tip": "Quick Tip", + "sections": { + "intro": { + "title": "Welcome to Mue Tab", + "description": "Thank you for installing, we hope you enjoy your time with out extension." + }, + "language": { + "title": "Choose your language", + "description": "to be added" + }, + "theme": { + "title": "Select a theme", + "description": "Mue is available in both light and dark theme, or this can be automatically set depending on your system theme.", + "tip": "Using the Auto settings will use the theme on your computer. This setting will impact the modals and some of the widgets displayed on the screen, such as weather and notes." + }, + "settings": { + "title": "Import Settings", + "description": "Installing Mue on a new device? Feel free to import your old settings!", + "tip": "You can export your old settings by navigating to the Advanced tab in your old Mue setup. Then you need to click the export button which will download the JSON file. You can upload this file here to carry across your settings and preferences from your previous Mue installation." + }, + "privacy": { + "title": "Privacy Options", + "description": "to be added" + }, + "final": { + "title": "Final step", + "description": "Your Mue Tab experience is about to begin.", + "changes": "Changes", + "changes_description": "To change settings later click on the settings icon in the top right corner of your tab." + } + }, + "buttons": { + "next": "Next", + "previous": "Previous", + "close": "Close" + } }, "feedback": { "title": "Give us feedback", diff --git a/src/translations/es.json b/src/translations/es.json index eadfbe16..c90d697e 100644 --- a/src/translations/es.json +++ b/src/translations/es.json @@ -376,12 +376,42 @@ "contact_support": "Contáctanos aquí" }, "welcome": { - "title": "Bienvenido a", - "information": "Información", - "thankyoumessage1": "Gracias por instalar Mue Tab,", - "thankyoumessage2": "esperamos que disfrute de su tiempo con nuestra extensión.", - "support": "Soporte", - "close": "Cerrar" + "tip": "Quick Tip", + "sections": { + "intro": { + "title": "Bienvenido a Mue Tab", + "description": "Gracias por instalar, esperamos que disfrute de su tiempo con nuestra extensión." + }, + "language": { + "title": "Choose your language", + "description": "to be added" + }, + "theme": { + "title": "Select a theme", + "description": "Mue is available in both light and dark theme, or this can be automatically set depending on your system theme.", + "tip": "Using the Auto settings will use the theme on your computer. This setting will impact the modals and some of the widgets displayed on the screen, such as weather and notes." + }, + "settings": { + "title": "Import Settings", + "description": "Installing Mue on a new device? Feel free to import your old settings!", + "tip": "You can export your old settings by navigating to the Advanced tab in your old Mue setup. Then you need to click the export button which will download the JSON file. You can upload this file here to carry across your settings and preferences from your previous Mue installation." + }, + "privacy": { + "title": "Privacy Options", + "description": "to be added" + }, + "final": { + "title": "Final step", + "description": "Your Mue Tab experience is about to begin.", + "changes": "Changes", + "changes_description": "To change settings later click on the settings icon in the top right corner of your tab." + } + }, + "buttons": { + "next": "Next", + "previous": "Previous", + "close": "Cerrar" + } }, "feedback": { "title": "Danos tu opinión", diff --git a/src/translations/fr.json b/src/translations/fr.json index ea13d625..9c040a52 100644 --- a/src/translations/fr.json +++ b/src/translations/fr.json @@ -376,12 +376,42 @@ "contact_support": "Contactez-nous " }, "welcome": { - "title": "Bienvenue en", - "information": "Informations", - "thankyoumessage1": "Merci d'avoir installé Mue Tab,", - "thankyoumessage2": "nous espérons que vous apprécierez votre temps avec notre extension.", - "support": "Soutien", - "close": "Fermer" + "tip": "Quick Tip", + "sections": { + "intro": { + "title": "Bienvenue en Mue Tab", + "description": "Merci d'avoir installé, nous espérons que vous apprécierez votre temps avec notre extension." + }, + "language": { + "title": "Choose your language", + "description": "to be added" + }, + "theme": { + "title": "Select a theme", + "description": "Mue is available in both light and dark theme, or this can be automatically set depending on your system theme.", + "tip": "Using the Auto settings will use the theme on your computer. This setting will impact the modals and some of the widgets displayed on the screen, such as weather and notes." + }, + "settings": { + "title": "Import Settings", + "description": "Installing Mue on a new device? Feel free to import your old settings!", + "tip": "You can export your old settings by navigating to the Advanced tab in your old Mue setup. Then you need to click the export button which will download the JSON file. You can upload this file here to carry across your settings and preferences from your previous Mue installation." + }, + "privacy": { + "title": "Privacy Options", + "description": "to be added" + }, + "final": { + "title": "Final step", + "description": "Your Mue Tab experience is about to begin.", + "changes": "Changes", + "changes_description": "To change settings later click on the settings icon in the top right corner of your tab." + } + }, + "buttons": { + "next": "Next", + "previous": "Previous", + "close": "Fermer" + } }, "feedback": { "title": "Give us feedback", diff --git a/src/translations/nl.json b/src/translations/nl.json index 062ba051..6442a0de 100644 --- a/src/translations/nl.json +++ b/src/translations/nl.json @@ -376,12 +376,42 @@ "contact_support": "Contact us here" }, "welcome": { - "title": "Welcome to", - "information": "Information", - "thankyoumessage1": "Thank you for installing Mue Tab,", - "thankyoumessage2": "we hope you enjoy your time with our extension.", - "support": "Support", - "close": "Close" + "tip": "Quick Tip", + "sections": { + "intro": { + "title": "Welcome to Mue Tab", + "description": "Thank you for installing, we hope you enjoy your time with out extension." + }, + "language": { + "title": "Choose your language", + "description": "to be added" + }, + "theme": { + "title": "Select a theme", + "description": "Mue is available in both light and dark theme, or this can be automatically set depending on your system theme.", + "tip": "Using the Auto settings will use the theme on your computer. This setting will impact the modals and some of the widgets displayed on the screen, such as weather and notes." + }, + "settings": { + "title": "Import Settings", + "description": "Installing Mue on a new device? Feel free to import your old settings!", + "tip": "You can export your old settings by navigating to the Advanced tab in your old Mue setup. Then you need to click the export button which will download the JSON file. You can upload this file here to carry across your settings and preferences from your previous Mue installation." + }, + "privacy": { + "title": "Privacy Options", + "description": "to be added" + }, + "final": { + "title": "Final step", + "description": "Your Mue Tab experience is about to begin.", + "changes": "Changes", + "changes_description": "To change settings later click on the settings icon in the top right corner of your tab." + } + }, + "buttons": { + "next": "Next", + "previous": "Previous", + "close": "Close" + } }, "feedback": { "title": "Give us feedback", diff --git a/src/translations/no.json b/src/translations/no.json index 10f0e46e..efce45eb 100644 --- a/src/translations/no.json +++ b/src/translations/no.json @@ -376,12 +376,42 @@ "contact_support": "Contact us here" }, "welcome": { - "title": "Welcome to", - "information": "Information", - "thankyoumessage1": "Thank you for installing Mue Tab,", - "thankyoumessage2": "we hope you enjoy your time with our extension.", - "support": "Support", - "close": "Close" + "tip": "Quick Tip", + "sections": { + "intro": { + "title": "Welcome to Mue Tab", + "description": "Thank you for installing, we hope you enjoy your time with out extension." + }, + "language": { + "title": "Choose your language", + "description": "to be added" + }, + "theme": { + "title": "Select a theme", + "description": "Mue is available in both light and dark theme, or this can be automatically set depending on your system theme.", + "tip": "Using the Auto settings will use the theme on your computer. This setting will impact the modals and some of the widgets displayed on the screen, such as weather and notes." + }, + "settings": { + "title": "Import Settings", + "description": "Installing Mue on a new device? Feel free to import your old settings!", + "tip": "You can export your old settings by navigating to the Advanced tab in your old Mue setup. Then you need to click the export button which will download the JSON file. You can upload this file here to carry across your settings and preferences from your previous Mue installation." + }, + "privacy": { + "title": "Privacy Options", + "description": "to be added" + }, + "final": { + "title": "Final step", + "description": "Your Mue Tab experience is about to begin.", + "changes": "Changes", + "changes_description": "To change settings later click on the settings icon in the top right corner of your tab." + } + }, + "buttons": { + "next": "Next", + "previous": "Previous", + "close": "Close" + } }, "feedback": { "title": "Give us feedback", diff --git a/src/translations/ru.json b/src/translations/ru.json index a21a4310..53290977 100644 --- a/src/translations/ru.json +++ b/src/translations/ru.json @@ -376,12 +376,42 @@ "contact_support": "Связаться с нами" }, "welcome": { - "title": "Welcome to", - "information": "Information", - "thankyoumessage1": "Thank you for installing Mue Tab,", - "thankyoumessage2": "we hope you enjoy your time with our extension.", - "support": "Support", - "close": "Close" + "tip": "Quick Tip", + "sections": { + "intro": { + "title": "Welcome to Mue Tab", + "description": "Thank you for installing, we hope you enjoy your time with out extension." + }, + "language": { + "title": "Choose your language", + "description": "to be added" + }, + "theme": { + "title": "Select a theme", + "description": "Mue is available in both light and dark theme, or this can be automatically set depending on your system theme.", + "tip": "Using the Auto settings will use the theme on your computer. This setting will impact the modals and some of the widgets displayed on the screen, such as weather and notes." + }, + "settings": { + "title": "Import Settings", + "description": "Installing Mue on a new device? Feel free to import your old settings!", + "tip": "You can export your old settings by navigating to the Advanced tab in your old Mue setup. Then you need to click the export button which will download the JSON file. You can upload this file here to carry across your settings and preferences from your previous Mue installation." + }, + "privacy": { + "title": "Privacy Options", + "description": "to be added" + }, + "final": { + "title": "Final step", + "description": "Your Mue Tab experience is about to begin.", + "changes": "Changes", + "changes_description": "To change settings later click on the settings icon in the top right corner of your tab." + } + }, + "buttons": { + "next": "Next", + "previous": "Previous", + "close": "Close" + } }, "feedback": { "title": "Give us feedback", diff --git a/src/translations/zh_CN.json b/src/translations/zh_CN.json index 8e073d19..866ec11e 100644 --- a/src/translations/zh_CN.json +++ b/src/translations/zh_CN.json @@ -376,12 +376,42 @@ "contact_support": "点此联系我们" }, "welcome": { - "title": "欢迎使用", - "information": "信息", - "thankyoumessage1": "感谢您安装 Mue Tab。", - "thankyoumessage2": "祝您使用愉快。", - "support": "支持", - "close": "关闭" + "tip": "Quick Tip", + "sections": { + "intro": { + "title": "欢迎使用 Mue Tab", + "description": "感谢您安装。祝您使用愉快。" + }, + "language": { + "title": "Choose your language", + "description": "to be added" + }, + "theme": { + "title": "Select a theme", + "description": "Mue is available in both light and dark theme, or this can be automatically set depending on your system theme.", + "tip": "Using the Auto settings will use the theme on your computer. This setting will impact the modals and some of the widgets displayed on the screen, such as weather and notes." + }, + "settings": { + "title": "Import Settings", + "description": "Installing Mue on a new device? Feel free to import your old settings!", + "tip": "You can export your old settings by navigating to the Advanced tab in your old Mue setup. Then you need to click the export button which will download the JSON file. You can upload this file here to carry across your settings and preferences from your previous Mue installation." + }, + "privacy": { + "title": "Privacy Options", + "description": "to be added" + }, + "final": { + "title": "Final step", + "description": "Your Mue Tab experience is about to begin.", + "changes": "Changes", + "changes_description": "To change settings later click on the settings icon in the top right corner of your tab." + } + }, + "buttons": { + "next": "Next", + "previous": "Previous", + "close": "关闭" + } }, "feedback": { "title": "给我们反馈",