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

feat(app): add localization feature flag #16341

Merged
merged 8 commits into from
Sep 30, 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
6 changes: 3 additions & 3 deletions app/src/App/DesktopApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export const DesktopApp = (): JSX.Element => {
const desktopRoutes: RouteProps[] = [
{
Component: ProtocolsLanding,
name: 'Protocols',
name: 'protocols',
navLinkTo: '/protocols',
path: '/protocols',
},
Expand All @@ -67,13 +67,13 @@ export const DesktopApp = (): JSX.Element => {
},
{
Component: Labware,
name: 'Labware',
name: 'labware',
navLinkTo: '/labware',
path: '/labware',
},
{
Component: DevicesLanding,
name: 'Devices',
name: 'devices',
navLinkTo: '/devices',
path: '/devices',
},
Expand Down
5 changes: 4 additions & 1 deletion app/src/App/Navbar.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as React 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 @@ -110,6 +111,8 @@ 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 @@ -148,7 +151,7 @@ export function Navbar({ routes }: { routes: RouteProps[] }): JSX.Element {
as="h3"
margin={`${SPACING.spacing8} 0 ${SPACING.spacing8} ${SPACING.spacing12}`}
>
{name}
{t(name)}
</LegacyStyledText>
</NavbarLink>
))}
Expand Down
1 change: 1 addition & 0 deletions app/src/assets/localization/en/app_settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"__dev_internal__protocolTimeline": "Protocol Timeline",
"__dev_internal__enableRunNotes": "Display Notes During a Protocol Run",
"__dev_internal__enableLabwareCreator": "Enable App Labware Creator",
"__dev_internal__enableLocalization": "Enable App Localization",
"add_folder_button": "Add labware source folder",
"add_ip_button": "Add",
"add_ip_error": "Enter an IP Address or Hostname",
Expand Down
2 changes: 2 additions & 0 deletions app/src/assets/localization/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { en } from './en'
import { zh } from './zh'

export const resources = {
en,
zh,
}
74 changes: 74 additions & 0 deletions app/src/assets/localization/zh/anonymous.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
{
"a_robot_software_update_is_available": "需要更新工作站软件版本才能使用该版本的桌面应用程序运行协议。<robotLink>转到工作站</robotLink]",
"about_flex_gripper": "关于转板抓手",
"alternative_security_types_description": "工作站支持连接到各种企业接入点。通过USB连接并在桌面应用程序中完成设置。",
"calibration_block_description": "<block>这个金属块是一个特制的工具,完美适配您的甲板,有助于校准。</block><block>如果您没有校准块,请发送电子邮件给支持团队,以便我们寄送一个给您。在您提供的信息中,请确保包括您的姓名、公司或机构名称和寄送地址。在等待校准块到达过程中,您可以暂时利用工作站里垃圾桶上的平面进行校准。</block>",
"calibration_on_opentrons_tips_is_important": "使用上述吸头和吸头盒进行校准非常重要,因为工作站的准确性是基于这些吸头的已知尺寸来确定的。",
"choose_what_data_to_share": "选择要共享的工作站数据。",
"computer_in_app_is_controlling_robot": "当前正在由一台已联网的计算机控制此工作站。",
"confirm_terminate": "这将立即停止计算机上进行的活动。您或其他用户可能会丢失进度或在该计算机上出现报错提示。",
"connect_and_screw_in_gripper": "连接并固定转板抓手",
"connect_via_usb_description_3": "3. 在连接的计算机上启动工作站应用程序以继续。",
"connection_description_usb": "直接连接到计算机。",
"connection_lost_description": "应用程序现在无法与此工作站通信。请检查与工作站的USB或Wi-Fi连接,然后尝试重新连接。",
"contact_information": "请与支持人员联系以获得帮助。",
"contact_support_for_connection_help": "如果以上方法都无法解决问题,请联系支持人员寻求帮助(通过此应用程序中的问号链接,或发送电子邮件至{{support_email}}。)",
"deck_fixture_setup_modal_bottom_description": "有关安装不同类型固定装置的详细信息,请与支持人员联系。",
"delete_protocol_from_app": "删除协议,针对错误进行修改,然后从桌面应用程序将协议重新发送到此工作站。",
"error_boundary_description": "您需要重新启动触摸屏。联系支持人员以获取帮助。",
"estop_pressed_description": "首先,安全清理甲板上的任何实验耗材和洒出的液体。然后,顺时针旋转急停开关。最后,让工作站将龙门架移动到其原位。",
"find_your_robot": "在应用程序的“设备”栏找到您的工作站,以安装软件更新。",
"firmware_update_download_logs": "请与支持人员联系以获得帮助。",
"general_error_message": "如果该消息反复出现,请尝试重新启动您的应用程序和工作站。如果这不能解决问题,请与支持人员联系。",
"gripper_still_attached": "转板抓手仍处于连接状态",
"gripper_successfully_attached_and_calibrated": "转板抓手已成功连接并校准",
"gripper_successfully_calibrated": "转板抓手已成功校准",
"gripper_successfully_detached": "转板抓手已成功卸下",
"gripper": "转板抓手",
"help_us_improve_send_error_report": "通过向支持团队发送错误报告,帮助我们改进您的使用体验",
"ip_description_second": "请联系网络管理员,为工作站分配静态IP地址。",
"learn_uninstalling": "了解更多有关卸载应用程序的信息",
"loosen_screws_and_detach": "松开螺丝并卸下转板抓手",
"modal_instructions": "有关设置模块的分步说明,请参阅随包装附带的快速指引。",
"module_calibration_failed": "<block>模块校准失败。请确保校准适配器正确放置在模块上,然后重试。如果仍然有问题,请与支持人员联系。</block><block>{{error}}</block>",
"module_calibration_get_started": "<block>开始前,请从工作台上移除实验耗材并清理工作区,以便于校准。还需准备好右侧显示的所需设备。</block><block>校准适配器随模块一起提供。移液器探头随移液器一起提供。</block>",
"module_error_contact_support": "尝试关闭模块电源,然后再打开。如果报错仍然存在,请与支持人员联系。",
"network_setup_menu_description": "您将使用此连接来运行软件更新,并将协议加载到您的工作站上。",
"oem_mode_description": "启用OEM模式,以从Flex触摸屏中移除Opentrons的相关信息。",
"opentrons_app_successfully_updated": "应用程序已成功更新。",
"opentrons_app_update": "应用程序更新",
"opentrons_app_update_available": "应用程序可更新",
"opentrons_app_update_available_variation": "有可用的应用程序更新。",
"opentrons_app_will_use_interpreter": "在指定路径后,应用程序将使用此路径的Python解释器,而不是默认绑定的Python解释器。",
"opentrons_cares_about_privacy": "我们注重您的隐私。我们匿名化所有数据,仅用于改进我们的产品。",
"opentrons_def": "已验证的数据",
"opentrons_labware_def": "已验证的实验耗材数据",
"opentrons_tip_racks_recommended": "建议使用Opentrons吸头盒。其他吸头盒无法保证精度。",
"opentrons_tip_rack_name": "opentrons",
"previous_releases": "查看以前的版本",
"receive_alert": "当软件更新可用时接收提醒。",
"restore_description": "不建议恢复到过往的软件版本,但您可以访问下方的过往版本。为了获得最佳效果,请在安装过往版本之前卸载现有应用程序并删除其配置文件。",
"robot_server_version_ot3_description": "工作站软件包括工作站服务器和触摸屏显示界面。",
"robot_software_update_required": "需要对工作站软件进行更新才能运行此版本应用程序的协议。",
"run_failed_modal_description_desktop": "请与支持人员联系以获得帮助。",
"secure_labware_explanation_magnetic_module": "<block>通过调整模块顶部的黑色固定支架,确保您的实验耗材固定在磁性模块上。</block> <block>您的模块提供了两种尺寸的板固定支架:标准和深孔。这些固定支架可以通过拧开模块的拇指螺钉(前面的银色旋钮)来移除和更换。</block>",
"secure_labware_explanation_thermocycler": "通过关闭热循环仪模块的闩锁将您的实验耗材固定在其上。这样可以确保水平以及板位置的准确,从而获得最佳结果。",
"send_a_protocol_to_store": "向工作站发送协议以开始。",
"setup_instructions_description": "有关设置模块的分步说明,请参阅随包装附带的快速指引。",
"share_app_analytics": "共享应用程序分析数据",
"share_app_analytics_description": "通过自动发送匿名诊断和使用数据来帮助改进此产品。",
"share_display_usage_description": "关于工作站触摸屏的交互数据。",
"share_logs_with_opentrons": "共享工作站日志",
"share_logs_with_opentrons_description": "通过自动发送匿名的工作站日志来帮助改进此产品。这些日志用于解决工作站问题和发现错误趋势。",
"show_labware_offset_snippets_description": "仅适用于需要在应用程序之外应用耗材校准数据的用户。启用后,在设置协议过程中可访问Jupyter Notebook和SSH的代码片段。",
"something_seems_wrong": "您的移液器可能有问题。退出设置并联系支持人员以获取帮助。",
"these_are_advanced_settings": "<block>这些是高级设置。请勿在没有支持团队帮助的情况下尝试调整这些设置。更改这些设置可能会影响您的移液器寿命。</block><block>这些设置不会覆盖协议中定义的任何移液器设置。</block>",
"update_requires_restarting_app": "更新需要重新启动应用程序。",
"update_robot_software_description": "绕过自动更新过程并手动更新工作站软件",
"update_robot_software_link": "启动软件更新页面",
"versions_sync": "了解更多有关保持应用程序和工作站软件同步的信息",
"view_latest_release_notes_at": "请联系支持人员以获取发布说明。",
"want_to_help_out": "想要帮助吗?",
"welcome_title": "欢迎!",
"why_use_lpc": "耗材位置校准旨在纠正微小的偏差,请不要使用该校准方式来进行较大的位置补偿调整。如果需要进行较大调整的耗材数据校准可能表明工作站的校准存在问题。"
}
103 changes: 103 additions & 0 deletions app/src/assets/localization/zh/app_settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
{
"__dev_internal__forceHttpPolling": "强制轮询所有网络请求,而不是使用MQTT",
"__dev_internal__protocolStats": "协议统计",
"__dev_internal__enableRunNotes": "在协议运行期间显示备注",
"__dev_internal__enableQuickTransfer": "启用快速移液",
"__dev_internal__enableLabwareCreator": "Enable App Labware Creator",
"__dev_internal__enableLocalization": "Enable App Localization",
"add_folder_button": "添加实验耗材源文件夹",
"add_ip_button": "添加",
"add_ip_error": "输入IP地址或主机名",
"add_ip_hostname": "添加IP地址或主机名",
"add_override_path": "添加覆盖路径",
"additional_folder_description": "如果要指定一个文件夹来手动管理自定义实验耗材文件,可以在此处添加目录。",
"additional_folder_location": "附加源文件夹",
"additional_labware_folder_title": "其他定制实验耗材源文件夹",
"advanced": "高级",
"app_changes": "应用程序更改于",
"app_settings": "应用设置",
"bug_fixes": "错误修复",
"cal_block": "始终使用校准块进行校准",
"change_folder_button": "更改实验耗材源文件夹",
"channel": "通道",
"clear_confirm": "清除不可用的工作站",
"clear_robots_button": "清除不可用工作站列表",
"clear_robots_description": "清除设备页面上不可用工作站的列表。此操作无法撤消。",
"clear_unavail_robots": "清除不可用工作站",
"clear_unavailable_robots": "清除不可用的工作站?",
"clearing_cannot_be_undone": "在设备页面清除不可用工作站列表的操作无法撤销。",
"close": "关闭",
"connect_ip": "通过IP地址连接到工作站",
"connect_ip_button": "完成",
"connect_ip_link": "了解更多关于手动连接工作站的信息",
"discovery_timeout": "发现超时。",
"download_update": "正在下载更新...",
"enable_dev_tools": "开发者工具",
"enable_dev_tools_description": "启用此设置将在应用启动时打开开发者工具,打开额外的日志记录并访问功能标志。",
"error_boundary_desktop_app_description": "您需要重新加载应用程序。出现以下错误信息,请联系技术支持:",
"error_boundary_title": "发生未知错误",
"feature_flags": "功能标志",
"general": "通用",
"heater_shaker_attach_description": "在进行测试振荡功能或在协议中使用热震荡模块功能之前,显示正确连接热震荡模块的提醒。",
"heater_shaker_attach_visible": "确认热震荡模块连接",
"how_to_restore": "如何恢复过往的软件版本",
"installing_update": "正在安装更新...",
"ip_available": "可用",
"ip_description_first": "输入IP地址或主机名以连接到工作站。",
"manage_versions": "工作站版本和应用程序软件版本必须一致。通过工作站设置 > 高级查看工作站软件版本。",
"new_features": "新功能",
"no_folder": "未指定其他源文件夹",
"no_specified_folder": "未指定路径",
"no_unavail_robots_to_clear": "无待清除的不可用工作站",
"not_found": "未找到",
"opt_in": "加入",
"opt_in_description": "自动向我们发送匿名诊断和使用数据。我们仅将这些信息用于改进我们的产品。",
"opt_out": "退出",
"ot2_advanced_settings": "OT-2高级设置",
"override_path": "覆盖路径",
"override_path_to_python": "覆盖Python路径",
"prevent_robot_caching": "阻止工作站进行缓存",
"prevent_robot_caching_description": "启用此功能后,应用程序<strong>将立即清除不可用的工作站</strong>,并且不会记住它们。在网络上有许多工作站的情况下,防止缓存可能会提高网络性能,但代价是在应用程序启动时工作站发现的速度变慢且可靠性降低。",
"privacy": "隐私",
"problem_during_update": "此次更新耗时较长。",
"prompt": "始终显示选择校准块或垃圾桶的提示",
"release_notes": "发行说明",
"reload_app": "重新加载应用程序",
"remind_later": "稍后提醒我",
"reset_to_default": "恢复默认设置",
"restart_touchscreen": "重启触摸屏",
"restarting_app": "下载完成,正在重启应用程序...",
"restore_previous": "查看如何恢复过往软件版本",
"searching": "正在搜索30秒",
"setup_connection": "设置连接",
"share_display_usage": "分享屏幕使用情况",
"share_robot_logs": "分享工作站日志",
"share_robot_logs_description": "工作站执行的操作数据,如运行协议。",
"show_labware_offset_snippets": "显示实验耗材校准数据代码片段",
"software_update_available": "有可用的软件更新",
"software_version": "应用程序软件版本",
"successfully_deleted_unavail_robots": "成功删除不可用的工作站",
"tip_length_cal_method": "吸头长度校准方法",
"trash_bin": "始终使用垃圾桶进行校准",
"try_restarting_the_update": "尝试重新启动更新。",
"turn_off_updates": "在应用程序设置中关闭软件更新通知。",
"up_to_date": "最新",
"update_alerts": "软件更新提醒",
"update_app_now": "立即更新应用程序",
"update_available": "更新可用",
"update_channel": "更新通道",
"update_description": "稳定版将接收最新的稳定版本。测试版将允许您在稳定版发布之前尝试正在开发的新功能,但这些功能尚未完成测试。",
"usb_to_ethernet_adapter_description": "描述",
"usb_to_ethernet_adapter_driver_version": "驱动程序版本",
"usb_to_ethernet_adapter_info": "USB-to-Ethernet适配器信息",
"usb_to_ethernet_adapter_info_description": "OT-2内置了一些USB-to-Ethernet适配器。如果您使用的OT-2有这个适配器,当您建立有线连接时,它将添加到您的计算机设备列表中。如果您使用的是 Realtek 适配器,驱动程序必须是最新的。",
"usb_to_ethernet_adapter_link": "前往Realtek.com",
"usb_to_ethernet_adapter_manufacturer": "制造商",
"usb_to_ethernet_adapter_no_driver_version": "未知",
"usb_to_ethernet_adapter_toast_message": "Realtek USB-to-Ethernet适配器驱动程序有更新",
"usb_to_ethernet_not_connected": "没有连接USB-to-Ethernet适配器",
"usb_to_ethernet_unknown_manufacturer": "未知制造商",
"usb_to_ethernet_unknown_product": "未知适配器",
"view_software_update": "查看软件更新",
"view_update": "查看更新"
}
Loading
Loading