Skip to content

Commit 7974593

Browse files
authored
fix(app): translate continue button in network (#17528)
The continue button "continue" text in various network settings panels needs to come from the shared i18n source, which is where it is, not the device_settings i18n source, which is where it isn't. By knowing where continue isn't, we know where continue is, and by subtracting where continue isn't from where continue is we know where continue should be, and by making where continue should be go from where continue isn't to where continue is, eventually we end up where continue is. ## testing - put this odd on a robot - from the settings screen, connect to wifi and check that continue is localized. This should now happen in the "join other network" screen and in the "select authentication type" screen - from the first-run experience, try to connect via ethernet while an ethernet cable is unplugged and note that "no data" is now localized - from the first-run experience, try to connect via wifi and note that the same things are now localized as in the setup screen Closes RQA-3960
1 parent 0a33a67 commit 7974593

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

app/src/organisms/ODD/RobotSettingsDashboard/NetworkSettings/RobotSettingsJoinOtherNetwork.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export function RobotSettingsJoinOtherNetwork({
2121
setCurrentOption,
2222
setSelectedSsid,
2323
}: RobotSettingsJoinOtherNetworkProps): JSX.Element {
24-
const { i18n, t } = useTranslation('device_settings')
24+
const { i18n, t } = useTranslation(['device_settings', 'shared'])
2525

2626
const [inputSsid, setInputSsid] = useState<string>('')
2727
const [errorMessage, setErrorMessage] = useState<string | null>(null)
@@ -38,7 +38,7 @@ export function RobotSettingsJoinOtherNetwork({
3838
return (
3939
<Flex flexDirection={DIRECTION_COLUMN}>
4040
<ChildNavigation
41-
buttonText={i18n.format(t('continue'), 'capitalize')}
41+
buttonText={i18n.format(t('shared:continue'), 'capitalize')}
4242
header={t('join_other_network')}
4343
onClickBack={() => {
4444
setCurrentOption('RobotSettingsWifi')

app/src/organisms/ODD/RobotSettingsDashboard/NetworkSettings/RobotSettingsSelectAuthenticationType.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ export function RobotSettingsSelectAuthenticationType({
2525
setCurrentOption,
2626
setSelectedAuthType,
2727
}: RobotSettingsSelectAuthenticationTypeProps): JSX.Element {
28-
const { i18n, t } = useTranslation('device_settings')
28+
const { i18n, t } = useTranslation(['device_settings', 'shared'])
2929

3030
return (
3131
<Flex flexDirection={DIRECTION_COLUMN}>
3232
<ChildNavigation
33-
buttonText={i18n.format(t('continue'), 'capitalize')}
33+
buttonText={i18n.format(t('shared:continue'), 'capitalize')}
3434
header={t('select_a_security_type')}
3535
onClickBack={() => {
3636
setCurrentOption('RobotSettingsWifi')

app/src/pages/ODD/ConnectViaEthernet/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import type { State, Dispatch } from '/app/redux/types'
2121
const STATUS_REFRESH_MS = 5000
2222

2323
export function ConnectViaEthernet(): JSX.Element {
24-
const { t } = useTranslation('device_settings')
24+
const { t } = useTranslation(['device_settings', 'shared'])
2525
const localRobot = useSelector(getLocalRobot)
2626
const robotName = localRobot?.name != null ? localRobot.name : 'no name'
2727
const dispatch = useDispatch<Dispatch>()

app/src/pages/ODD/ConnectViaWifi/JoinOtherNetwork.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export function JoinOtherNetwork({
1818
setCurrentOption,
1919
setSelectedSsid,
2020
}: JoinOtherNetworkProps): JSX.Element {
21-
const { i18n, t } = useTranslation('device_settings')
21+
const { i18n, t } = useTranslation(['device_settings', 'shared'])
2222

2323
const [inputSsid, setInputSsid] = useState<string>('')
2424
const [errorMessage, setErrorMessage] = useState<string | null>(null)
@@ -35,7 +35,7 @@ export function JoinOtherNetwork({
3535
return (
3636
<Flex flexDirection={DIRECTION_COLUMN}>
3737
<RobotSetupHeader
38-
buttonText={i18n.format(t('continue'), 'capitalize')}
38+
buttonText={i18n.format(t('shared:continue'), 'capitalize')}
3939
header={t('join_other_network')}
4040
onClickBack={() => {
4141
setCurrentOption('WifiList')

app/src/pages/ODD/ConnectViaWifi/SelectAuthenticationType.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ export function SelectAuthenticationType({
2121
setCurrentOption,
2222
setSelectedAuthType,
2323
}: SelectAuthenticationTypeProps): JSX.Element {
24-
const { i18n, t } = useTranslation('device_settings')
24+
const { i18n, t } = useTranslation(['device_settings', 'shared'])
2525

2626
return (
2727
<Flex flexDirection={DIRECTION_COLUMN}>
2828
<RobotSetupHeader
29-
buttonText={i18n.format(t('continue'), 'capitalize')}
29+
buttonText={i18n.format(t('shared:continue'), 'capitalize')}
3030
header={t('select_a_security_type')}
3131
onClickBack={() => {
3232
setCurrentOption('WifiList')

0 commit comments

Comments
 (0)