Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add web config localization lables #1089

Merged
merged 3 commits into from
Jul 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions www/src/Locales/en/InputMacroAddon.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,7 @@ export default {
'Use Macro Button + Gamepad Button to Trigger',
'input-macro-macro-button-pin-plus': 'Button Assignment:',
'input-macro-header-text': 'Macros Overview',
'input-macro-1-header-text': 'Macro 1 Settings',
'input-macro-2-header-text': 'Macro 2 Settings',
'input-macro-3-header-text': 'Macro 3 Settings',
'input-macro-4-header-text': 'Macro 4 Settings',
'input-macro-5-header-text': 'Macro 5 Settings',
'input-macro-6-header-text': 'Macro 6 Settings',
'input-macro-macro-list-txt': 'Macro {{macroNumber}}',
'input-macro-duration-label': 'Duration',
'input-macro-wait-duration-label': 'Wait Duration',
'input-macro-time-label-ms': 'ms',
Expand All @@ -34,4 +29,12 @@ export default {
},
'macro-name': 'Macro Name',
'macro-activation-type': 'Macro Activation Type',
'table-thread-label': 'Label',
'table-thread-type': 'Type',
'table-thread-assigned-to': 'Assigned To',
'table-thread-button': 'Button',
'table-thread-actions': 'Actions',
'table-thread-status': 'Status',
'input-macro-macro-trigger-type-button': 'Button',
'input-macro-macro-trigger-type-pin': 'Pin',
};
6 changes: 6 additions & 0 deletions www/src/Locales/en/PinMapping.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ export default {
'pin-viewer': 'Pin viewer',
'pin-pressed': 'Pressed pin: {{pressedPin}}',
'pin-header-label': 'Pin',
'profile-text-1': 'Base(Profile 1)',
'profile-text-2': 'Profile 2',
'profile-text-3': 'Profile 3',
'profile-text-4': 'Profile 4',
'profile-pin-mapping-title-base': 'Base(Profile 1) - Pin Mapping',
'profile-pin-mapping-title': 'Profile {{profileNumber}} - Pin Mapping',
'profile-pins-warning':
'Try to avoid changing the buttons and/or directions used for the switch profile hotkeys. Otherwise, it will be difficult to understand what profile is being selected!',
'profile-copy-base': 'Copy base profile',
Expand Down
7 changes: 1 addition & 6 deletions www/src/Locales/ja-JP/InputMacroAddon.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,7 @@ export default {
'起動にマクロボタン+コントローラボタンを利用',
'input-macro-macro-button-pin-plus': 'ボタン割り当て:',
'input-macro-header-text': 'マクロ設定概要',
'input-macro-1-header-text': 'マクロ 1 設定',
'input-macro-2-header-text': 'マクロ 2 設定',
'input-macro-3-header-text': 'マクロ 3 設定',
'input-macro-4-header-text': 'マクロ 4 設定',
'input-macro-5-header-text': 'マクロ 5 設定',
'input-macro-6-header-text': 'マクロ 6 設定',
Copy link
Contributor

@mizma mizma Jul 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you could add 'input-macro-macro-list-txt': 'マクロ {{macroNumber}} 設定' there that would be nice. although I would have to work on some of your new additions so I could do it at that time. either is fine I guess.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, anything else?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no I'll work on the other new labels once this is merged.

'input-macro-macro-list-txt': 'マクロ {{macroNumber}} 設定',
'input-macro-duration-label': '持続時間',
'input-macro-wait-duration-label': '待機時間',
'input-macro-time-label-ms': 'ミリ秒',
Expand Down
2 changes: 2 additions & 0 deletions www/src/Locales/ja-JP/SettingsPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ export default {
's2-button': 'S2 ボタン',
'a1-button': 'A1 ボタン',
'a2-button': 'A2 ボタン',
'a3-button': 'A3 ボタン',
'a4-button': 'A4 ボタン',
'touchpad-button': 'タッチパッドボタン',
'load-profile-1': 'プロファイル #1をロード',
'load-profile-2': 'プロファイル #2をロード',
Expand Down
25 changes: 16 additions & 9 deletions www/src/Locales/zh-CN/InputMacroAddon.jsx
Original file line number Diff line number Diff line change
@@ -1,30 +1,37 @@
export default {
'input-macro-board-led-enabled': '使用板载 LED 显示宏的状态',
'input-macro-macro-enabled': '启用',
'input-macro-macro-enabled-badge': '启用',
'input-macro-macro-disabled-badge': '禁用',
'input-macro-macro-exclusive': '独占 (不能切换到另一个宏)',
'input-macro-macro-interruptible': '可打断 (用户输入可取消宏)',
'input-macro-macro-show-frames': '显示帧数 (1 Frame = 16.666 ms)',
'input-macro-macro-show-frames': '显示帧数 (1 = 16.666 毫秒)',
'input-macro-macro-uses-buttons': '使用宏按钮 + 游戏控制器按键来触发',
'input-macro-macro-button-pin-plus': '按键分配:',
'input-macro-header-text': '宏设定概要',
'input-macro-1-header-text': '宏 1 设定',
'input-macro-2-header-text': '宏 2 设定',
'input-macro-3-header-text': '宏 3 设定',
'input-macro-4-header-text': '宏 4 设定',
'input-macro-5-header-text': '宏 5 设定',
'input-macro-6-header-text': '宏 6 设定',
'input-macro-header-text': '宏设置概要',
'input-macro-macro-list-txt': '宏 {{macroNumber}}',
'input-macro-duration-label': '持续时间',
'input-macro-wait-duration-label': '等待时间',
'input-macro-time-label-ms': '毫秒',
'input-macro-time-label-frames': '帧',
'input-macro-release-and-wait-label': '松开并等待 ',
'input-macro-sub-header':
'注意:对于通过引脚映射的宏,请参见功能配置下的引脚映射页面。宏也可以分配给游戏手柄按钮,与相应的单个宏按钮结合使用。',
'input-macro-macro-label-label': '标签',
'input-macro-add-input-label': '新增输入 +',
'input-macro-type': {
press: '按下',
'hold-repeat': '按住重复',
toggle: '切换',
},
'macro-name': '宏名称',
'macro-activation-type': '宏的激活类型',
'macro-activation-type': '宏激活类型',
'table-thread-label': '标签',
'table-thread-type': '类型',
'table-thread-assigned-to': '分配到',
'table-thread-button': '按键',
'table-thread-actions': '动作',
'table-thread-status': '状态',
'input-macro-macro-trigger-type-button': '宏按钮',
'input-macro-macro-trigger-type-pin': '引脚',
};
6 changes: 3 additions & 3 deletions www/src/Locales/zh-CN/PeripheralMapping.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ export default {
'spi-desc-header': 'SPI Information',
'spi-description':
'SPI(Serial Peripheral Interface) 是一种四线接口,用于连接附件设备,如显示器、GPIO 扩展和传感器,通过 RX 和 TX 数据线,以及 SCK 线和 CS 线。RP2040 支持两个 SPI 控制器块:SPI0 和 SPI1。以下是每个块支持的 GPIO 引脚:',
'usb-label': 'USB Host',
'usb-desc-header': 'USB Host Information',
'usb-label': 'USB 主机',
'usb-desc-header': 'USB 主机信息',
'usb-description':
'USB Host 模式允许使用支持的 USB 客户端设备,例如键盘、游戏手柄或其他设备。',
'USB 主机模式允许使用支持的 USB 客户端设备,例如键盘、游戏手柄或其他设备。',
'peripheral-toggle-unavailable':
'无法启用。 外围设备 "{{name}}" 不可用。 请在 <0>外围设备映射</0> 页面中启用它。',
'pin-sda-label': 'SDA',
Expand Down
19 changes: 19 additions & 0 deletions www/src/Locales/zh-CN/PinMapping.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ export default {
'pin-viewer': '引脚查看器',
'pin-pressed': '按下的引脚:{{pressedPin}}',
'pin-header-label': '引脚',
'profile-text-1': '基础(档案 1)',
'profile-text-2': '档案 2',
'profile-text-3': '档案 3',
'profile-text-4': '档案 4',
'profile-pin-mapping-title-base': '基础(档案 1) - 引脚映射',
'profile-pin-mapping-title': '档案 {{profileNumber}} - 引脚映射',
'profile-pins-warning':
'尽量避免修改已设置为切换档案快捷键的按键或方向键,否则之后将很难理解你选择的档案配置!',
'profile-copy-base': '复制基础档案',
Expand Down Expand Up @@ -59,5 +65,18 @@ export default {
BUTTON_PRESS_MACRO_4: '宏 4',
BUTTON_PRESS_MACRO_5: '宏 5',
BUTTON_PRESS_MACRO_6: '宏 6',
CUSTOM_BUTTON_COMBO: '分配给多重映射',
BUTTON_PRESS_E1: '附加键 1',
BUTTON_PRESS_E2: '附加键 2',
BUTTON_PRESS_E3: '附加键 3',
BUTTON_PRESS_E4: '附加键 4',
BUTTON_PRESS_E5: '附加键 5',
BUTTON_PRESS_E6: '附加键 6',
BUTTON_PRESS_E7: '附加键 7',
BUTTON_PRESS_E8: '附加键 8',
BUTTON_PRESS_E9: '附加键 9',
BUTTON_PRESS_E10: '附加键 10',
BUTTON_PRESS_E11: '附加键 11',
BUTTON_PRESS_E12: '附加键 12',
},
};
17 changes: 14 additions & 3 deletions www/src/Locales/zh-CN/SettingsPage.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export default {
'auth-settings-label': '认证设置',
'no-mode-settings-text': '没有与 {{mode}} 模式相关的设置项目。',
'settings-header-text': '输入模式设置',
'gamepad-settings-header-text': '游戏控制器设置',
'input-mode-label': '输入模式',
Expand All @@ -9,7 +10,8 @@ export default {
none: '模式未选择',
xinput: 'XInput',
'nintendo-switch': 'Nintendo Switch',
ps3: 'PS3/DirectInput',
ps3: 'PS3',
generic: '通用 HID 设备',
keyboard: '键盘',
ps4: 'PS4',
ps5: 'PS5',
Expand All @@ -26,15 +28,15 @@ export default {
primary: '主要输入模式',
mini: '迷你/经典主机模式',
},
'boot-input-mode-label': '引导输入模式',
'boot-input-mode-label': '输入模式引导',
'ps4-mode-options': {
controller: '游戏控制器',
arcadestick: '街机摇杆',
},
'input-mode-authentication': {
none: '无',
key: '上传的密钥文件',
usb: 'Host USB',
usb: 'USB 主机',
i2c: '集成的 I2C',
},
'd-pad-mode-label': '方向模式',
Expand All @@ -55,6 +57,13 @@ export default {
},
'profile-number-label': '档案编号',
'debounce-delay-label': '去抖动延迟 (以毫秒为单位)',
'ps4-mode-explanation-text': 'PS4 模式允许 GP2040-CE 作为经过认证的 PS4 控制器运行。',
'ps4-mode-warning-text': '<span>⏳ 警告 ⏳:</span>在没有认证的情况下 PS4 将在 8 分钟后超时并断开连接。',
'ps4-usb-host-mode-text': '<span>补充信息:</span>请确保已启用 USB 外围设备,并已插入兼容 PS4 的 USB 设备。',
'ps5-mode-explanation-text': 'PS5 模式允许 GP2040-CE 作为经过认证的 PS5 兼容街机摇杆运行。',
'ps5-mode-warning-text': '<span>⏳ 警告 ⏳:</span>在没有认证的情况下 PS5 将在 8 分钟后超时并断开连接。',
'ps5-usb-host-mode-text': '<span>补充信息:</span>请确保已启用 USB 外围设备,并已插入兼容 PS5 的 USB 设备。',
'xbone-mode-text': '<span>补充信息:</span>Xbox One 模式需要 USB 主机(USB Host)连接和 USB 加密狗才能正确认证。',
'hotkey-settings-label': '快捷键设置',
'hotkey-settings-sub-header':
'<strong>Fn</strong> 组合映射在<link_pinmap>引脚映射</link_pinmap>页面提供了一个可映射的Function按键。 要选择 <strong>Fn</strong> 组合映射选项,请同时按住 Function 按键和其他快捷键。<br />此外, 可从下拉列表中选择 <strong>None</strong> 以取消分配按钮',
Expand Down Expand Up @@ -89,6 +98,8 @@ export default {
's2-button': 'S2 键',
'a1-button': 'A1 键',
'a2-button': 'A2 键',
'a3-button': 'A3 键',
'a4-button': 'A4 键',
'touchpad-button': '触摸板',
'load-profile-1': '加载 档案 #1',
'load-profile-2': '加载 档案 #2',
Expand Down
20 changes: 10 additions & 10 deletions www/src/Pages/InputMacroAddonPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ export default function MacrosPage() {
<Nav.Item key={`pills-item-${i}`}>
<Nav.Link eventKey={`macro-${i}`}>
{macro.macroLabel.length == 0
? `Macro ${i + 1}`
? t('InputMacroAddon:input-macro-macro-list-txt', { macroNumber: i + 1 })
: macro.macroLabel.length > 24
? macro.macroLabel.substr(0, 24) + '...'
: macro.macroLabel}
Expand All @@ -590,12 +590,12 @@ export default function MacrosPage() {
<thead>
<tr>
<th>#</th>
<th>Label</th>
<th>Type</th>
<th>Assigned To</th>
<th>Button</th>
<th>Actions</th>
<th>Status</th>
<th>{t('InputMacroAddon:table-thread-label')}</th>
<th>{t('InputMacroAddon:table-thread-type')}</th>
<th>{t('InputMacroAddon:table-thread-assigned-to')}</th>
<th>{t('InputMacroAddon:table-thread-button')}</th>
<th>{t('InputMacroAddon:table-thread-actions')}</th>
<th>{t('InputMacroAddon:table-thread-status')}</th>
</tr>
</thead>
<tbody>
Expand All @@ -619,8 +619,8 @@ export default function MacrosPage() {
</td>
<td>
{macro.useMacroTriggerButton == 1
? 'Button'
: 'Pin'}
? t('InputMacroAddon:input-macro-macro-trigger-type-button')
: t('InputMacroAddon:input-macro-macro-trigger-type-pin')}
</td>
{macro.useMacroTriggerButton == 0 ? (
<td>
Expand Down Expand Up @@ -701,7 +701,7 @@ export default function MacrosPage() {
key={`macro-list-tab-pane-${i}`}
eventKey={`macro-${i}`}
>
<Section title={`Macro ${i + 1}`}>
<Section title={t('InputMacroAddon:input-macro-macro-list-txt', { macroNumber: i + 1 })}>
<MacroComponent
key={`macroList[${i}]`}
id={`macroList[${i}]`}
Expand Down
12 changes: 6 additions & 6 deletions www/src/Pages/PinMapping.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -282,16 +282,16 @@ export default function PinMapping() {
<Col sm={2}>
<Nav variant="pills" className="flex-column">
<Nav.Item>
<Nav.Link eventKey="profile-1">Base(Profile 1)</Nav.Link>
<Nav.Link eventKey="profile-1">{t('PinMapping:profile-text-1')}</Nav.Link>
</Nav.Item>
<Nav.Item>
<Nav.Link eventKey="profile-2">Profile 2</Nav.Link>
<Nav.Link eventKey="profile-2">{t('PinMapping:profile-text-2')}</Nav.Link>
</Nav.Item>
<Nav.Item>
<Nav.Link eventKey="profile-3">Profile 3</Nav.Link>
<Nav.Link eventKey="profile-3">{t('PinMapping:profile-text-3')}</Nav.Link>
</Nav.Item>
<Nav.Item>
<Nav.Link eventKey="profile-4">Profile 4</Nav.Link>
<Nav.Link eventKey="profile-4">{t('PinMapping:profile-text-4')}</Nav.Link>
</Nav.Item>
</Nav>
<hr />
Expand All @@ -313,7 +313,7 @@ export default function PinMapping() {
<Tab.Content>
<Tab.Pane eventKey="profile-1">
<PinSection
sectionTitle={`Base(Profile 1) - Pin Mapping`}
sectionTitle={t('PinMapping:profile-pin-mapping-title-base')}
pins={pins}
setHandler={setPin}
saveHandler={savePins}
Expand All @@ -326,7 +326,7 @@ export default function PinMapping() {
eventKey={`profile-${profileIndex + 2}`}
>
<PinSection
sectionTitle={`Profile ${profileIndex + 2} - Pin Mapping`}
sectionTitle={t('PinMapping:profile-pin-mapping-title', { profileNumber: profileIndex + 2 })}
pins={profilePins}
saveHandler={saveProfiles}
setHandler={(pin, maskPayload) =>
Expand Down