From 05e43c70b788ffb1d7f0aa22ed566bdaa9b91f22 Mon Sep 17 00:00:00 2001 From: ov Date: Fri, 31 Jul 2020 14:20:42 +0100 Subject: [PATCH] Minimal Viable Navigation Menu (#1510) * Minimal Viable Navigation Menu Translation with new namespace I18Next configuration leaning on default separator and namespace Broom: i18n + debug:false * Minimal Viable Navigation Menu Test entry for Toolbar.test.jsx * Translation.json : Changes in translation for new namespace About : broom About lines 17-26 Nav component : changes in keys KeyboardShortcutModal.jsx: Key now in Common * Voice Over Labels in Preferences:index Labels included in translations.json * Voice Over Labels in Preferences:index Labels included in translations.json * Voice Over Labels in Preferences:index Labels included in translations.json * Voice Over Labels in Preferences:index Labels included in translations.json Snapshot updated npm run test -- -u * translations.json ARIA labels adjacent to respective label Updated names to call the labels Common namespace without currently used entries * Update Nav.jsx Missing Common.p5logoARIA key * Update Toolbar.test.jsx Deleting commented line 78 * Update in keys Co-authored-by: Andrew Nicolaou --- client/components/Nav.jsx | 82 +++--- .../__test__/__snapshots__/Nav.test.jsx.snap | 1 - client/i18n.js | 3 +- client/modules/IDE/actions/project.js | 16 +- client/modules/IDE/components/About.jsx | 32 +-- .../IDE/components/KeyboardShortcutModal.jsx | 28 +- .../IDE/components/Preferences/index.jsx | 90 +++---- client/modules/IDE/components/Toast.jsx | 2 +- client/modules/IDE/components/Toolbar.jsx | 9 +- .../modules/IDE/components/Toolbar.test.jsx | 1 + client/modules/IDE/pages/IDEView.jsx | 23 +- translations/locales/en-US/translations.json | 237 ++++++++++------- translations/locales/es-419/translations.json | 243 +++++++++++------- 13 files changed, 444 insertions(+), 323 deletions(-) diff --git a/client/components/Nav.jsx b/client/components/Nav.jsx index 4c27d6fa..16617112 100644 --- a/client/components/Nav.jsx +++ b/client/components/Nav.jsx @@ -100,11 +100,11 @@ class Nav extends React.PureComponent { const { unsavedChanges, warnIfUnsavedChanges } = this.props; if (!unsavedChanges) { this.props.showToast(1500); - this.props.setToastText('Opened new sketch.'); + this.props.setToastText('Toast.OpenedNewSketch'); this.props.newProject(); } else if (warnIfUnsavedChanges && warnIfUnsavedChanges()) { this.props.showToast(1500); - this.props.setToastText('Opened new sketch.'); + this.props.setToastText('Toast.OpenedNewSketch'); this.props.newProject(); } this.setDropdown('none'); @@ -172,7 +172,7 @@ class Nav extends React.PureComponent { handleLangSelection(event) { i18next.changeLanguage(event.target.value); this.props.showToast(1500); - this.props.setToastText('LangChange'); + this.props.setToastText('Toast.LangChange'); this.setDropdown('none'); } @@ -240,13 +240,13 @@ class Nav extends React.PureComponent { return (