- p5.js Web Editor | About
+ {t('About.TitleHelmet')}
-
{t('Resources')}
+
{t('About.Resources')}
- {t('Libraries')}
+ {t('About.Libraries')}
@@ -67,7 +57,7 @@ function About(props) {
rel="noopener noreferrer"
>
- {t('Reference')}
+ {t('Nav.Help.Reference')}
@@ -77,7 +67,7 @@ function About(props) {
rel="noopener noreferrer"
>
- {t('Forum')}
+ {t('About.Forum')}
@@ -87,7 +77,7 @@ function About(props) {
href="https://github.com/processing/p5.js-web-editor"
target="_blank"
rel="noopener noreferrer"
- >{t('Contribute')}
+ >{t('About.Contribute')}
@@ -95,7 +85,7 @@ function About(props) {
href="https://github.com/processing/p5.js-web-editor/issues/new"
target="_blank"
rel="noopener noreferrer"
- >{t('Report')}
+ >{t('About.Report')}
diff --git a/client/modules/IDE/components/KeyboardShortcutModal.jsx b/client/modules/IDE/components/KeyboardShortcutModal.jsx
index b1acadbb..4d471ea0 100644
--- a/client/modules/IDE/components/KeyboardShortcutModal.jsx
+++ b/client/modules/IDE/components/KeyboardShortcutModal.jsx
@@ -6,50 +6,50 @@ function KeyboardShortcutModal() {
const { t } = useTranslation();
return (
-
{t('CodeEditing')}
+
{t('KeyboardShortcuts.CodeEditing.CodeEditing')}
- {t('Code editing keyboard shortcuts follow')} {t('Sublime Text shortcuts')} .
+ {t('KeyboardShortcuts.ShortcutsFollow')} {t('KeyboardShortcuts.SublimeText')} .
{'\u21E7'} + Tab
- {t('Tidy')}
+ {t('KeyboardShortcuts.CodeEditing.Tidy')}
{metaKeyName} + F
- {t('FindText')}
+ {t('KeyboardShortcuts.CodeEditing.FindText')}
{metaKeyName} + G
- {t('FindNextTextMatch')}
+ {t('KeyboardShortcuts.CodeEditing.FindNextTextMatch')}
{metaKeyName} + {'\u21E7'} + G
- {t('FindPreviousTextMatch')}
+ {t('KeyboardShortcuts.CodeEditing.FindPreviousTextMatch')}
{metaKeyName} + [
- {t('IndentCodeLeft')}
+ {t('KeyboardShortcuts.CodeEditing.IndentCodeLeft')}
{metaKeyName} + ]
- {t('IndentCodeRight')}
+ {t('KeyboardShortcuts.CodeEditing.IndentCodeRight')}
{metaKeyName} + /
- {t('CommentLine')}
+ {t('KeyboardShortcuts.CodeEditing.CommentLine')}
General
@@ -58,31 +58,31 @@ function KeyboardShortcutModal() {
{metaKeyName} + S
-
{t('Save')}
+
{t('Common.Save')}
{metaKeyName} + Enter
- {t('StartSketch')}
+ {t('KeyboardShortcuts.General.StartSketch')}
{metaKeyName} + {'\u21E7'} + Enter
- {t('StopSketch')}
+ {t('KeyboardShortcuts.General.StopSketch')}
{metaKeyName} + {'\u21E7'} + 1
- {t('TurnOnAccessibleOutput')}
+ {t('KeyboardShortcuts.General.TurnOnAccessibleOutput')}
{metaKeyName} + {'\u21E7'} + 2
- {t('TurnOffAccessibleOutput')}
+ {t('KeyboardShortcuts.General.TurnOffAccessibleOutput')}
diff --git a/client/modules/IDE/components/Preferences/index.jsx b/client/modules/IDE/components/Preferences/index.jsx
index 5fd5147d..c68af5bf 100644
--- a/client/modules/IDE/components/Preferences/index.jsx
+++ b/client/modules/IDE/components/Preferences/index.jsx
@@ -99,59 +99,59 @@ class Preferences extends React.Component {
- {this.props.t('GeneralSettings')}
- {this.props.t('Accessibility')}
+ {this.props.t('Preferences.GeneralSettings')}
+ {this.props.t('Preferences.Accessibility')}
-
{this.props.t('TextSize')}
+
{this.props.t('Preferences.TextSize')}
- {this.props.t('Decrease')}
+ {this.props.t('Preferences.DecreaseFont')}
@@ -364,4 +364,4 @@ Preferences.propTypes = {
t: PropTypes.func.isRequired,
};
-export default withTranslation('WebEditor')(Preferences);
+export default withTranslation()(Preferences);
diff --git a/client/modules/IDE/components/Toast.jsx b/client/modules/IDE/components/Toast.jsx
index 5aaa3f70..f3cc0fc7 100644
--- a/client/modules/IDE/components/Toast.jsx
+++ b/client/modules/IDE/components/Toast.jsx
@@ -8,7 +8,7 @@ import * as ToastActions from '../actions/toast';
import ExitIcon from '../../../images/exit.svg';
function Toast(props) {
- const { t } = useTranslation('WebEditor');
+ const { t } = useTranslation();
return (
diff --git a/client/modules/IDE/components/Toolbar.jsx b/client/modules/IDE/components/Toolbar.jsx
index 401a7e76..5a126b35 100644
--- a/client/modules/IDE/components/Toolbar.jsx
+++ b/client/modules/IDE/components/Toolbar.jsx
@@ -3,6 +3,7 @@ import React from 'react';
import { connect } from 'react-redux';
import { Link } from 'react-router';
import classNames from 'classnames';
+import { withTranslation } from 'react-i18next';
import * as IDEActions from '../actions/ide';
import * as preferenceActions from '../actions/preferences';
import * as projectActions from '../actions/project';
@@ -115,7 +116,7 @@ class Toolbar extends React.Component {
}}
/>
- Auto-refresh
+ {this.props.t('Toolbar.Auto-refresh')}
@@ -197,7 +198,8 @@ Toolbar.propTypes = {
startSketch: PropTypes.func.isRequired,
startAccessibleSketch: PropTypes.func.isRequired,
saveProject: PropTypes.func.isRequired,
- currentUser: PropTypes.string
+ currentUser: PropTypes.string,
+ t: PropTypes.func.isRequired
};
Toolbar.defaultProps = {
@@ -224,4 +226,5 @@ const mapDispatchToProps = {
};
export const ToolbarComponent = Toolbar;
-export default connect(mapStateToProps, mapDispatchToProps)(Toolbar);
+// export default connect(mapStateToProps, mapDispatchToProps)(Toolbar);
+export default withTranslation()(connect(mapStateToProps, mapDispatchToProps)(Toolbar));
diff --git a/client/modules/IDE/components/Toolbar.test.jsx b/client/modules/IDE/components/Toolbar.test.jsx
index d558fc46..cd435302 100644
--- a/client/modules/IDE/components/Toolbar.test.jsx
+++ b/client/modules/IDE/components/Toolbar.test.jsx
@@ -33,6 +33,7 @@ const renderComponent = (extraProps = {}) => {
isEditingName: false,
id: 'id',
},
+ t: jest.fn()
}, extraProps);
render(
);
diff --git a/client/modules/IDE/pages/IDEView.jsx b/client/modules/IDE/pages/IDEView.jsx
index b28e505f..04cbad77 100644
--- a/client/modules/IDE/pages/IDEView.jsx
+++ b/client/modules/IDE/pages/IDEView.jsx
@@ -55,7 +55,7 @@ function warnIfUnsavedChanges(props) { // eslint-disable-line
props.persistState();
window.onbeforeunload = null;
} else if (props.ide.unsavedChanges) {
- if (!window.confirm(props.t('WarningUnsavedChanges'))) {
+ if (!window.confirm(props.t('Nav.WarningUnsavedChanges'))) {
return false;
}
props.setUnsavedChanges(false);
@@ -221,8 +221,8 @@ class IDEView extends React.Component {
{this.props.ide.preferencesIsVisible &&
- {this.props.t('Preview')}
+ {this.props.t('Toolbar.Preview')}
{ this.overlay = element; }}>
@@ -389,16 +389,16 @@ class IDEView extends React.Component {
}
{ this.props.location.pathname === '/about' &&
}
{this.props.location.pathname === '/feedback' &&
@@ -435,8 +435,8 @@ class IDEView extends React.Component {
}
{this.props.ide.keyboardShortcutVisible &&
@@ -445,7 +445,7 @@ class IDEView extends React.Component {
{this.props.ide.errorType &&