Skip to content

Commit

Permalink
Add missing labels for localization (OpenStickCommunity#1040)
Browse files Browse the repository at this point in the history
* Fixes OpenStickCommunity#1037

* Update these strings to match the "normal" way of doing things
  • Loading branch information
SavageCore authored Jun 17, 2024
1 parent 4be12f3 commit ed341fa
Show file tree
Hide file tree
Showing 13 changed files with 55 additions and 20 deletions.
13 changes: 3 additions & 10 deletions www/src/Addons/DualDirection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,7 @@ import Section from '../Components/Section';
import FormSelect from '../Components/FormSelect';

import FormControl from '../Components/FormControl';
import { DUAL_STICK_MODES } from '../Data/Addons';

const DUAL_COMBINE_MODES = [
{ label: 'Mixed', value: 0 },
{ label: 'Gamepad Override', value: 1 },
{ label: 'DDI Override', value: 2 },
{ label: 'None', value: 3 },
];
import { DUAL_COMBINE_MODES, DUAL_STICK_MODES } from '../Data/Addons';

export const dualDirectionScheme = {
DualDirectionalInputEnabled: yup
Expand Down Expand Up @@ -73,7 +66,7 @@ const DualDirection = ({ values, errors, handleChange, handleCheckbox }) => {
key={`button-dualDirDpadMode-option-${i}`}
value={o.value}
>
{o.label}
{t(`AddonsConfig:dual-directional-input-dual-dpad-mode-${i}`)}
</option>
))}
</FormSelect>
Expand All @@ -93,7 +86,7 @@ const DualDirection = ({ values, errors, handleChange, handleCheckbox }) => {
key={`button-dualDirCombineMode-option-${i}`}
value={o.value}
>
{o.label}
{t(`AddonsConfig:dual-directional-input-combine-mode-${i}`)}
</option>
))}
</FormSelect>
Expand Down
2 changes: 1 addition & 1 deletion www/src/Addons/Joystick.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const Joystick = ({ values, errors, handleChange, handleCheckbox }) => {
>
{DPAD_MODES.map((o, i) => (
<option key={`sliderModeZero-option-${i}`} value={o.value}>
{o.label}
{t(`AddonsConfig:joystick-selection-slider-mode-${i}`)}
</option>
))}
</FormSelect>
Expand Down
3 changes: 2 additions & 1 deletion www/src/Addons/OnBoardLed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export const onBoardLedState = {

const OnBoardLed = ({ values, errors, handleChange, handleCheckbox }) => {
const { t } = useTranslation();

return (
<Section title={t('AddonsConfig:on-board-led-configuration-label')}>
<div
Expand All @@ -49,7 +50,7 @@ const OnBoardLed = ({ values, errors, handleChange, handleCheckbox }) => {
>
{ON_BOARD_LED_MODES.map((o, i) => (
<option key={`onBoardLedMode-option-${i}`} value={o.value}>
{o.label}
{t(`AddonsConfig:on-board-led-mode-option-${i}`)}
</option>
))}
</FormSelect>
Expand Down
2 changes: 1 addition & 1 deletion www/src/Addons/SOCD.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const SOCD = ({ values, errors, handleChange, handleCheckbox }) => {
>
{SOCD_MODES.map((o, i) => (
<option key={`sliderSOCDModeDefault-option-${i}`} value={o.value}>
{o.label}
{t(`AddonsConfig:socd-slider-mode-${i}`)}
</option>
))}
</FormSelect>
Expand Down
2 changes: 1 addition & 1 deletion www/src/Addons/Tilt.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ const Tilt = ({ values, errors, handleChange, handleCheckbox }) => {
>
{TILT_SOCD_MODES.map((o, i) => (
<option key={`button-tiltSOCDMode-option-${i}`} value={o.value}>
{o.label}
{t(`AddonsConfig:tilt-socd-mode-${i}`)}
</option>
))}
</FormSelect>
Expand Down
7 changes: 7 additions & 0 deletions www/src/Data/Addons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ export const DUAL_STICK_MODES = [
{ label: 'Right Analog', value: 2 },
];

export const DUAL_COMBINE_MODES = [
{ label: 'Mixed', value: 0 },
{ label: 'Gamepad Override', value: 1 },
{ label: 'DDI Override', value: 2 },
{ label: 'None', value: 3 },
];

export const DPAD_MODES = [
{ label: 'Digital', value: 0 },
{ label: 'Left Analog', value: 1 },
Expand Down
22 changes: 22 additions & 0 deletions www/src/Locales/en/AddonsConfig.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ export default {
'bootsel-button-pin-label': 'BOOTSEL Button',
'on-board-led-configuration-label': 'On-Board LED Configuration',
'on-board-led-mode-label': 'LED Mode',
'on-board-led-mode-option-0': 'Off',
'on-board-led-mode-option-1': 'Mode Indicator',
'on-board-led-mode-option-2': 'Input Test',
'on-board-led-mode-option-3': 'PS4/5 Authentication',
'analog-header-text': 'Analog',
'analog-warning':
'Note: Analog sticks will override gamepad Left-Stick and Right-Stick inputs when enabled',
Expand Down Expand Up @@ -151,4 +155,22 @@ export default {
'analog1256-drdy-pin': 'Data Ready (DRDY) Pin',
'analog1256-analog-max': 'Analog Max',
'analog1256-enable-triggers': 'Enable Triggers',
'joystick-selection-slider-mode-0': 'Digital',
'joystick-selection-slider-mode-1': 'Left Analog',
'joystick-selection-slider-mode-2': 'Right Analog',
'dual-directional-input-dual-dpad-mode-0': 'D-Pad',
'dual-directional-input-dual-dpad-mode-1': 'Left Analog',
'dual-directional-input-dual-dpad-mode-2': 'Right Analog',
'dual-directional-input-combine-mode-0': 'Mixed',
'dual-directional-input-combine-mode-1': 'Gamepad Override',
'dual-directional-input-combine-mode-2': 'DDI Override',
'dual-directional-input-combine-mode-3': 'None',
'socd-slider-mode-0': 'Up Priority',
'socd-slider-mode-1': 'Neutral',
'socd-slider-mode-2': 'Last Win',
'socd-slider-mode-3': 'First Win',
'socd-slider-mode-4': 'SOCD Cleaning Off',
'tilt-socd-mode-0': 'Up Priority',
'tilt-socd-mode-1': 'Neutral',
'tilt-socd-mode-2': 'Last Win',
};
4 changes: 4 additions & 0 deletions www/src/Locales/en/DisplayConfig.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,9 @@ export default {
'inverted-label': 'Inverted',
'power-management-header': 'Power Management',
'turn-off-when-suspended': 'Turn Off When Suspended',
'flip-display-none': 'None',
'flip-display-flip': 'Flip',
'flip-display-mirror': 'Mirror',
'flip-display-flip-mirror': 'Flip and Mirror',
},
};
2 changes: 2 additions & 0 deletions www/src/Locales/en/InputMacroAddon.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,6 @@ export default {
'hold-repeat': 'Hold Repeat',
toggle: 'Toggle',
},
'macro-name': 'Macro Name',
'macro-activation-type': 'Macro Activation Type',
};
1 change: 1 addition & 0 deletions www/src/Locales/en/SettingsPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ export default {
'load-profile-4': 'Load Profile #4',
'next-profile': 'Next Profile',
'reboot-default': 'Reboot GP2040-CE',
'next-profile': 'Next Profile',
},
'forced-setup-mode-label': 'Forced Setup Mode',
'forced-setup-mode-options': {
Expand Down
5 changes: 5 additions & 0 deletions www/src/Pages/DisplayConfig.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,11 @@ export default function DisplayConfigPage() {

const { t } = useTranslation('');

DISPLAY_FLIP_MODES[0].label = t('DisplayConfig:form.flip-display-none');
DISPLAY_FLIP_MODES[1].label = t('DisplayConfig:form.flip-display-flip');
DISPLAY_FLIP_MODES[2].label = t('DisplayConfig:form.flip-display-mirror');
DISPLAY_FLIP_MODES[3].label = t('DisplayConfig:form.flip-display-flip-mirror');

useEffect(() => {
updateAddons();
updatePeripherals();
Expand Down
4 changes: 2 additions & 2 deletions www/src/Pages/InputMacroAddonPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ const MacroComponent = (props) => {
</Col>
</Row>
<Row className="my-2">
<Col sm={'auto'}>Macro Name:</Col>
<Col sm={'auto'}>{t('InputMacroAddon:macro-name')}:</Col>
<Col sm={'auto'}>
<Form.Control
size="sm"
Expand All @@ -351,7 +351,7 @@ const MacroComponent = (props) => {
</Row>
<Row className="my-2">
<Col sm={'auto'} mb={2}>
Macro Activation Type:
{t('InputMacroAddon:macro-activation-type')}:
</Col>
<Col sm={'auto'}>
<Form.Select
Expand Down
8 changes: 4 additions & 4 deletions www/src/Pages/SettingsPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -1011,19 +1011,19 @@ export default function SettingsPage() {
<Nav variant="pills" className="flex-column">
<Nav.Item>
<Nav.Link eventKey="inputmode">
Input Mode Settings
{t('SettingsPage:settings-header-text')}
</Nav.Link>
</Nav.Item>
<Nav.Item>
<Nav.Link eventKey="gamepad">Gamepad Settings</Nav.Link>
<Nav.Link eventKey="gamepad">{t('SettingsPage:gamepad-settings-header-text')}</Nav.Link>
</Nav.Item>
<Nav.Item>
<Nav.Link eventKey="bootmode">
Boot Input Modes
{t('SettingsPage:boot-input-mode-label')}
</Nav.Link>
</Nav.Item>
<Nav.Item>
<Nav.Link eventKey="hotkey">Hotkey Settings</Nav.Link>
<Nav.Link eventKey="hotkey">{t('SettingsPage:hotkey-settings-label')}</Nav.Link>
</Nav.Item>
</Nav>
</Col>
Expand Down

0 comments on commit ed341fa

Please sign in to comment.