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

refactor(app): add any found hardcoded copy to i18n for translation #17095

Merged
merged 3 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
22 changes: 12 additions & 10 deletions app/src/App/DesktopApp.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { useState, Fragment } from 'react'
import { useTranslation } from 'react-i18next'
import { Navigate, Route, Routes, useMatch } from 'react-router-dom'
import { ErrorBoundary } from 'react-error-boundary'

Expand Down Expand Up @@ -43,6 +44,7 @@ import { ReactQueryDevtools } from './tools'
import type { RouteProps } from './types'

export const DesktopApp = (): JSX.Element => {
const { t } = useTranslation('top_navigation')
useSoftwareUpdatePoll()
const [
isEmergencyStopModalDismissed,
Expand All @@ -52,55 +54,55 @@ export const DesktopApp = (): JSX.Element => {
const desktopRoutes: RouteProps[] = [
{
Component: ProtocolsLanding,
name: 'protocols',
name: t('protocols'),
navLinkTo: '/protocols',
path: '/protocols',
},
{
Component: ProtocolDetails,
name: 'Protocol Details',
name: t('protocol_details'),
path: '/protocols/:protocolKey',
},
{
Component: ProtocolTimeline,
name: 'Protocol Timeline',
name: t('protocol_timeline'),
path: '/protocols/:protocolKey/timeline',
},
{
Component: Labware,
name: 'labware',
name: t('labware'),
navLinkTo: '/labware',
path: '/labware',
},
{
Component: DevicesLanding,
name: 'devices',
name: t('devices'),
navLinkTo: '/devices',
path: '/devices',
},
{
Component: DeviceDetails,
name: 'Device',
name: t('device'),
path: '/devices/:robotName',
},
{
Component: RobotSettings,
name: 'Robot Settings',
name: t('robot_settings'),
path: '/devices/:robotName/robot-settings/:robotSettingsTab?',
},
{
Component: CalibrationDashboard,
name: 'Calibration Dashboard',
name: t('calibration_dashboard'),
path: '/devices/:robotName/robot-settings/calibration/dashboard',
},
{
Component: ProtocolRunDetails,
name: 'Run Details',
name: t('run_details'),
path: '/devices/:robotName/protocol-runs/:runId/:protocolRunDetailsTab?',
},
{
Component: AppSettings,
name: 'App Settings',
name: t('app_settings'),
path: '/app-settings/:appSettingsTab?',
},
]
Expand Down
5 changes: 1 addition & 4 deletions app/src/App/Navbar.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { useCallback } from 'react'
import { useTranslation } from 'react-i18next'
import { NavLink, useNavigate } from 'react-router-dom'
import styled from 'styled-components'
import debounce from 'lodash/debounce'
Expand Down Expand Up @@ -111,8 +110,6 @@ const LogoImg = styled('img')`
`

export function Navbar({ routes }: { routes: RouteProps[] }): JSX.Element {
const { t } = useTranslation('top_navigation')

const navigate = useNavigate()
const navRoutes = routes.filter(
({ navLinkTo }: RouteProps) => navLinkTo != null
Expand Down Expand Up @@ -151,7 +148,7 @@ export function Navbar({ routes }: { routes: RouteProps[] }): JSX.Element {
as="h3"
margin={`${SPACING.spacing8} 0 ${SPACING.spacing8} ${SPACING.spacing12}`}
>
{t(name)}
{name}
</LegacyStyledText>
</NavbarLink>
))}
Expand Down
7 changes: 7 additions & 0 deletions app/src/assets/localization/en/app_settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@
"connect_ip_link": "Learn more about connecting a robot manually",
"discovery_timeout": "Discovery timed out.",
"dont_change": "Don’t change",
"dont_remind_me": "Don't remind me again",
"download_update": "Downloading update...",
"driver_out_of_date": "Realtek USB-to-Ethernet Driver Update Available",
"enable_dev_tools": "Developer Tools",
"enable_dev_tools_description": "Enabling this setting opens Developer Tools on app launch, enables additional logging and gives access to feature flags.",
"error_boundary_desktop_app_description": "You need to reload the app. Contact support with the following error message:",
Expand All @@ -45,6 +47,7 @@
"error_recovery_mode_description": "Pause on protocol errors instead of canceling the run.",
"feature_flags": "Feature Flags",
"general": "General",
"get_update": "get update",
"heater_shaker_attach_description": "Display a reminder to attach the Heater-Shaker properly before running a test shake or using it in a protocol.",
"heater_shaker_attach_visible": "Confirm Heater-Shaker Module Attachment",
"how_to_restore": "How to Restore a Previous Software Version",
Expand All @@ -65,6 +68,7 @@
"ot2_advanced_settings": "OT-2 Advanced Settings",
"override_path": "override path",
"override_path_to_python": "Override Path to Python",
"please_update_driver": "Please update your computer's driver to ensure a reliable connection to your OT-2.",
"prevent_robot_caching": "Prevent Robot Caching",
"prevent_robot_caching_description": "The app <strong>will immediately clear unavailable robots</strong> and will not remember unavailable robots while this is enabled. On networks with many robots, preventing caching may improve network performance at the expense of slower and less reliable robot discovery on app launch.",
"privacy": "Privacy",
Expand Down Expand Up @@ -93,6 +97,8 @@
"trash_bin": "Always use trash bin to calibrate",
"try_restarting_the_update": "Try restarting the update.",
"turn_off_updates": "Turn off software update notifications in App Settings.",
"u2e_driver_description": "The OT-2 uses this adapter for its USB connection to the Opentrons App.",
"u2e_driver_outdated_message": "There is an updated Realtek USB-to-Ethernet adapter driver available for your computer.",
"up_to_date": "Up to date",
"update_alerts": "Software Update Alerts",
"update_app_now": "Update app now",
Expand All @@ -112,5 +118,6 @@
"usb_to_ethernet_unknown_product": "Unknown Adapter",
"use_system_language": "Use system language",
"view_software_update": "View software update",
"view_adapter_info": "view adapter info",
"view_update": "View Update"
}
39 changes: 39 additions & 0 deletions app/src/assets/localization/en/device_settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,20 @@
"about_calibration_description": "For the robot to move accurately and precisely, you need to calibrate it. Positional calibration happens in three parts: deck calibration, pipette offset calibration and tip length calibration.",
"about_calibration_description_ot3": "<block>For the robot to move accurately and precisely, you need to calibrate it. Pipette and gripper calibration is an automated process that uses a calibration probe or pin.</block><block>After calibration is complete, you can save the calibration data to your computer as a JSON file.</block>",
"about_calibration_title": "About Calibration",
"add_new": "Add new...",
"advanced": "Advanced",
"alpha_description": "Warning: alpha releases are feature-complete but may contain significant bugs.",
"alternative_security_types": "Alternative security types",
"app_change_in": "App Changes in {{version}}",
"apply_historic_offsets": "Apply Labware Offsets",
"are_you_sure_you_want_to_disconnect": "Are you sure you want to disconnect from {{ssid}}?",
"attach_a_pipette_before_calibrating": "Attach a pipette in order to perform calibration",
"authentication": "Authentication",
"boot_scripts": "Boot scripts",
"both": "Both",
"browse_file_system": "Browse file system",
"bug_fixes": "Bug Fixes",
"but_we_expected": "but we expected",
"calibrate_deck": "Calibrate deck",
"calibrate_deck_description": "For pre-2019 robots that do not have crosses etched on the deck.",
"calibrate_deck_to_dots": "Calibrate deck to dots",
Expand All @@ -28,8 +31,10 @@
"change_network": "Change network",
"characters_max": "17 characters max",
"check_for_updates": "Check for updates",
"check_to_verify_update": "Check your robot's settings page to verify whether or not the update was successful",
"checking_for_updates": "Checking for updates",
"choose": "Choose...",
"choose_a_network": "Choose a network...",
"choose_file": "Choose file",
"choose_network_type": "Choose network type",
"choose_reset_settings": "Choose reset settings",
Expand All @@ -56,7 +61,9 @@
"confirm_device_reset_heading": "Are you sure you want to reset your device?",
"connect": "Connect",
"connect_the_estop_to_continue": "Connect the E-stop to continue",
"connect_to_ssid": "Connect to {{ssid}}",
"connect_to_wifi_network": "Connect to Wi-Fi network",
"connect_to_wifi_network_failure": "Your robot was unable to connect to Wi-Fi network {{ssid}}",
"connect_via": "Connect via {{type}}",
"connect_via_usb_description_1": "1. Connect the USB A-to-B cable to the robot’s USB-B port.",
"connect_via_usb_description_2": "2. Connect the cable to an open USB port on your computer.",
Expand All @@ -65,6 +72,7 @@
"connected_to_ssid": "Connected to {{ssid}}",
"connected_via": "Connected via {{networkInterface}}",
"connecting_to": "Connecting to {{ssid}}...",
"connecting_to_wifi_network": "Connecting to Wi-Fi network {{ssid}}",
"connection_description_ethernet": "Connect to your lab's wired network.",
"connection_description_wifi": "Find a network in your lab or enter your own.",
"connection_to_robot_lost": "Connection to robot lost",
Expand Down Expand Up @@ -96,6 +104,7 @@
"display_sleep_settings": "Display Sleep Settings",
"do_not_turn_off": "This could take up to {{minutes}} minutes. Don't turn off the robot.",
"done": "Done",
"downgrade": "downgrade",
"download": "Download",
"download_calibration_data": "Download calibration logs",
"download_error": "Download error",
Expand All @@ -109,6 +118,7 @@
"enable_status_light_description": "Turn on or off the strip of color LEDs on the front of the robot.",
"engaged": "Engaged",
"enter_factory_password": "Enter factory password",
"enter_name_security_type": "Enter the network name and security type.",
"enter_network_name": "Enter network name",
"enter_password": "Enter password",
"estop": "E-stop",
Expand All @@ -127,6 +137,8 @@
"factory_resets_cannot_be_undone": "Factory resets cannot be undone.",
"failed_to_connect_to_ssid": "Failed to connect to {{ssid}}",
"feature_flags": "Feature Flags",
"field_is_required": "{{field}} is required",
"find_and_join_network": "Find and join a Wi-Fi network",
"finish_setup": "Finish setup",
"firmware_version": "Firmware Version",
"fully_calibrate_before_checking_health": "Fully calibrate your robot before checking calibration health",
Expand Down Expand Up @@ -154,6 +166,7 @@
"last_calibrated_label": "Last Calibrated",
"launch_jupyter_notebook": "Launch Jupyter Notebook",
"legacy_settings": "Legacy Settings",
"likely_incorrect_password": "Likely incorrect network password.",
"mac_address": "MAC Address",
"manage_oem_settings": "Manage OEM settings",
"minutes": "{{minute}} minutes",
Expand All @@ -171,7 +184,10 @@
"name_your_robot": "Name your robot",
"name_your_robot_description": "Don’t worry, you can always change this in your settings.",
"need_another_security_type": "Need another security type?",
"network_is_unsecured": "Wi-Fi network {{ssid}} is unsecured",
"network_name": "Network Name",
"network_requires_auth": "Wi-Fi network {{ssid}} requires 802.1X authentication",
"network_requires_wpa_password": "Wi-Fi network {{ssid}} requires a WPA2 password",
"network_settings": "Network Settings",
"networking": "Networking",
"never": "Never",
Expand All @@ -183,6 +199,7 @@
"no_modules_attached": "No modules attached",
"no_network_found": "No network found",
"no_pipette_attached": "No pipette attached",
"no_update_files": "Unable to retrieve update for this robot. Ensure your computer is connected to the internet and try again later.",
"none_description": "Not recommended",
"not_calibrated": "Not calibrated yet",
"not_calibrated_short": "Not calibrated",
Expand All @@ -197,8 +214,10 @@
"on": "On",
"one_hour": "1 hour",
"other_networks": "Other Networks",
"other_robot_updating": "Unable to update because the app is currently updating a different robot.",
"password": "Password",
"password_error_message": "Must be at least 8 characters",
"password_not_long_enough": "Password must be at least {{minLength}} characters",
"pause_protocol": "Pause protocol when robot door opens",
"pause_protocol_description": "When enabled, opening the robot door during a run will pause the robot after it has completed its current motion.",
"pipette_calibrations_description": "Pipette calibration uses a metal probe to determine the pipette's exact position relative to precision-cut squares on deck slots.",
Expand All @@ -208,6 +227,7 @@
"pipette_offset_calibration_recommended": "Pipette Offset calibration recommended",
"pipette_offset_calibrations_history": "See all Pipette Offset Calibration history",
"pipette_offset_calibrations_title": "Pipette Offset Calibrations",
"please_check_credentials": "Please double-check your network credentials",
"privacy": "Privacy",
"problem_during_update": "This update is taking longer than usual.",
"proceed_without_updating": "Proceed without update",
Expand Down Expand Up @@ -238,9 +258,12 @@
"returns_your_device_to_new_state": "This returns your device to a new state.",
"robot_busy_protocol": "This robot cannot be updated while a protocol is running on it",
"robot_calibration_data": "Robot Calibration Data",
"robot_has_bad_capabilities": "Robot has incorrect capabilities shape",
"robot_initializing": "Initializing robot...",
"robot_name": "Robot Name",
"robot_operating_update_available": "Robot Operating System Update Available",
"robot_reconnected_with version": "Robot reconnected with version",
"robot_requires_premigration": "This robot must be updated by the system before a custom update can occur",
"robot_serial_number": "Robot Serial Number",
"robot_server_version": "Robot Server Version",
"robot_settings": "Robot Settings",
Expand All @@ -259,7 +282,9 @@
"select_a_network": "Select a network",
"select_a_security_type": "Select a security type",
"select_all_settings": "Select all settings",
"select_auth_method_short": "Select authentication method",
"select_authentication_method": "Select authentication method for your selected network.",
"select_file": "Select file",
"sending_software": "Sending software...",
"serial": "Serial",
"setup_mode": "Setup mode",
Expand All @@ -275,6 +300,9 @@
"subnet_mask": "Subnet Mask",
"successfully_connected": "Successfully connected!",
"successfully_connected_to_network": "Successfully connected to {{ssid}}!",
"successfully_connected_to_ssid": "Your robot has successfully connected to Wi-Fi network {{ssid}}",
"successfully_connected_to_wifi": "Successfully connected to Wi-Fi",
"successfully_disconnected_from_wifi": "Successfully disconnected from Wi-Fi",
"supported_protocol_api_versions": "Supported Protocol API Versions",
"text_size": "Text Size",
"text_size_description": "Text on all screens will adjust to the size you choose below.",
Expand All @@ -286,6 +314,14 @@
"troubleshooting": "Troubleshooting",
"try_again": "Try again",
"try_restarting_the_update": "Try restarting the update.",
"unable_to_cancel_update": "Unable to cancel in-progress update session",
"unable_to_commit_update": "Unable to commit update",
"unable_to_connect": "Unable to connect to Wi-Fi",
"unable_to_disconnect": "Unable to disconnect from Wi-Fi",
"unable_to_find_system_file": "Unable to find system file for update",
"unable_to_find_robot_with_name": "Unable to find online robot with name",
"unable_to_restart": "Unable to restart robot",
"unable_to_start_update_session": "Unable to start update session",
"up_to_date": "up to date",
"update_available": "Update Available",
"update_channel_description": "Stable receives the latest stable releases. Beta allows you to try out new in-progress features before they launch in Stable channel, but they have not completed testing yet.",
Expand All @@ -294,7 +330,10 @@
"update_requires_restarting_robot": "Updating the robot software requires restarting the robot",
"update_robot_now": "Update robot now",
"update_robot_software": "Update robot software manually with a local file (.zip)",
"update_server_unavailable": "Unable to update because your robot's update server is not responding.",
"update_unavailable": "Update unavailable",
"updating": "Updating",
"upgrade": "upgrade",
"upload_custom_logo": "Upload custom logo",
"upload_custom_logo_description": "Upload a logo for the robot to display during boot up.",
"upload_custom_logo_dimensions": "The logo must fit within dimensions 1024 x 600 and be a PNG file (.png).",
Expand Down
2 changes: 0 additions & 2 deletions app/src/assets/localization/en/gripper_wizard_flows.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"before_you_begin": "Before you begin",
"begin_calibration": "Begin calibration",
"calibrate_gripper": "Calibrate Gripper",
"calibration_pin": "Calibration Pin",
"calibration_pin_touching": "The calibration pin will touch the calibration square in slot {{slot}} to determine its exact position.",
"complete_calibration": "Complete calibration",
"continue": "Continue",
Expand All @@ -17,7 +16,6 @@
"gripper_calibration": "Gripper Calibration",
"gripper_recalibration": "Gripper Recalibration",
"gripper_successfully_attached": "Gripper successfully attached",
"hex_screwdriver": "2.5 mm Hex Screwdriver",
"hold_gripper_and_loosen_screws": "Hold the gripper in place and loosen the top gripper screw first. After that move onto the bottom screw. (The screws are captive and will not come apart from the gripper.) Then carefully remove the gripper.",
"insert_pin_into_front_jaw": "Insert calibration pin in front jaw",
"insert_pin_into_rear_jaw": "Insert calibration pin in rear jaw",
Expand Down
1 change: 1 addition & 0 deletions app/src/assets/localization/en/pipette_wizard_flows.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
"pipette_heavy": "The 96-Channel Pipette is heavy ({{weight}}). Ask a labmate for help, if needed.",
"please_install_correct_pip": "Install {{pipetteName}} instead",
"progress_will_be_lost": "{{flow}} progress will be lost",
"provided_with_robot": "Provided with the robot. Using another size can strip the instruments’s screws.",
"reattach_carriage": "reattach z-axis carriage",
"recalibrate_pipette": "recalibrate {{mount}} pipette",
"remove_cal_probe": "remove calibration probe",
Expand Down
5 changes: 5 additions & 0 deletions app/src/assets/localization/en/protocol_command_text.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@
"adapter_in_mod_in_slot": "{{adapter}} on {{module}} in Slot {{slot}}",
"adapter_in_slot": "{{adapter}} in Slot {{slot}}",
"air_gap_in_place": "Air gapping {{volume}} µL",
"all_nozzles": "all nozzles",
"aspirate": "Aspirating {{volume}} µL from well {{well_name}} of {{labware}} in {{labware_location}} at {{flow_rate}} µL/sec",
"aspirate_in_place": "Aspirating {{volume}} µL in place at {{flow_rate}} µL/sec ",
"blowout": "Blowing out at well {{well_name}} of {{labware}} in {{labware_location}} at {{flow_rate}} µL/sec",
"blowout_in_place": "Blowing out in place at {{flow_rate}} µL/sec",
"closing_tc_lid": "Closing Thermocycler lid",
"column_layout": "column layout",
"comment": "Comment",
"configure_for_volume": "Configure {{pipette}} to aspirate {{volume}} µL",
"configure_nozzle_layout": "Configure {{pipette}} to use {{layout}}",
Expand Down Expand Up @@ -59,18 +61,21 @@
"opening_tc_lid": "Opening Thermocycler lid",
"pause": "Pause",
"pause_on": "Pause on {{robot_name}}",
"partial_layout": "partial layout",
"pickup_tip": "Picking up tip(s) from {{well_range}} of {{labware}} in {{labware_location}}",
"prepare_to_aspirate": "Preparing {{pipette}} to aspirate",
"reloading_labware": "Reloading {{labware}}",
"return_tip": "Returning tip to {{well_name}} of {{labware}} in {{labware_location}}",
"right": "Right",
"row_layout": "row layout",
"save_position": "Saving position",
"set_and_await_hs_shake": "Setting Heater-Shaker to shake at {{rpm}} rpm and waiting until reached",
"setting_hs_temp": "Setting Target Temperature of Heater-Shaker to {{temp}}",
"setting_temperature_module_temp": "Setting Temperature Module to {{temp}} (rounded to nearest integer)",
"setting_thermocycler_block_temp": "Setting Thermocycler block temperature to {{temp}} with hold time of {{hold_time_seconds}} seconds after target reached",
"setting_thermocycler_lid_temp": "Setting Thermocycler lid temperature to {{temp}}",
"single": "single",
"single_nozzle_layout": "single nozzle layout",
"slot": "Slot {{slot_name}}",
"target_temperature": "target temperature",
"tc_awaiting_for_duration": "Waiting for Thermocycler profile to complete",
Expand Down
Loading
Loading