Skip to content

Commit e8d277c

Browse files
committed
remove unused var & improve keys naming
1 parent 7627168 commit e8d277c

File tree

7 files changed

+82
-40
lines changed

7 files changed

+82
-40
lines changed

client/components/mobile/Explorer.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import ConnectedFileNode from '../../modules/IDE/components/FileNode';
77

88

99
const Explorer = ({ id, canEdit, onPressClose }) => {
10-
const { t, i18n } = useTranslation();
10+
const { t } = useTranslation();
1111
return (
12-
<Sidebar title={t('MobileSideBar.Files')} onPressClose={onPressClose}>
12+
<Sidebar title={t('Explorer.Files')} onPressClose={onPressClose}>
1313
<ConnectedFileNode id={id} canEdit={canEdit} onClickFile={() => onPressClose()} />
1414
</Sidebar>
1515
);

client/modules/IDE/components/Preferences/PreferenceCreators.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import { useTranslation } from 'react-i18next';
22

33
export const optionsOnOff = (name) => {
4-
const { t, i18n } = useTranslation();
4+
const { t } = useTranslation();
55
return [
66
{
7-
value: true, label: t('Preferences.On'), ariaLabel: `${name} on`, name: `${name}`, id: `${name}-on`.replace(' ', '-')
7+
value: true, label: t('PreferenceCreators.On'), ariaLabel: `${name} on`, name: `${name}`, id: `${name}-on`.replace(' ', '-')
88
},
99
{
10-
value: false, label: t('Preferences.Off'), ariaLabel: `${name} off`, name: `${name}`, id: `${name}-off`.replace(' ', '-')
10+
value: false, label: t('PreferenceCreators.Off'), ariaLabel: `${name} off`, name: `${name}`, id: `${name}-off`.replace(' ', '-')
1111
}
1212
];
1313
};

client/modules/IDE/pages/MobileIDEView.jsx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -65,20 +65,20 @@ const NavItem = styled.li`
6565
`;
6666

6767
const getNavOptions = (username = undefined, logoutUser = () => {}, toggleForceDesktop = () => {}) => {
68-
const { t, i18n } = useTranslation();
68+
const { t } = useTranslation();
6969
return (username
7070
? [
71-
{ icon: PreferencesIcon, title: t('MobileNav.Preferences'), href: '/preferences', },
72-
{ icon: PreferencesIcon, title: t('MobileNav.MyStuff'), href: `/${username}/sketches` },
73-
{ icon: PreferencesIcon, title: t('MobileNav.Examples'), href: '/p5/sketches' },
74-
{ icon: PreferencesIcon, title: t('MobileNav.OriginalEditor'), action: toggleForceDesktop, },
75-
{ icon: PreferencesIcon, title: t('MobileNav.Logout'), action: logoutUser, },
71+
{ icon: PreferencesIcon, title: t('MobileIDEView.Preferences'), href: '/preferences', },
72+
{ icon: PreferencesIcon, title: t('MobileIDEView.MyStuff'), href: `/${username}/sketches` },
73+
{ icon: PreferencesIcon, title: t('MobileIDEView.Examples'), href: '/p5/sketches' },
74+
{ icon: PreferencesIcon, title: t('MobileIDEView.OriginalEditor'), action: toggleForceDesktop, },
75+
{ icon: PreferencesIcon, title: t('MobileIDEView.Logout'), action: logoutUser, },
7676
]
7777
: [
78-
{ icon: PreferencesIcon, title: t('MobileNav.Preferences'), href: '/preferences', },
79-
{ icon: PreferencesIcon, title: t('MobileNav.Examples'), href: '/p5/sketches' },
80-
{ icon: PreferencesIcon, title: t('MobileNav.OriginalEditor'), action: toggleForceDesktop, },
81-
{ icon: PreferencesIcon, title: t('MobileNav.Login'), href: '/login', },
78+
{ icon: PreferencesIcon, title: t('MobileIDEView.Preferences'), href: '/preferences', },
79+
{ icon: PreferencesIcon, title: t('MobileIDEView.Examples'), href: '/p5/sketches' },
80+
{ icon: PreferencesIcon, title: t('MobileIDEView.OriginalEditor'), action: toggleForceDesktop, },
81+
{ icon: PreferencesIcon, title: t('MobileIDEView.Login'), href: '/login', },
8282
]
8383
);
8484
};

client/modules/Mobile/MobileDashboardView.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ const Panels = {
139139

140140

141141
const navOptions = (username) => {
142-
const { t, i18n } = useTranslation();
142+
const { t } = useTranslation();
143143
return [
144144
{ title: t('MobileDashboardView.CreateSketch'), href: '/' },
145145
{ title: t('MobileDashboardView.CreateCollection'), href: `/${username}/collections/create` }
@@ -166,7 +166,7 @@ const MobileDashboard = ({ params, location }) => {
166166
const user = useSelector(state => state.user);
167167
const { username: paramsUsername } = params;
168168
const { pathname } = location;
169-
const { t, i18n } = useTranslation();
169+
const { t } = useTranslation();
170170

171171
const Tabs = Object.keys(Panels);
172172
const TabLabels = {

client/modules/Mobile/MobilePreferences.jsx

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -44,33 +44,33 @@ const MobilePreferences = () => {
4444
setTheme, setAutosave, setLinewrap, setTextOutput, setGridOutput, setSoundOutput, setLineNumbers, setLintWarning,
4545
} = bindActionCreators({ ...PreferencesActions, ...IdeActions }, useDispatch());
4646

47-
const { t, i18n } = useTranslation();
47+
const { t } = useTranslation();
4848

4949
const generalSettings = [
5050
{
51-
title: t('Preferences.Theme'),
51+
title: t('MobilePreferences.Theme'),
5252
value: theme,
5353
options: optionsPickOne(
54-
t('Preferences.Theme'),
55-
t('Preferences.LightTheme'),
56-
t('Preferences.DarkTheme'),
57-
t('Preferences.HighContrastTheme')
54+
t('MobilePreferences.Theme'),
55+
t('MobilePreferences.LightTheme'),
56+
t('MobilePreferences.DarkTheme'),
57+
t('MobilePreferences.HighContrastTheme')
5858
),
5959
onSelect: x => setTheme(x) // setTheme
6060
},
61-
preferenceOnOff(t('Preferences.Autosave'), autosave, setAutosave, 'autosave'),
62-
preferenceOnOff(t('Preferences.WordWrap'), linewrap, setLinewrap, 'linewrap')
61+
preferenceOnOff(t('MobilePreferences.Autosave'), autosave, setAutosave, 'autosave'),
62+
preferenceOnOff(t('MobilePreferences.WordWrap'), linewrap, setLinewrap, 'linewrap')
6363
];
6464

6565
const outputSettings = [
66-
preferenceOnOff(t('Preferences.PlainText'), textOutput, setTextOutput, 'text output'),
67-
preferenceOnOff(t('Preferences.TableText'), gridOutput, setGridOutput, 'table output'),
68-
preferenceOnOff(t('Preferences.Sound'), soundOutput, setSoundOutput, 'sound output')
66+
preferenceOnOff(t('MobilePreferences.PlainText'), textOutput, setTextOutput, 'text output'),
67+
preferenceOnOff(t('MobilePreferences.TableText'), gridOutput, setGridOutput, 'table output'),
68+
preferenceOnOff(t('MobilePreferences.Sound'), soundOutput, setSoundOutput, 'sound output')
6969
];
7070

7171
const accessibilitySettings = [
72-
preferenceOnOff(t('Preferences.LineNumbers'), lineNumbers, setLineNumbers),
73-
preferenceOnOff(t('Preferences.LintWarningSound'), lintWarning, setLintWarning)
72+
preferenceOnOff(t('MobilePreferences.LineNumbers'), lineNumbers, setLineNumbers),
73+
preferenceOnOff(t('MobilePreferences.LintWarningSound'), lintWarning, setLintWarning)
7474
];
7575

7676
return (
@@ -81,14 +81,14 @@ const MobilePreferences = () => {
8181
</Header>
8282
<section className="preferences">
8383
<Content>
84-
<SectionHeader>{t('Preferences.GeneralSettings')}</SectionHeader>
84+
<SectionHeader>{t('MobilePreferences.GeneralSettings')}</SectionHeader>
8585
{ generalSettings.map(option => <PreferencePicker key={`${option.title}wrapper`} {...option} />) }
8686

87-
<SectionHeader>{t('Preferences.Accessibility')}</SectionHeader>
87+
<SectionHeader>{t('MobilePreferences.Accessibility')}</SectionHeader>
8888
{ accessibilitySettings.map(option => <PreferencePicker key={`${option.title}wrapper`} {...option} />) }
8989

90-
<SectionHeader>{t('Preferences.AccessibleOutput')}</SectionHeader>
91-
<SectionSubeader>{t('Preferences.UsedScreenReader')}</SectionSubeader>
90+
<SectionHeader>{t('MobilePreferences.AccessibleOutput')}</SectionHeader>
91+
<SectionSubeader>{t('MobilePreferences.UsedScreenReader')}</SectionSubeader>
9292
{ outputSettings.map(option => <PreferencePicker key={`${option.title}wrapper`} {...option} />) }
9393

9494
</Content>

translations/locales/en-US/translations.json

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@
114114
"Settings": "Settings",
115115
"GeneralSettings": "General settings",
116116
"Accessibility": "Accessibility",
117-
"AccessibleOutput": "Accessible Output",
118117
"Theme": "Theme",
119118
"LightTheme": "Light",
120119
"LightThemeARIA": "light theme on",
@@ -533,7 +532,29 @@
533532
"EditSketchARIA": "Edit Sketch",
534533
"ByUser": "by"
535534
},
536-
"MobileNav":{
535+
"MobilePreferences": {
536+
"Settings": "Settings",
537+
"GeneralSettings": "General settings",
538+
"Accessibility": "Accessibility",
539+
"AccessibleOutput": "Accessible Output",
540+
"Theme": "Theme",
541+
"LightTheme": "Light",
542+
"DarkTheme": "Dark",
543+
"HighContrastTheme": "High Contrast",
544+
"Autosave": "Autosave",
545+
"WordWrap": "Word Wrap",
546+
"LineNumbers": "Line numbers",
547+
"LintWarningSound": "Lint warning sound",
548+
"UsedScreenReader": "Used with screen reader",
549+
"PlainText": "Plain-text",
550+
"TableText": "Table-text",
551+
"Sound": "Sound"
552+
},
553+
"PreferenceCreators": {
554+
"On": "On",
555+
"Off": "Off"
556+
},
557+
"MobileIDEView":{
537558
"Preferences": "Preferences",
538559
"MyStuff": "My Stuff",
539560
"Examples": "Examples",
@@ -550,7 +571,7 @@
550571
"CreateSketch": "Create Sketch",
551572
"CreateCollection": "Create Collection"
552573
},
553-
"MobileSideBar": {
574+
"Explorer": {
554575
"Files": "Files"
555576
}
556577
}

translations/locales/es-419/translations.json

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@
114114
"Settings": "Configuración",
115115
"GeneralSettings": "Configuración general",
116116
"Accessibility": "Accesibilidad",
117-
"AccessibleOutput": "Salida accesible",
118117
"Theme": "Modo de visualización",
119118
"LightTheme": "Claro",
120119
"LightThemeARIA": "Modo de visualización claro activado",
@@ -533,7 +532,29 @@
533532
"EditSketchARIA": "Editar Bosquejo",
534533
"ByUser": "por"
535534
},
536-
"MobileNav":{
535+
"MobilePreferences": {
536+
"Settings": "Configuración",
537+
"GeneralSettings": "Configuración general",
538+
"Accessibility": "Accesibilidad",
539+
"AccessibleOutput": "Salida accesible",
540+
"Theme": "Modo de visualización",
541+
"LightTheme": "Claro",
542+
"DarkTheme": "Oscuro",
543+
"HighContrastTheme": "Alto contraste",
544+
"Autosave": "Grabar automáticamente",
545+
"WordWrap": "Ajuste automático de línea",
546+
"LineNumbers": "Número de línea",
547+
"LintWarningSound": "Sonido de alarma Lint",
548+
"UsedScreenReader": "Uso con screen reader",
549+
"PlainText": "Texto sin formato",
550+
"TableText": "Tablero de texto",
551+
"Sound": "Sonido"
552+
},
553+
"PreferenceCreators": {
554+
"On": "Activar",
555+
"Off": "Desactivar"
556+
},
557+
"MobileIDEView":{
537558
"Preferences": "Preferencias",
538559
"MyStuff": "Mis cosas",
539560
"Examples": "Ejemplos",
@@ -550,7 +571,7 @@
550571
"CreateSketch": "Crear bosquejo",
551572
"CreateCollection": "Crear colección"
552573
},
553-
"MobileSideBar": {
574+
"Explorer": {
554575
"Files": "Archivos"
555576
}
556577
}

0 commit comments

Comments
 (0)