Skip to content

Commit

Permalink
Add JP localization for new localization labels. (OpenStickCommunity#…
Browse files Browse the repository at this point in the history
…1093)

* Add JP Localization for PinMapping and InputMacroAddon.

run npm run format.

* Add JP Localization for new add-on.

run npm run format.

* fix discrepancy in naming
  • Loading branch information
mizma authored Jul 31, 2024
1 parent c309d35 commit d8c9da1
Show file tree
Hide file tree
Showing 13 changed files with 132 additions and 62 deletions.
6 changes: 5 additions & 1 deletion www/src/Addons/DRV8833.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ export const drv8833RumbleScheme = {
drv8833RumbleDutyMax: yup
.number()
.label('Maximum PWM Duty')
.validateRangeWhenValue('DRV8833RumbleAddonEnabled', yup.ref('drv8833RumbleDutyMin'), 100),
.validateRangeWhenValue(
'DRV8833RumbleAddonEnabled',
yup.ref('drv8833RumbleDutyMin'),
100,
),
};

export const drv8833RumbleState = {
Expand Down
16 changes: 8 additions & 8 deletions www/src/Locales/en/InputMacroAddon.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +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',
'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',
};
12 changes: 6 additions & 6 deletions www/src/Locales/en/PinMapping.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +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-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: 7 additions & 0 deletions www/src/Locales/ja-JP/AddonsConfig.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -155,4 +155,11 @@ export default {
'tilt-socd-mode-0': '上優先',
'tilt-socd-mode-1': 'ニュートラル',
'tilt-socd-mode-2': '後入力優先',
'drv8833-rumble-header-text': 'DRV8833 振動機能設定',
'drv8833-rumble-left-motor-pin-label': '左振動モーター端子',
'drv8833-rumble-right-motor-pin-label': '右振動モーター端子',
'drv8833-rumble-motor-sleep-pin-label': 'モータースリープ端子',
'drv8833-rumble-pwm-frequency-label': 'PWM 周波数',
'drv8833-rumble-duty-min-label': '最低デューティー比',
'drv8833-rumble-duty-max-label': '最大デューティー比',
};
10 changes: 9 additions & 1 deletion www/src/Locales/ja-JP/InputMacroAddon.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default {
'起動にマクロボタン+コントローラボタンを利用',
'input-macro-macro-button-pin-plus': 'ボタン割り当て:',
'input-macro-header-text': 'マクロ設定概要',
'input-macro-macro-list-txt': 'マクロ {{macroNumber}} 設定',
'input-macro-macro-list-txt': 'マクロ {{macroNumber}} 設定',
'input-macro-duration-label': '持続時間',
'input-macro-wait-duration-label': '待機時間',
'input-macro-time-label-ms': 'ミリ秒',
Expand All @@ -28,4 +28,12 @@ export default {
},
'macro-name': 'マクロ名',
'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: 6 additions & 0 deletions www/src/Locales/ja-JP/PinMapping.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ export default {
'未接続や未実装の端子を割当設定するとコントローラが動作しない状態に陥る可能性があります。無効な設定を初期化したい場合は<2>設定初期化</2>のページで初期化を実行してください。',
'pin-viewer': '端子確認',
'pin-pressed': 'このボタンの配線先は {{pressedPin}} 番端子です!',
'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}} - 端子割当',
'pin-header-label': '端子',
'profile-pins-warning':
'プロファイルの変更ホットキーに設定しているボタンや方向キーの設定変更は、現在のプロファイル選択状況がわからなくなる原因となるため非推奨です。',
Expand Down
2 changes: 1 addition & 1 deletion www/src/Locales/ja-JP/SettingsPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export default {
's2-button': 'S2 ボタン',
'a1-button': 'A1 ボタン',
'a2-button': 'A2 ボタン',
'a3-button': 'A3 ボタン',
'a3-button': 'A3 ボタン',
'a4-button': 'A4 ボタン',
'touchpad-button': 'タッチパッドボタン',
'load-profile-1': 'プロファイル #1をロード',
Expand Down
22 changes: 11 additions & 11 deletions www/src/Locales/zh-CN/InputMacroAddon.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export default {
'input-macro-board-led-enabled': '使用板载 LED 显示宏的状态',
'input-macro-macro-enabled': '启用',
'input-macro-macro-enabled-badge': '启用',
'input-macro-macro-enabled-badge': '启用',
'input-macro-macro-disabled-badge': '禁用',
'input-macro-macro-exclusive': '独占 (不能切换到另一个宏)',
'input-macro-macro-interruptible': '可打断 (用户输入可取消宏)',
Expand All @@ -14,24 +14,24 @@ export default {
'input-macro-wait-duration-label': '等待时间',
'input-macro-time-label-ms': '毫秒',
'input-macro-time-label-frames': '帧',
'input-macro-release-and-wait-label': '松开并等待 ',
'input-macro-release-and-wait-label': '松开并等待 ',
'input-macro-sub-header':
'注意:对于通过引脚映射的宏,请参见功能配置下的引脚映射页面。宏也可以分配给游戏手柄按钮,与相应的单个宏按钮结合使用。',
'input-macro-macro-label-label': '标签',
'input-macro-add-input-label': '新增输入 +',
'input-macro-add-input-label': '新增输入 +',
'input-macro-type': {
press: '按下',
'hold-repeat': '按住重复',
toggle: '切换',
},
'macro-name': '宏名称',
'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': '引脚',
'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': '引脚',
};
16 changes: 8 additions & 8 deletions www/src/Locales/zh-CN/PinMapping.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +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-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 @@ -65,8 +65,8 @@ export default {
BUTTON_PRESS_MACRO_4: '宏 4',
BUTTON_PRESS_MACRO_5: '宏 5',
BUTTON_PRESS_MACRO_6: '宏 6',
CUSTOM_BUTTON_COMBO: '分配给多重映射',
BUTTON_PRESS_E1: '附加键 1',
CUSTOM_BUTTON_COMBO: '分配给多重映射',
BUTTON_PRESS_E1: '附加键 1',
BUTTON_PRESS_E2: '附加键 2',
BUTTON_PRESS_E3: '附加键 3',
BUTTON_PRESS_E4: '附加键 4',
Expand Down
27 changes: 17 additions & 10 deletions www/src/Locales/zh-CN/SettingsPage.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export default {
'auth-settings-label': '认证设置',
'no-mode-settings-text': '没有与 {{mode}} 模式相关的设置项目。',
'no-mode-settings-text': '没有与 {{mode}} 模式相关的设置项目。',
'settings-header-text': '输入模式设置',
'gamepad-settings-header-text': '游戏控制器设置',
'input-mode-label': '输入模式',
Expand All @@ -11,7 +11,7 @@ export default {
xinput: 'XInput',
'nintendo-switch': 'Nintendo Switch',
ps3: 'PS3',
generic: '通用 HID 设备',
generic: '通用 HID 设备',
keyboard: '键盘',
ps4: 'PS4',
ps5: 'PS5',
Expand Down Expand Up @@ -57,13 +57,20 @@ 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 加密狗才能正确认证。',
'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 @@ -98,7 +105,7 @@ export default {
's2-button': 'S2 键',
'a1-button': 'A1 键',
'a2-button': 'A2 键',
'a3-button': 'A3 键',
'a3-button': 'A3 键',
'a4-button': 'A4 键',
'touchpad-button': '触摸板',
'load-profile-1': '加载 档案 #1',
Expand Down
5 changes: 4 additions & 1 deletion www/src/Pages/AddonsConfigPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ import InputHistory, {
} from '../Addons/InputHistory';
import Rotary, { rotaryScheme, rotaryState } from '../Addons/Rotary';
import PCF8575, { pcf8575Scheme, pcf8575State } from '../Addons/PCF8575';
import DRV8833Rumble, { drv8833RumbleScheme, drv8833RumbleState } from '../Addons/DRV8833';
import DRV8833Rumble, {
drv8833RumbleScheme,
drv8833RumbleState,
} from '../Addons/DRV8833';

const schema = yup.object().shape({
...analogScheme,
Expand Down
45 changes: 35 additions & 10 deletions www/src/Pages/InputMacroAddonPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,9 @@ export default function MacrosPage() {
<Nav.Item key={`pills-item-${i}`}>
<Nav.Link eventKey={`macro-${i}`}>
{macro.macroLabel.length == 0
? t('InputMacroAddon:input-macro-macro-list-txt', { macroNumber: 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 +592,26 @@ export default function MacrosPage() {
<thead>
<tr>
<th>#</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>
<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 +635,12 @@ export default function MacrosPage() {
</td>
<td>
{macro.useMacroTriggerButton == 1
? t('InputMacroAddon:input-macro-macro-trigger-type-button')
: t('InputMacroAddon:input-macro-macro-trigger-type-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 +721,12 @@ export default function MacrosPage() {
key={`macro-list-tab-pane-${i}`}
eventKey={`macro-${i}`}
>
<Section title={t('InputMacroAddon:input-macro-macro-list-txt', { macroNumber: i + 1 })}>
<Section
title={t(
'InputMacroAddon:input-macro-macro-list-txt',
{ macroNumber: i + 1 },
)}
>
<MacroComponent
key={`macroList[${i}]`}
id={`macroList[${i}]`}
Expand Down
20 changes: 15 additions & 5 deletions www/src/Pages/PinMapping.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -282,16 +282,24 @@ export default function PinMapping() {
<Col sm={2}>
<Nav variant="pills" className="flex-column">
<Nav.Item>
<Nav.Link eventKey="profile-1">{t('PinMapping:profile-text-1')}</Nav.Link>
<Nav.Link eventKey="profile-1">
{t('PinMapping:profile-text-1')}
</Nav.Link>
</Nav.Item>
<Nav.Item>
<Nav.Link eventKey="profile-2">{t('PinMapping:profile-text-2')}</Nav.Link>
<Nav.Link eventKey="profile-2">
{t('PinMapping:profile-text-2')}
</Nav.Link>
</Nav.Item>
<Nav.Item>
<Nav.Link eventKey="profile-3">{t('PinMapping:profile-text-3')}</Nav.Link>
<Nav.Link eventKey="profile-3">
{t('PinMapping:profile-text-3')}
</Nav.Link>
</Nav.Item>
<Nav.Item>
<Nav.Link eventKey="profile-4">{t('PinMapping:profile-text-4')}</Nav.Link>
<Nav.Link eventKey="profile-4">
{t('PinMapping:profile-text-4')}
</Nav.Link>
</Nav.Item>
</Nav>
<hr />
Expand Down Expand Up @@ -326,7 +334,9 @@ export default function PinMapping() {
eventKey={`profile-${profileIndex + 2}`}
>
<PinSection
sectionTitle={t('PinMapping:profile-pin-mapping-title', { profileNumber: profileIndex + 2 })}
sectionTitle={t('PinMapping:profile-pin-mapping-title', {
profileNumber: profileIndex + 2,
})}
pins={profilePins}
saveHandler={saveProfiles}
setHandler={(pin, maskPayload) =>
Expand Down

0 comments on commit d8c9da1

Please sign in to comment.