From bb9d7f05ca551bdc8dc5c586e111a1ee8dffe266 Mon Sep 17 00:00:00 2001 From: losingle Date: Wed, 16 Apr 2025 21:42:29 +0800 Subject: [PATCH 01/12] i18n(zh-CN): improve Chinese translations - Improve UI button text (simplify Home/Back/Switch buttons) - Refine Experitest related translations - Update refresh source related text to be more intuitive - Keep data center names in English (US-West/East, EU-Central) - Improve clarity and consistency of translations --- .../public/locales/zh-CN/translation.json | 198 +++++++++--------- 1 file changed, 99 insertions(+), 99 deletions(-) diff --git a/app/common/public/locales/zh-CN/translation.json b/app/common/public/locales/zh-CN/translation.json index eaedea1e1c..998fb64891 100644 --- a/app/common/public/locales/zh-CN/translation.json +++ b/app/common/public/locales/zh-CN/translation.json @@ -18,16 +18,16 @@ "Bring All to Front": "前置全部窗口", "Help": "帮助", "Appium Documentation": "Appium 文档", - "Inspector Documentation": "Inspector Documentation", - "Appium Discussion Forum": "Appium论坛", + "Inspector Documentation": "检查器文档", + "Appium Discussion Forum": "Appium 论坛", "Report Issues": "报告问题", - "About Appium Inspector": "关于Appium Inspector", - "showAppInfo": "App Version: {{appVersion}}\nElectron: {{electronVersion}}\nNode.js: {{nodejsVersion}}\n", + "About Appium Inspector": "关于 Appium Inspector", + "showAppInfo": "应用版本:{{appVersion}}\nElectron:{{electronVersion}}\nNode.js:{{nodejsVersion}}\n", "Improve Translations": "帮助我们翻译", "Check for Updates…": "检查更新", "File": "文件", "New Window": "新窗口", - "Hide Appium Inspector": "隐藏Appium Inspector", + "Hide Appium Inspector": "隐藏 Appium Inspector", "Hide Others": "隐藏其他窗口", "Show All": "显示全部窗口", "Quit Appium Inspector": "退出 Appium Inspector", @@ -41,13 +41,13 @@ "Save Server Arguments Preset": "保存服务器预设参数", "Save": "保存", "Cancel": "取消", - "updateDetails": "发布日期: {{pubDate}}\n\n版本注释: {{notes}}", + "updateDetails": "发布日期:{{pubDate}}\n\n版本注释:{{notes}}", "appiumIsAvailable": "Appium Inspector {{name}} 可用", "updateIsBeingDownloaded": "更新正在下载。完成后将再次通知您", - "updateIsDownloaded": "Appium Inspector {{releaseName}} 已经下载。必须重新启动以应用更新(注意:它可能需要几分钟时间,以便安装并重启)", - "updateDownloadFailed": "下载更新失败。原因: {{message}}", - "OK": "OK", - "Install Now": "立即安装​​​​​​​", + "updateIsDownloaded": "Appium Inspector {{releaseName}} 已经下载。必须重新启动以应用更新(注意:它可能需要几分钟时间,以便安装并重启)", + "updateDownloadFailed": "下载更新失败。原因:{{message}}", + "OK": "确定", + "Install Now": "立即安装", "Install Later": "稍后安装", "Update Download Started": "更新下载开始", "No update available": "没有可用的更新", @@ -65,18 +65,18 @@ "frameworkNotSupported": "框架 \"{{framework}}\" 不受支持", "findElementFailure": "找不到 '{{methodName}}' 的元素。请刷新页面并重试。", "Could not start session": "无法启动会话", - "couldNotConnect": "无法连接到 Appium 服务器: URL '{{url}}'. 请检查服务器是否正在运行 并且 URL 是否正确 (正确的 URLs 可以在Appium的服务器日志开头中找到). 如果你使用的是Inspector的web版本,确保服务器以'--allow-cors'选项启动", - "Invalid URL:": "无效链接", - "experitestAccessKey": "AccessKey", - "experitestUrl": "Url", - "locatorStrategy": "定位策略:", + "couldNotConnect": "无法连接到 Appium 服务器: URL '{{url}}'。请检查服务器是否正在运行 并且 URL 是否正确 (正确的 URLs 可以在 Appium 的服务器日志开头中找到)。如果您使用的是 Inspector 的 web 版本,确保服务器以 '--allow-cors' 选项启动", + "Invalid URL:": "无效链接:", + "experitestAccessKey": "Experitest 访问密钥", + "experitestUrl": "Experitest 服务器地址", + "locatorStrategy": "定位策略:", "selector": "选择器:", - "couldNotObtainScreenshot": "无法获取屏幕截图: {{screenshotError}}", + "couldNotObtainScreenshot": "无法获取屏幕截图:{{screenshotError}}", "selectElementInSource": "选择一个要开始的源元素。", - "Press Home Button": "按主页按钮", + "Press Home Button": "主页", "Execute Siri Command": "执行 Siri 命令", - "Press Back Button": "按返回按钮", - "Press App Switch Button": "按下应用切换按钮", + "Press Back Button": "返回", + "Press App Switch Button": "应用切换", "Command": "Command 键", "Show Element Handles": "显示元素处理器", "Hide Element Handles": "隐藏元素处理器", @@ -84,8 +84,8 @@ "Tap/Swipe By Coordinates": "根据坐标点击/滑动", "Download Screenshot": "下载屏幕截图", "Back": "返回", - "Start Refreshing Source": "开始刷新源", - "Pause Refreshing Source": "暂停刷新源", + "Start Refreshing Source": "开始实时刷新", + "Pause Refreshing Source": "暂停实时刷新", "refreshSource": "刷新源和屏幕截图", "Start Recording": "开始录制", "Pause Recording": "暂停录制", @@ -100,7 +100,7 @@ "Quit Session": "退出会话", "Your session is about to expire": "您的会话即将过期", "Enter Keys to Send": "输入要发送的密钥", - "Find and Select in Source": "选择文件", + "Find and Select in Source": "在源代码中查找和选择", "Clear": "清空", "Send Keys": "发送密钥", "Done": "完成", @@ -110,7 +110,7 @@ "Start this Kind of Session with Code": "用代码开始这个类别的会话", "Clear Actions": "清除操作", "Close Recorder": "关闭录制", - "enableRecordingAndPerformActions": "Enable recording in the application header, then perform some actions to see code show up here", + "enableRecordingAndPerformActions": "在应用程序标题栏中启用录制,然后执行一些操作以查看此处显示的代码", "Recorder": "录制", "Attribute": "属性", "Value": "值", @@ -119,45 +119,45 @@ "Time": "时间 (ms)", "Get Timing": "获取计时", "interactionsNotAvailable": "此元素的交互可能不可用", - "usingXPathNotRecommended": "不建议使用 XPath 定位器,这可能会导致脆弱的测试。请您的开发团队提供独特的辅助定位器!", + "usingXPathNotRecommended": "不建议使用 XPath 定位器,这可能会导致脆弱的测试。请您的开发团队提供独特的辅助定位器!", "noAdditionalContextsFound": "没有检测到其他环境", - "contextDropdownInfo": "Multiple contexts detected; certain elements might only be accessible after switching to a different context. Note that webview inspection in Appium Inspector is less accurate than the DevTools of Chrome or Safari. For more information, see:", - "idAutocompletionCanBeDisabled": "The requested id selector does not have a package name prefix. This Appium session has package name autocompletion enabled, which may be the reason why no elements were found. To disable this behavior, change the 'disableIdLocatorAutocompletion' setting to 'true'.", - "missingAutomationNameForStrategies": "可能有更多的定位器策略。要查看它们,请在启动会话时添加名为“appium:automationName”的capability选项。 注意,在Appium 2中这种能力是强制性的。", - "snapshotMaxDepthReached": "This element is located at the maximum source depth {{selectedElementDepth}}, therefore its child elements (if any) are not shown. To reveal them, change the 'snapshotMaxDepth' setting to a value greater than {{selectedElementDepth}}. Check your driver documentation for the maximum supported value.", + "contextDropdownInfo": "检测到多个上下文;某些元素可能只有在切换到不同的上下文后才能访问。请注意,Appium Inspector 中的 webview 检查不如 Chrome 或 Safari 的开发者工具准确。更多信息,请参见:", + "idAutocompletionCanBeDisabled": "请求的 id 选择器没有包名前缀。此 Appium 会话启用了包名自动完成功能,这可能是找不到元素的原因。要禁用此行为,请将 'disableIdLocatorAutocompletion' 设置更改为 'true'。", + "missingAutomationNameForStrategies": "可能有更多的定位器策略。要查看它们,请在启动会话时添加名为“appium:automationName”的 capability 选项。注意,在 Appium 2 中这种能力是强制性的。", + "snapshotMaxDepthReached": "此元素位于最大源深度 {{selectedElementDepth}},因此不显示其子元素(如果有)。要显示它们,请将 'snapshotMaxDepth' 设置更改为大于 {{selectedElementDepth}} 的值。查看驱动程序文档以了解支持的最大值。", "Tap": "点击", "Gathering initial app source…": "收集初始应用源…", - "couldNotObtainSource": "无法获取源代码: {{errorMsg}}", + "couldNotObtainSource": "无法获取源代码:{{errorMsg}}", "iOS": "iOS", "Android": "Android", - "desiredCapabilitiesDocumentation": "Capabilities文档", + "desiredCapabilitiesDocumentation": "Capabilities 文档", "startSession": "启动会话", "saveAs": "另存为...", "attachToSession": "附加到会话", "selectedElement": "选定的元素", "unnamed": "(未命名)", "No Description": "暂无描述", - "couldNotFindEntryWithId": "Could not find an entry with ID {{id}}", + "couldNotFindEntryWithId": "找不到 ID 为 {{id}} 的条目", "couldNotFindAnyElements": "找不到任何元素", "elementsCount": "查找到的元素", - "xCoordinate": "X: {{x}}", - "yCoordinate": "Y: {{y}}", + "xCoordinate": "X:{{x}}", + "yCoordinate": "Y:{{y}}", "SauceLabs Data Center": "SauceLabs 数据中心", - "US-West": "美国西部1", - "US-East": "美国西部4", - "EU-Central": "欧洲中部1", + "US-West": "US-West", + "US-East": "US-East", + "EU-Central": "EU-Central", "proxyThroughSC": "通过 Sauce Connect 的 Selenium Relay 代理", "SSL": "SSL", "text": "文本", "boolean": "布尔值", "number": "数字", "JSON object": "JSON 对象", - "connectToExistingSessionInstructions": "如果您有上述服务器类型的已运行会话, 则可以直接将检查器附加到该会话。", + "connectToExistingSessionInstructions": "如果您有上述服务器类型的已运行会话,则可以直接将检查器附加到该会话。", "selectSessionIDInDropdown": "从以下下拉列表中选择会话 ID。", "allowUnauthorizedCerts": "允许未经授权的证书", "Use Proxy": "使用代理", - "JSON Representation": "JSON表示", - "Capability Builder": "Capability Builder", + "JSON Representation": "JSON 表示", + "Capability Builder": "能力构建器", "Saved Capability Sets": "已保存的能力集", "Attach to Session": "附加到会话…", "localhost": "本地主机", @@ -175,11 +175,11 @@ "Pcloudy Host": "Pcloudy 主机", "Pcloudy API Key": "Pcloudy API 密钥", "Add your token": "添加您的 Token", - "Perfecto Token": "Perfecto Token", + "Perfecto Token": "Perfecto 令牌", "Your Kobiton Username": "您的 Kobiton 用户名", "Kobiton Access Key": "Kobiton 访问密钥", "serverTabHeasdpinWebDriverURL": "HeadSpin Web Driver URL", - "sessionHeadspinWebDriverURLDescription": "使用自动配置路由从 HeadSpin UI 或 HeadSpin API获取 URL", + "sessionHeadspinWebDriverURLDescription": "使用自动配置路由从 HeadSpin UI 或 HeadSpin API 获取 URL", "Remote Host": "远程主机", "Remote Port": "远程端口", "Remote Path": "远程路径", @@ -190,45 +190,45 @@ "Bitbar API Key": "Bitbar API 密钥", "RemoteTestKit AccessToken": "RemoteTestKit 访问令牌", "RobotQA Token": "RobotQA 令牌", - "Add": "Add", + "Add": "添加", "Name": "名称", "Description": "描述", "Created": "已创建", "Actions": "操作", - "enterYourSessionId": "在此输入您的会话ID", + "enterYourSessionId": "在此输入您的会话 ID", "Proxy URL": "代理 URL", "Source": "源", "Commands": "命令", "Execute Commands": "执行命令", - "Gestures": "Gestures", - "Gesture Builder": "Gesture Builder", - "Saved Gestures": "Saved Gestures", - "Create New Gesture": "Create New Gesture", - "Upload Gesture File": "Upload Gesture File", - "gesturesDescription": "Create, save, and execute custom gestures here. Gestures are identical to action chains in the W3C WebDriver Actions API.", + "Gestures": "手势", + "Gesture Builder": "手势构建器", + "Saved Gestures": "已保存的手势", + "Create New Gesture": "创建新手势", + "Upload Gesture File": "上传手势文件", + "gesturesDescription": "在此创建、保存和执行自定义手势。手势与 W3C WebDriver Actions API 中的动作链相同。", "Session Information": "会话信息", "Execute Command": "执行命令", - "commandsDescription": "Run various commands using the current Appium driver. Note that not all drivers support all commands.", - "showMoveActionCoordsInPercentage": "Show Coordinates of Move Actions in Screen Dimension Percentages", - "showMoveActionCoordsInPixels": "Show Coordinates of Move Actions in Pixels", - "toggleMoveActionCoordPicker": "Toggle Setting Coordinates via Clicking on Screenshot", + "commandsDescription": "使用当前 Appium 驱动程序运行各种命令。请注意,并非所有驱动程序都支持所有命令。", + "showMoveActionCoordsInPercentage": "以屏幕尺寸百分比显示移动动作的坐标", + "showMoveActionCoordsInPixels": "以像素显示移动动作的坐标", + "toggleMoveActionCoordPicker": "通过点击截图切换设置坐标", "Action Type": "操作类型", - "Pointer Up": "Pointer Up", - "Pointer Down": "Pointer Down", + "Pointer Up": "指针抬起", + "Pointer Down": "指针按下", "Pause": "暂停", "Move": "移动", "Action Type Not Defined": "操作类型未定义", "Duration": "期限", "Button": "按钮", - "Untitled Gesture": "Untitled Gesture", + "Untitled Gesture": "未命名手势", "Add Description": "添加描述", - "Gesture saved": "Gesture saved", - "Gesture saved as": "Gesture saved as '{{gestureName}}'", - "Duplicate pointer names are not allowed": "Duplicate pointer names are not allowed", + "Gesture saved": "手势已保存", + "Gesture saved as": "手势已保存为 '{{gestureName}}'", + "Duplicate pointer names are not allowed": "不允许重复的指针名称", "Left": "左方向键", "Right": "右方向键", "Play": "播放", - "Download": "Download", + "Download": "下载", "Save Capability Set As": "保存能力设置为…", "Edit Raw JSON": "直接编辑 JSON", "Enter Parameters for:": "输入参数:", @@ -236,60 +236,60 @@ "App Management": "应用管理", "File Transfer": "文件传输", "Device Interaction": "设备交互", - "Session": "Session会话", + "Session": "会话", "Web": "Web", "Context": "上下文", "simulatorOnly": "模拟器/仅模拟器", - "minAndroidSDK": "最小的Android SDK版本", + "minAndroidSDK": "最小的 Android SDK 版本", "Error": "错误", - "findingElementInSourceFailed": "找不到指定的元素。 当前应用程序来源或元素 ID 可能已经改变,或者可能有太多具有相同坐标的元素。", + "findingElementInSourceFailed": "找不到指定的元素。当前应用程序来源或元素 ID 可能已经改变,或者可能有太多具有相同坐标的元素。", "callToMethodFailed": "调用 '{{methodName}}' 失败", "methodCallResult": "'{{methodName}}' 结果", - "TestingBot Key": "TestingBot 键", - "TestingBot Secret": "TestingBot Secret", + "TestingBot Key": "TestingBot 密钥", + "TestingBot Secret": "TestingBot 密钥", "Appium Server": "Appium 服务", "Select Cloud Providers": "选择云提供商", "Advanced Settings": "高级设置", - "Native App Mode": "Native App Mode", - "Web/Hybrid App Mode": "Web/Hybrid App Mode", + "Native App Mode": "原生应用模式", + "Web/Hybrid App Mode": "Web/混合应用模式", "autoAddPrefixes": "启动时自动添加必要的 Appium 供应商前缀", - "attachSessionNotRunning": "Could not confirm that session {{attachSessId}} is running on the provided server. Please check details before trying to attach to the session again.", - "Mobitru WebDriver URL": "Mobitru WebDriver URL", - "Mobitru Billing Unit": "Mobitru Billing Unit", + "attachSessionNotRunning": "无法确认会话 {{attachSessId}} 在提供的服务器上运行。请在尝试再次附加到会话之前检查详细信息。", + "Mobitru WebDriver URL": "Mobitru WebDriver 网址", + "Mobitru Billing Unit": "Mobitru 计费单位", "Mobitru Access Key": "Mobitru 访问密钥", - "Session URL": "会话URL", - "Server Details": "服务器详细信息", - "Session Length": "会话长度", - "Session Details": "会话详情", - "Currently Active App ID": "当前活动的应用程序 ID", + "Session URL": "Session URL", + "Server Details": "Server Details", + "Session Length": "Session Length", + "Session Details": "Session Details", + "Currently Active App ID": "Currently Active App ID", "confirmDeletion": "您确定要删除吗?", "Copied!": "复制成功!", - "Error Fetching Session URL": "获取会话URL 时出错", + "Error Fetching Session URL": "获取会话 URL 时出错", "noResultsFound": "未找到结果", - "invalidCapType": "无效的capability类型: {{type}}", + "invalidCapType": "无效的 capability 类型:{{type}}", "whitespaceDetected": "文本开始和/或以空格结束", - "duplicateCapabilityNameError": "A capability set with the same name already exists", - "errorLoadingGestures": "Error loading gestures", - "unableToUploadGestureFiles": "Could not upload gestures from below files:", - "gestureEmptyTickError": "Actions should have valid ticks", - "gestureInvalidEventError": "Invalid event type '{{invalidEvent}}'. Valid values are {{validEvents}}", - "gestureRequiredFieldsError": "Values '{{fields}}' are required for '{{eventType}}' event", - "gestureNameCannotBeEmptyError": "Gesture name cannot be empty", - "gestureInvalidJsonError": "Invalid JSON file. Unable to parse the file content", - "gestureImportedFrom": "Gesture imported from '{{fileName}}'", - "invalidSessionFile": "Invalid session file", - "TV Labs API Key": "TV Labs API Key", - "TestcribeAPIKey": "Testcribe API Key", - "sessionTestcribeApiKeyDescription": "You can get your api key from https://app.testcribe.com/settings/apiKeys", - "missingVendorProperties": "Please provide the following server details for {{vendorName}}: {{vendorProps}}", - "Username": "Username", + "duplicateCapabilityNameError": "已存在同名的能力设置", + "errorLoadingGestures": "加载手势时出错", + "unableToUploadGestureFiles": "无法从以下文件上传手势:", + "gestureEmptyTickError": "动作应该有有效的时间点", + "gestureInvalidEventError": "无效的事件类型 '{{invalidEvent}}'。有效值为 {{validEvents}}", + "gestureRequiredFieldsError": "'{{eventType}}' 事件需要 '{{fields}}' 值", + "gestureNameCannotBeEmptyError": "手势名称不能为空", + "gestureInvalidJsonError": "无效的 JSON 文件。无法解析文件内容", + "gestureImportedFrom": "已从 '{{fileName}}' 导入手势", + "invalidSessionFile": "无效的会话文件", + "TV Labs API Key": "TV Labs API 密钥", + "TestcribeAPIKey": "Testcribe API 密钥", + "sessionTestcribeApiKeyDescription": "你可以从 https://app.testcribe.com/settings/apiKeys 获取你的 API 密钥", + "missingVendorProperties": "请提供以下 {{vendorName}} 的服务器详细信息:{{vendorProps}}", + "Username": "用户名", "URL": "URL", "WebDriver URL": "WebDriver URL", - "API Key": "API Key", - "Access Key": "Access Key", - "SecurityToken": "SecurityToken", - "AccessToken": "AccessToken", - "Token": "Token", - "Key": "Key", - "Secret": "Secret" + "API Key": "API 密钥", + "Access Key": "访问密钥", + "SecurityToken": "安全令牌", + "AccessToken": "访问令牌", + "Token": "令牌", + "Key": "密钥", + "Secret": "密钥" } From ff2e881cf679b702b48a804c0f43aada96c00aba Mon Sep 17 00:00:00 2001 From: losingle Date: Wed, 16 Apr 2025 22:09:27 +0800 Subject: [PATCH 02/12] Update translation.json --- app/common/public/locales/zh-CN/translation.json | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/common/public/locales/zh-CN/translation.json b/app/common/public/locales/zh-CN/translation.json index 998fb64891..4407434c1e 100644 --- a/app/common/public/locales/zh-CN/translation.json +++ b/app/common/public/locales/zh-CN/translation.json @@ -99,10 +99,8 @@ "Keep Session Running": "保持会话运行", "Quit Session": "退出会话", "Your session is about to expire": "您的会话即将过期", - "Enter Keys to Send": "输入要发送的密钥", - "Find and Select in Source": "在源代码中查找和选择", - "Clear": "清空", - "Send Keys": "发送密钥", + "Enter Keys to Send": "输入要发送的文本", + "Send Keys": "发送文本", "Done": "完成", "Search": "查找", "Show/Hide Boilerplate Code": "显示/隐藏样板代码", From 08faa61bc8b1e1f83a7209330e743522ee8789cd Mon Sep 17 00:00:00 2001 From: losingle Date: Thu, 17 Apr 2025 23:15:30 +0800 Subject: [PATCH 03/12] feat: implement tab close functionality with i18n support - Add right-click close functionality for tabs - Add 'Close tab' translations for multiple languages including: - English - Chinese (Simplified & Traditional) - Japanese - Korean - French - Spanish - German - Russian --- app/common/public/locales/de/translation.json | 3 +- app/common/public/locales/en/translation.json | 3 +- .../public/locales/es-ES/translation.json | 3 +- app/common/public/locales/fr/translation.json | 3 +- app/common/public/locales/ja/translation.json | 3 +- app/common/public/locales/ko/translation.json | 3 +- app/common/public/locales/ru/translation.json | 3 +- .../public/locales/zh-CN/translation.json | 3 +- .../public/locales/zh-TW/translation.json | 3 +- .../renderer/components/Session/Session.jsx | 38 ++++++++++++++++++- 10 files changed, 54 insertions(+), 11 deletions(-) diff --git a/app/common/public/locales/de/translation.json b/app/common/public/locales/de/translation.json index 1110352cc5..1d0ab228b6 100644 --- a/app/common/public/locales/de/translation.json +++ b/app/common/public/locales/de/translation.json @@ -291,5 +291,6 @@ "AccessToken": "AccessToken", "Token": "Token", "Key": "Key", - "Secret": "Secret" + "Secret": "Geheimnis", + "Close tab": "Tab schließen" } diff --git a/app/common/public/locales/en/translation.json b/app/common/public/locales/en/translation.json index da30f43d85..5454c32991 100644 --- a/app/common/public/locales/en/translation.json +++ b/app/common/public/locales/en/translation.json @@ -291,5 +291,6 @@ "AccessToken": "AccessToken", "Token": "Token", "Key": "Key", - "Secret": "Secret" + "Secret": "Secret", + "Close tab": "Close tab" } diff --git a/app/common/public/locales/es-ES/translation.json b/app/common/public/locales/es-ES/translation.json index 4c303cba9d..7f24cdcbfb 100644 --- a/app/common/public/locales/es-ES/translation.json +++ b/app/common/public/locales/es-ES/translation.json @@ -291,5 +291,6 @@ "AccessToken": "AccessToken", "Token": "Token", "Key": "Key", - "Secret": "Secret" + "Secret": "Secreto", + "Close tab": "Cerrar pestaña" } diff --git a/app/common/public/locales/fr/translation.json b/app/common/public/locales/fr/translation.json index 119ef09863..1832a01602 100644 --- a/app/common/public/locales/fr/translation.json +++ b/app/common/public/locales/fr/translation.json @@ -291,5 +291,6 @@ "AccessToken": "AccessToken", "Token": "Token", "Key": "Key", - "Secret": "Secret" + "Secret": "Secret", + "Close tab": "Fermer l'onglet" } diff --git a/app/common/public/locales/ja/translation.json b/app/common/public/locales/ja/translation.json index 243db9bcb5..2772ff43e8 100644 --- a/app/common/public/locales/ja/translation.json +++ b/app/common/public/locales/ja/translation.json @@ -291,5 +291,6 @@ "AccessToken": "AccessToken", "Token": "Token", "Key": "Key", - "Secret": "Secret" + "Secret": "シークレット", + "Close tab": "タブを閉じる" } diff --git a/app/common/public/locales/ko/translation.json b/app/common/public/locales/ko/translation.json index 4856ce0fdf..17ef4ba702 100644 --- a/app/common/public/locales/ko/translation.json +++ b/app/common/public/locales/ko/translation.json @@ -291,5 +291,6 @@ "AccessToken": "AccessToken", "Token": "Token", "Key": "Key", - "Secret": "Secret" + "Secret": "시크릿", + "Close tab": "탭 닫기" } diff --git a/app/common/public/locales/ru/translation.json b/app/common/public/locales/ru/translation.json index 55f227c00d..264870ce69 100644 --- a/app/common/public/locales/ru/translation.json +++ b/app/common/public/locales/ru/translation.json @@ -291,5 +291,6 @@ "AccessToken": "AccessToken", "Token": "Token", "Key": "Key", - "Secret": "Secret" + "Secret": "Секрет", + "Close tab": "Закрыть вкладку" } diff --git a/app/common/public/locales/zh-CN/translation.json b/app/common/public/locales/zh-CN/translation.json index 4407434c1e..aa4dffa697 100644 --- a/app/common/public/locales/zh-CN/translation.json +++ b/app/common/public/locales/zh-CN/translation.json @@ -289,5 +289,6 @@ "AccessToken": "访问令牌", "Token": "令牌", "Key": "密钥", - "Secret": "密钥" + "Secret": "密钥", + "Close tab": "关闭标签页" } diff --git a/app/common/public/locales/zh-TW/translation.json b/app/common/public/locales/zh-TW/translation.json index 6f9af6c635..7077d12ea7 100644 --- a/app/common/public/locales/zh-TW/translation.json +++ b/app/common/public/locales/zh-TW/translation.json @@ -291,5 +291,6 @@ "AccessToken": "AccessToken", "Token": "Token", "Key": "Key", - "Secret": "Secret" + "Secret": "密鑰", + "Close tab": "關閉標籤頁" } diff --git a/app/common/renderer/components/Session/Session.jsx b/app/common/renderer/components/Session/Session.jsx index 4005cb12b7..017579fbc8 100644 --- a/app/common/renderer/components/Session/Session.jsx +++ b/app/common/renderer/components/Session/Session.jsx @@ -1,5 +1,5 @@ import {LinkOutlined} from '@ant-design/icons'; -import {Badge, Button, Spin, Tabs} from 'antd'; +import {Badge, Button, Menu, Dropdown, Spin, Tabs} from 'antd'; import _ from 'lodash'; import {useEffect} from 'react'; import {useNavigate} from 'react-router'; @@ -27,8 +27,10 @@ const Session = (props) => { tabKey, switchTabs, serverType, + setServerType, server, visibleProviders = [], + removeVisibleProvider, caps, capsUUID, capsName, @@ -41,6 +43,7 @@ const Session = (props) => { newSessionLoading, attachSessId, t, + setVisibleProviders, } = props; const navigate = useNavigate(); @@ -62,6 +65,31 @@ const Session = (props) => { } }; + const getContextMenu = (tabKey) => ({ + items: [ + { + key: 'closeTab', + label: t('Close tab'), + onClick: () => handleCloseTab(tabKey), + disabled: tabKey === SERVER_TYPES.REMOTE + } + ] + }); + + const handleContextMenu = (e, tabKey) => { + e.preventDefault(); + e.stopPropagation(); + }; + + const handleCloseTab = (tabKey) => { + if (tabKey !== SERVER_TYPES.REMOTE) { + removeVisibleProvider(tabKey); + if (serverType === tabKey) { + setServerType(SERVER_TYPES.REMOTE); + } + } + }; + useEffect(() => { const { setLocalServerParams, @@ -114,7 +142,13 @@ const Session = (props) => { return true; } return { - label:
{provider.tabhead()}
, + label: ( + +
handleContextMenu(e, providerName)}> + {provider.tabhead()} +
+
+ ), key: providerName, children: provider.tab(props), }; From 233d918e1d9a300e5094f9488cc5fc5b1e5875d3 Mon Sep 17 00:00:00 2001 From: losingle Date: Thu, 17 Apr 2025 23:23:21 +0800 Subject: [PATCH 04/12] Fix lint issues in Session component --- .../renderer/components/Session/Session.jsx | 20 ++++++------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/app/common/renderer/components/Session/Session.jsx b/app/common/renderer/components/Session/Session.jsx index 017579fbc8..3af6df9c85 100644 --- a/app/common/renderer/components/Session/Session.jsx +++ b/app/common/renderer/components/Session/Session.jsx @@ -1,16 +1,12 @@ +import {Badge, Button, Dropdown, Spin, Tabs} from 'antd'; import {LinkOutlined} from '@ant-design/icons'; -import {Badge, Button, Menu, Dropdown, Spin, Tabs} from 'antd'; import _ from 'lodash'; import {useEffect} from 'react'; import {useNavigate} from 'react-router'; +import {ADD_CLOUD_PROVIDER_TAB_KEY, SERVER_TYPES, SESSION_BUILDER_TABS} from '../../constants/session-builder'; import {BUTTON} from '../../constants/antd-types'; import {LINKS} from '../../constants/common'; -import { - ADD_CLOUD_PROVIDER_TAB_KEY, - SERVER_TYPES, - SESSION_BUILDER_TABS, -} from '../../constants/session-builder'; import {ipcRenderer, openLink} from '../../polyfills'; import {log} from '../../utils/logger'; import AdvancedServerParams from './AdvancedServerParams.jsx'; @@ -24,7 +20,6 @@ import SessionStyles from './Session.module.css'; const Session = (props) => { const { - tabKey, switchTabs, serverType, setServerType, @@ -43,12 +38,11 @@ const Session = (props) => { newSessionLoading, attachSessId, t, - setVisibleProviders, } = props; const navigate = useNavigate(); - const isAttaching = tabKey === 'attach'; + const isAttaching = serverType === 'attach'; const handleSelectServerTab = async (tab) => { const {changeServerType, addCloudProvider} = props; @@ -76,7 +70,7 @@ const Session = (props) => { ] }); - const handleContextMenu = (e, tabKey) => { + const handleContextMenu = (e) => { e.preventDefault(); e.stopPropagation(); }; @@ -97,7 +91,6 @@ const Session = (props) => { setSavedServerParams, initFromSessionFile, setStateFromSessionFile, - setVisibleProviders, bindWindowClose, initFromQueryString, saveSessionAsFile, @@ -107,7 +100,6 @@ const Session = (props) => { bindWindowClose(); switchTabs(SESSION_BUILDER_TABS.CAPS_BUILDER); await getSavedSessions(); - await setVisibleProviders(); await setSavedServerParams(); await setLocalServerParams(); initFromQueryString(loadNewSession); @@ -144,7 +136,7 @@ const Session = (props) => { return { label: ( -
handleContextMenu(e, providerName)}> +
handleContextMenu(e)}> {provider.tabhead()}
@@ -163,7 +155,7 @@ const Session = (props) => {
Date: Thu, 17 Apr 2025 23:28:04 +0800 Subject: [PATCH 05/12] Fix lint issues in Session component --- app/common/renderer/components/Session/Session.jsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/common/renderer/components/Session/Session.jsx b/app/common/renderer/components/Session/Session.jsx index 3af6df9c85..f4bd2611b1 100644 --- a/app/common/renderer/components/Session/Session.jsx +++ b/app/common/renderer/components/Session/Session.jsx @@ -4,16 +4,17 @@ import _ from 'lodash'; import {useEffect} from 'react'; import {useNavigate} from 'react-router'; -import {ADD_CLOUD_PROVIDER_TAB_KEY, SERVER_TYPES, SESSION_BUILDER_TABS} from '../../constants/session-builder'; import {BUTTON} from '../../constants/antd-types'; import {LINKS} from '../../constants/common'; +import {ADD_CLOUD_PROVIDER_TAB_KEY, SERVER_TYPES, SESSION_BUILDER_TABS} from '../../constants/session-builder'; import {ipcRenderer, openLink} from '../../polyfills'; import {log} from '../../utils/logger'; + import AdvancedServerParams from './AdvancedServerParams.jsx'; import AttachToSession from './AttachToSession.jsx'; import CapabilityEditor from './CapabilityEditor.jsx'; -import CloudProviders from './CloudProviders.jsx'; import CloudProviderSelector from './CloudProviderSelector.jsx'; +import CloudProviders from './CloudProviders.jsx'; import SavedSessions from './SavedSessions.jsx'; import ServerTabCustom from './ServerTabCustom.jsx'; import SessionStyles from './Session.module.css'; From 3926d29aa9ef093703dcaf2bcd9cc718f5b2f0d6 Mon Sep 17 00:00:00 2001 From: losingle Date: Thu, 17 Apr 2025 23:30:44 +0800 Subject: [PATCH 06/12] Fix lint issues in Session component --- app/common/renderer/components/Session/Session.jsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/common/renderer/components/Session/Session.jsx b/app/common/renderer/components/Session/Session.jsx index f4bd2611b1..ae8b5ae18c 100644 --- a/app/common/renderer/components/Session/Session.jsx +++ b/app/common/renderer/components/Session/Session.jsx @@ -1,5 +1,5 @@ -import {Badge, Button, Dropdown, Spin, Tabs} from 'antd'; import {LinkOutlined} from '@ant-design/icons'; +import {Badge, Button, Dropdown, Spin, Tabs} from 'antd'; import _ from 'lodash'; import {useEffect} from 'react'; import {useNavigate} from 'react-router'; @@ -9,12 +9,11 @@ import {LINKS} from '../../constants/common'; import {ADD_CLOUD_PROVIDER_TAB_KEY, SERVER_TYPES, SESSION_BUILDER_TABS} from '../../constants/session-builder'; import {ipcRenderer, openLink} from '../../polyfills'; import {log} from '../../utils/logger'; - import AdvancedServerParams from './AdvancedServerParams.jsx'; import AttachToSession from './AttachToSession.jsx'; import CapabilityEditor from './CapabilityEditor.jsx'; -import CloudProviderSelector from './CloudProviderSelector.jsx'; import CloudProviders from './CloudProviders.jsx'; +import CloudProviderSelector from './CloudProviderSelector.jsx'; import SavedSessions from './SavedSessions.jsx'; import ServerTabCustom from './ServerTabCustom.jsx'; import SessionStyles from './Session.module.css'; From ea59dcd1b5dbef19b36195fdd0d50cdd29aca50f Mon Sep 17 00:00:00 2001 From: losingle Date: Thu, 17 Apr 2025 23:42:43 +0800 Subject: [PATCH 07/12] Fix lint issues in Session component --- app/common/public/locales/de/translation.json | 3 +-- .../public/locales/es-ES/translation.json | 3 +-- app/common/public/locales/fr/translation.json | 3 +-- app/common/public/locales/ja/translation.json | 3 +-- app/common/public/locales/ko/translation.json | 3 +-- app/common/public/locales/ru/translation.json | 3 +-- .../public/locales/zh-CN/translation.json | 3 +-- .../public/locales/zh-TW/translation.json | 3 +-- .../renderer/components/Session/Session.jsx | 21 +++++++++++-------- 9 files changed, 20 insertions(+), 25 deletions(-) diff --git a/app/common/public/locales/de/translation.json b/app/common/public/locales/de/translation.json index 1d0ab228b6..bfccfa9f25 100644 --- a/app/common/public/locales/de/translation.json +++ b/app/common/public/locales/de/translation.json @@ -291,6 +291,5 @@ "AccessToken": "AccessToken", "Token": "Token", "Key": "Key", - "Secret": "Geheimnis", - "Close tab": "Tab schließen" + "Secret": "Geheimnis" } diff --git a/app/common/public/locales/es-ES/translation.json b/app/common/public/locales/es-ES/translation.json index 7f24cdcbfb..fda0721e9f 100644 --- a/app/common/public/locales/es-ES/translation.json +++ b/app/common/public/locales/es-ES/translation.json @@ -291,6 +291,5 @@ "AccessToken": "AccessToken", "Token": "Token", "Key": "Key", - "Secret": "Secreto", - "Close tab": "Cerrar pestaña" + "Secret": "Secreto" } diff --git a/app/common/public/locales/fr/translation.json b/app/common/public/locales/fr/translation.json index 1832a01602..119ef09863 100644 --- a/app/common/public/locales/fr/translation.json +++ b/app/common/public/locales/fr/translation.json @@ -291,6 +291,5 @@ "AccessToken": "AccessToken", "Token": "Token", "Key": "Key", - "Secret": "Secret", - "Close tab": "Fermer l'onglet" + "Secret": "Secret" } diff --git a/app/common/public/locales/ja/translation.json b/app/common/public/locales/ja/translation.json index 2772ff43e8..d33aba8e26 100644 --- a/app/common/public/locales/ja/translation.json +++ b/app/common/public/locales/ja/translation.json @@ -291,6 +291,5 @@ "AccessToken": "AccessToken", "Token": "Token", "Key": "Key", - "Secret": "シークレット", - "Close tab": "タブを閉じる" + "Secret": "シークレット" } diff --git a/app/common/public/locales/ko/translation.json b/app/common/public/locales/ko/translation.json index 17ef4ba702..776212a3fb 100644 --- a/app/common/public/locales/ko/translation.json +++ b/app/common/public/locales/ko/translation.json @@ -291,6 +291,5 @@ "AccessToken": "AccessToken", "Token": "Token", "Key": "Key", - "Secret": "시크릿", - "Close tab": "탭 닫기" + "Secret": "시크릿" } diff --git a/app/common/public/locales/ru/translation.json b/app/common/public/locales/ru/translation.json index 264870ce69..b9b5326eac 100644 --- a/app/common/public/locales/ru/translation.json +++ b/app/common/public/locales/ru/translation.json @@ -291,6 +291,5 @@ "AccessToken": "AccessToken", "Token": "Token", "Key": "Key", - "Secret": "Секрет", - "Close tab": "Закрыть вкладку" + "Secret": "Секрет" } diff --git a/app/common/public/locales/zh-CN/translation.json b/app/common/public/locales/zh-CN/translation.json index aa4dffa697..4407434c1e 100644 --- a/app/common/public/locales/zh-CN/translation.json +++ b/app/common/public/locales/zh-CN/translation.json @@ -289,6 +289,5 @@ "AccessToken": "访问令牌", "Token": "令牌", "Key": "密钥", - "Secret": "密钥", - "Close tab": "关闭标签页" + "Secret": "密钥" } diff --git a/app/common/public/locales/zh-TW/translation.json b/app/common/public/locales/zh-TW/translation.json index 7077d12ea7..7d852768d5 100644 --- a/app/common/public/locales/zh-TW/translation.json +++ b/app/common/public/locales/zh-TW/translation.json @@ -291,6 +291,5 @@ "AccessToken": "AccessToken", "Token": "Token", "Key": "Key", - "Secret": "密鑰", - "Close tab": "關閉標籤頁" + "Secret": "密鑰" } diff --git a/app/common/renderer/components/Session/Session.jsx b/app/common/renderer/components/Session/Session.jsx index ae8b5ae18c..f7e2edf7ff 100644 --- a/app/common/renderer/components/Session/Session.jsx +++ b/app/common/renderer/components/Session/Session.jsx @@ -6,14 +6,19 @@ import {useNavigate} from 'react-router'; import {BUTTON} from '../../constants/antd-types'; import {LINKS} from '../../constants/common'; -import {ADD_CLOUD_PROVIDER_TAB_KEY, SERVER_TYPES, SESSION_BUILDER_TABS} from '../../constants/session-builder'; +import { + ADD_CLOUD_PROVIDER_TAB_KEY, + SERVER_TYPES, + SESSION_BUILDER_TABS, +} from '../../constants/session-builder'; import {ipcRenderer, openLink} from '../../polyfills'; import {log} from '../../utils/logger'; + import AdvancedServerParams from './AdvancedServerParams.jsx'; import AttachToSession from './AttachToSession.jsx'; import CapabilityEditor from './CapabilityEditor.jsx'; -import CloudProviders from './CloudProviders.jsx'; import CloudProviderSelector from './CloudProviderSelector.jsx'; +import CloudProviders from './CloudProviders.jsx'; import SavedSessions from './SavedSessions.jsx'; import ServerTabCustom from './ServerTabCustom.jsx'; import SessionStyles from './Session.module.css'; @@ -65,9 +70,9 @@ const Session = (props) => { key: 'closeTab', label: t('Close tab'), onClick: () => handleCloseTab(tabKey), - disabled: tabKey === SERVER_TYPES.REMOTE - } - ] + disabled: tabKey === SERVER_TYPES.REMOTE, + }, + ], }); const handleContextMenu = (e) => { @@ -128,7 +133,7 @@ const Session = (props) => { key: SERVER_TYPES.REMOTE, children: , }, - ..._(visibleProviders).map((providerName) => { + ..._.map(visibleProviders, (providerName) => { const provider = CloudProviders[providerName]; if (!provider) { return true; @@ -136,9 +141,7 @@ const Session = (props) => { return { label: ( -
handleContextMenu(e)}> - {provider.tabhead()} -
+
handleContextMenu(e)}>{provider.tabhead()}
), key: providerName, From dc01bea4a625ec1f98119ae2b2e2fe0bf9a5df16 Mon Sep 17 00:00:00 2001 From: losingle Date: Thu, 17 Apr 2025 23:45:14 +0800 Subject: [PATCH 08/12] Fix lint issues in Session component --- app/common/renderer/components/Session/Session.jsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/common/renderer/components/Session/Session.jsx b/app/common/renderer/components/Session/Session.jsx index f7e2edf7ff..58a7c27010 100644 --- a/app/common/renderer/components/Session/Session.jsx +++ b/app/common/renderer/components/Session/Session.jsx @@ -13,12 +13,11 @@ import { } from '../../constants/session-builder'; import {ipcRenderer, openLink} from '../../polyfills'; import {log} from '../../utils/logger'; - import AdvancedServerParams from './AdvancedServerParams.jsx'; import AttachToSession from './AttachToSession.jsx'; import CapabilityEditor from './CapabilityEditor.jsx'; -import CloudProviderSelector from './CloudProviderSelector.jsx'; import CloudProviders from './CloudProviders.jsx'; +import CloudProviderSelector from './CloudProviderSelector.jsx'; import SavedSessions from './SavedSessions.jsx'; import ServerTabCustom from './ServerTabCustom.jsx'; import SessionStyles from './Session.module.css'; From f5367f7fcef21e60bd73f5cc4a1700f54ae38f4b Mon Sep 17 00:00:00 2001 From: losingle Date: Thu, 17 Apr 2025 23:51:45 +0800 Subject: [PATCH 09/12] Fix i18n --- app/common/public/locales/de/translation.json | 2 +- app/common/public/locales/es-ES/translation.json | 2 +- app/common/public/locales/ja/translation.json | 2 +- app/common/public/locales/ko/translation.json | 2 +- app/common/public/locales/ru/translation.json | 2 +- app/common/public/locales/zh-TW/translation.json | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/common/public/locales/de/translation.json b/app/common/public/locales/de/translation.json index bfccfa9f25..1110352cc5 100644 --- a/app/common/public/locales/de/translation.json +++ b/app/common/public/locales/de/translation.json @@ -291,5 +291,5 @@ "AccessToken": "AccessToken", "Token": "Token", "Key": "Key", - "Secret": "Geheimnis" + "Secret": "Secret" } diff --git a/app/common/public/locales/es-ES/translation.json b/app/common/public/locales/es-ES/translation.json index fda0721e9f..4c303cba9d 100644 --- a/app/common/public/locales/es-ES/translation.json +++ b/app/common/public/locales/es-ES/translation.json @@ -291,5 +291,5 @@ "AccessToken": "AccessToken", "Token": "Token", "Key": "Key", - "Secret": "Secreto" + "Secret": "Secret" } diff --git a/app/common/public/locales/ja/translation.json b/app/common/public/locales/ja/translation.json index d33aba8e26..243db9bcb5 100644 --- a/app/common/public/locales/ja/translation.json +++ b/app/common/public/locales/ja/translation.json @@ -291,5 +291,5 @@ "AccessToken": "AccessToken", "Token": "Token", "Key": "Key", - "Secret": "シークレット" + "Secret": "Secret" } diff --git a/app/common/public/locales/ko/translation.json b/app/common/public/locales/ko/translation.json index 776212a3fb..4856ce0fdf 100644 --- a/app/common/public/locales/ko/translation.json +++ b/app/common/public/locales/ko/translation.json @@ -291,5 +291,5 @@ "AccessToken": "AccessToken", "Token": "Token", "Key": "Key", - "Secret": "시크릿" + "Secret": "Secret" } diff --git a/app/common/public/locales/ru/translation.json b/app/common/public/locales/ru/translation.json index b9b5326eac..55f227c00d 100644 --- a/app/common/public/locales/ru/translation.json +++ b/app/common/public/locales/ru/translation.json @@ -291,5 +291,5 @@ "AccessToken": "AccessToken", "Token": "Token", "Key": "Key", - "Secret": "Секрет" + "Secret": "Secret" } diff --git a/app/common/public/locales/zh-TW/translation.json b/app/common/public/locales/zh-TW/translation.json index 7d852768d5..6f9af6c635 100644 --- a/app/common/public/locales/zh-TW/translation.json +++ b/app/common/public/locales/zh-TW/translation.json @@ -291,5 +291,5 @@ "AccessToken": "AccessToken", "Token": "Token", "Key": "Key", - "Secret": "密鑰" + "Secret": "Secret" } From f801c7e231b79752a6f3838145707b366d5a76ad Mon Sep 17 00:00:00 2001 From: losingle Date: Thu, 17 Apr 2025 23:53:09 +0800 Subject: [PATCH 10/12] Fix i18n --- .../public/locales/zh-CN/translation.json | 204 +++++++++--------- 1 file changed, 103 insertions(+), 101 deletions(-) diff --git a/app/common/public/locales/zh-CN/translation.json b/app/common/public/locales/zh-CN/translation.json index 4407434c1e..75bc866600 100644 --- a/app/common/public/locales/zh-CN/translation.json +++ b/app/common/public/locales/zh-CN/translation.json @@ -18,16 +18,16 @@ "Bring All to Front": "前置全部窗口", "Help": "帮助", "Appium Documentation": "Appium 文档", - "Inspector Documentation": "检查器文档", - "Appium Discussion Forum": "Appium 论坛", + "Inspector Documentation": "Inspector Documentation", + "Appium Discussion Forum": "Appium论坛", "Report Issues": "报告问题", - "About Appium Inspector": "关于 Appium Inspector", - "showAppInfo": "应用版本:{{appVersion}}\nElectron:{{electronVersion}}\nNode.js:{{nodejsVersion}}\n", + "About Appium Inspector": "关于Appium Inspector", + "showAppInfo": "App Version: {{appVersion}}\nElectron: {{electronVersion}}\nNode.js: {{nodejsVersion}}\n", "Improve Translations": "帮助我们翻译", "Check for Updates…": "检查更新", "File": "文件", "New Window": "新窗口", - "Hide Appium Inspector": "隐藏 Appium Inspector", + "Hide Appium Inspector": "隐藏Appium Inspector", "Hide Others": "隐藏其他窗口", "Show All": "显示全部窗口", "Quit Appium Inspector": "退出 Appium Inspector", @@ -41,13 +41,13 @@ "Save Server Arguments Preset": "保存服务器预设参数", "Save": "保存", "Cancel": "取消", - "updateDetails": "发布日期:{{pubDate}}\n\n版本注释:{{notes}}", + "updateDetails": "发布日期: {{pubDate}}\n\n版本注释: {{notes}}", "appiumIsAvailable": "Appium Inspector {{name}} 可用", "updateIsBeingDownloaded": "更新正在下载。完成后将再次通知您", - "updateIsDownloaded": "Appium Inspector {{releaseName}} 已经下载。必须重新启动以应用更新(注意:它可能需要几分钟时间,以便安装并重启)", - "updateDownloadFailed": "下载更新失败。原因:{{message}}", - "OK": "确定", - "Install Now": "立即安装", + "updateIsDownloaded": "Appium Inspector {{releaseName}} 已经下载。必须重新启动以应用更新(注意:它可能需要几分钟时间,以便安装并重启)", + "updateDownloadFailed": "下载更新失败。原因: {{message}}", + "OK": "OK", + "Install Now": "立即安装​​​​​​​", "Install Later": "稍后安装", "Update Download Started": "更新下载开始", "No update available": "没有可用的更新", @@ -65,18 +65,18 @@ "frameworkNotSupported": "框架 \"{{framework}}\" 不受支持", "findElementFailure": "找不到 '{{methodName}}' 的元素。请刷新页面并重试。", "Could not start session": "无法启动会话", - "couldNotConnect": "无法连接到 Appium 服务器: URL '{{url}}'。请检查服务器是否正在运行 并且 URL 是否正确 (正确的 URLs 可以在 Appium 的服务器日志开头中找到)。如果您使用的是 Inspector 的 web 版本,确保服务器以 '--allow-cors' 选项启动", - "Invalid URL:": "无效链接:", - "experitestAccessKey": "Experitest 访问密钥", - "experitestUrl": "Experitest 服务器地址", - "locatorStrategy": "定位策略:", + "couldNotConnect": "无法连接到 Appium 服务器: URL '{{url}}'. 请检查服务器是否正在运行 并且 URL 是否正确 (正确的 URLs 可以在Appium的服务器日志开头中找到). 如果你使用的是Inspector的web版本,确保服务器以'--allow-cors'选项启动", + "Invalid URL:": "无效链接", + "experitestAccessKey": "AccessKey", + "experitestUrl": "Url", + "locatorStrategy": "定位策略:", "selector": "选择器:", - "couldNotObtainScreenshot": "无法获取屏幕截图:{{screenshotError}}", + "couldNotObtainScreenshot": "无法获取屏幕截图: {{screenshotError}}", "selectElementInSource": "选择一个要开始的源元素。", - "Press Home Button": "主页", + "Press Home Button": "按主页按钮", "Execute Siri Command": "执行 Siri 命令", - "Press Back Button": "返回", - "Press App Switch Button": "应用切换", + "Press Back Button": "按返回按钮", + "Press App Switch Button": "按下应用切换按钮", "Command": "Command 键", "Show Element Handles": "显示元素处理器", "Hide Element Handles": "隐藏元素处理器", @@ -84,8 +84,8 @@ "Tap/Swipe By Coordinates": "根据坐标点击/滑动", "Download Screenshot": "下载屏幕截图", "Back": "返回", - "Start Refreshing Source": "开始实时刷新", - "Pause Refreshing Source": "暂停实时刷新", + "Start Refreshing Source": "开始刷新源", + "Pause Refreshing Source": "暂停刷新源", "refreshSource": "刷新源和屏幕截图", "Start Recording": "开始录制", "Pause Recording": "暂停录制", @@ -99,8 +99,10 @@ "Keep Session Running": "保持会话运行", "Quit Session": "退出会话", "Your session is about to expire": "您的会话即将过期", - "Enter Keys to Send": "输入要发送的文本", - "Send Keys": "发送文本", + "Enter Keys to Send": "输入要发送的密钥", + "Find and Select in Source": "选择文件", + "Clear": "清空", + "Send Keys": "发送密钥", "Done": "完成", "Search": "查找", "Show/Hide Boilerplate Code": "显示/隐藏样板代码", @@ -108,7 +110,7 @@ "Start this Kind of Session with Code": "用代码开始这个类别的会话", "Clear Actions": "清除操作", "Close Recorder": "关闭录制", - "enableRecordingAndPerformActions": "在应用程序标题栏中启用录制,然后执行一些操作以查看此处显示的代码", + "enableRecordingAndPerformActions": "Enable recording in the application header, then perform some actions to see code show up here", "Recorder": "录制", "Attribute": "属性", "Value": "值", @@ -117,45 +119,45 @@ "Time": "时间 (ms)", "Get Timing": "获取计时", "interactionsNotAvailable": "此元素的交互可能不可用", - "usingXPathNotRecommended": "不建议使用 XPath 定位器,这可能会导致脆弱的测试。请您的开发团队提供独特的辅助定位器!", + "usingXPathNotRecommended": "不建议使用 XPath 定位器,这可能会导致脆弱的测试。请您的开发团队提供独特的辅助定位器!", "noAdditionalContextsFound": "没有检测到其他环境", - "contextDropdownInfo": "检测到多个上下文;某些元素可能只有在切换到不同的上下文后才能访问。请注意,Appium Inspector 中的 webview 检查不如 Chrome 或 Safari 的开发者工具准确。更多信息,请参见:", - "idAutocompletionCanBeDisabled": "请求的 id 选择器没有包名前缀。此 Appium 会话启用了包名自动完成功能,这可能是找不到元素的原因。要禁用此行为,请将 'disableIdLocatorAutocompletion' 设置更改为 'true'。", - "missingAutomationNameForStrategies": "可能有更多的定位器策略。要查看它们,请在启动会话时添加名为“appium:automationName”的 capability 选项。注意,在 Appium 2 中这种能力是强制性的。", - "snapshotMaxDepthReached": "此元素位于最大源深度 {{selectedElementDepth}},因此不显示其子元素(如果有)。要显示它们,请将 'snapshotMaxDepth' 设置更改为大于 {{selectedElementDepth}} 的值。查看驱动程序文档以了解支持的最大值。", + "contextDropdownInfo": "Multiple contexts detected; certain elements might only be accessible after switching to a different context. Note that webview inspection in Appium Inspector is less accurate than the DevTools of Chrome or Safari. For more information, see:", + "idAutocompletionCanBeDisabled": "The requested id selector does not have a package name prefix. This Appium session has package name autocompletion enabled, which may be the reason why no elements were found. To disable this behavior, change the 'disableIdLocatorAutocompletion' setting to 'true'.", + "missingAutomationNameForStrategies": "可能有更多的定位器策略。要查看它们,请在启动会话时添加名为“appium:automationName”的capability选项。 注意,在Appium 2中这种能力是强制性的。", + "snapshotMaxDepthReached": "This element is located at the maximum source depth {{selectedElementDepth}}, therefore its child elements (if any) are not shown. To reveal them, change the 'snapshotMaxDepth' setting to a value greater than {{selectedElementDepth}}. Check your driver documentation for the maximum supported value.", "Tap": "点击", "Gathering initial app source…": "收集初始应用源…", - "couldNotObtainSource": "无法获取源代码:{{errorMsg}}", + "couldNotObtainSource": "无法获取源代码: {{errorMsg}}", "iOS": "iOS", "Android": "Android", - "desiredCapabilitiesDocumentation": "Capabilities 文档", + "desiredCapabilitiesDocumentation": "Capabilities文档", "startSession": "启动会话", "saveAs": "另存为...", "attachToSession": "附加到会话", "selectedElement": "选定的元素", "unnamed": "(未命名)", "No Description": "暂无描述", - "couldNotFindEntryWithId": "找不到 ID 为 {{id}} 的条目", + "couldNotFindEntryWithId": "Could not find an entry with ID {{id}}", "couldNotFindAnyElements": "找不到任何元素", "elementsCount": "查找到的元素", - "xCoordinate": "X:{{x}}", - "yCoordinate": "Y:{{y}}", + "xCoordinate": "X: {{x}}", + "yCoordinate": "Y: {{y}}", "SauceLabs Data Center": "SauceLabs 数据中心", - "US-West": "US-West", - "US-East": "US-East", - "EU-Central": "EU-Central", + "US-West": "美国西部1", + "US-East": "美国西部4", + "EU-Central": "欧洲中部1", "proxyThroughSC": "通过 Sauce Connect 的 Selenium Relay 代理", "SSL": "SSL", "text": "文本", "boolean": "布尔值", "number": "数字", "JSON object": "JSON 对象", - "connectToExistingSessionInstructions": "如果您有上述服务器类型的已运行会话,则可以直接将检查器附加到该会话。", + "connectToExistingSessionInstructions": "如果您有上述服务器类型的已运行会话, 则可以直接将检查器附加到该会话。", "selectSessionIDInDropdown": "从以下下拉列表中选择会话 ID。", "allowUnauthorizedCerts": "允许未经授权的证书", "Use Proxy": "使用代理", - "JSON Representation": "JSON 表示", - "Capability Builder": "能力构建器", + "JSON Representation": "JSON表示", + "Capability Builder": "Capability Builder", "Saved Capability Sets": "已保存的能力集", "Attach to Session": "附加到会话…", "localhost": "本地主机", @@ -173,11 +175,11 @@ "Pcloudy Host": "Pcloudy 主机", "Pcloudy API Key": "Pcloudy API 密钥", "Add your token": "添加您的 Token", - "Perfecto Token": "Perfecto 令牌", + "Perfecto Token": "Perfecto Token", "Your Kobiton Username": "您的 Kobiton 用户名", "Kobiton Access Key": "Kobiton 访问密钥", "serverTabHeasdpinWebDriverURL": "HeadSpin Web Driver URL", - "sessionHeadspinWebDriverURLDescription": "使用自动配置路由从 HeadSpin UI 或 HeadSpin API 获取 URL", + "sessionHeadspinWebDriverURLDescription": "使用自动配置路由从 HeadSpin UI 或 HeadSpin API获取 URL", "Remote Host": "远程主机", "Remote Port": "远程端口", "Remote Path": "远程路径", @@ -188,45 +190,45 @@ "Bitbar API Key": "Bitbar API 密钥", "RemoteTestKit AccessToken": "RemoteTestKit 访问令牌", "RobotQA Token": "RobotQA 令牌", - "Add": "添加", + "Add": "Add", "Name": "名称", "Description": "描述", "Created": "已创建", "Actions": "操作", - "enterYourSessionId": "在此输入您的会话 ID", + "enterYourSessionId": "在此输入您的会话ID", "Proxy URL": "代理 URL", "Source": "源", "Commands": "命令", "Execute Commands": "执行命令", - "Gestures": "手势", - "Gesture Builder": "手势构建器", - "Saved Gestures": "已保存的手势", - "Create New Gesture": "创建新手势", - "Upload Gesture File": "上传手势文件", - "gesturesDescription": "在此创建、保存和执行自定义手势。手势与 W3C WebDriver Actions API 中的动作链相同。", + "Gestures": "Gestures", + "Gesture Builder": "Gesture Builder", + "Saved Gestures": "Saved Gestures", + "Create New Gesture": "Create New Gesture", + "Upload Gesture File": "Upload Gesture File", + "gesturesDescription": "Create, save, and execute custom gestures here. Gestures are identical to action chains in the W3C WebDriver Actions API.", "Session Information": "会话信息", "Execute Command": "执行命令", - "commandsDescription": "使用当前 Appium 驱动程序运行各种命令。请注意,并非所有驱动程序都支持所有命令。", - "showMoveActionCoordsInPercentage": "以屏幕尺寸百分比显示移动动作的坐标", - "showMoveActionCoordsInPixels": "以像素显示移动动作的坐标", - "toggleMoveActionCoordPicker": "通过点击截图切换设置坐标", + "commandsDescription": "Run various commands using the current Appium driver. Note that not all drivers support all commands.", + "showMoveActionCoordsInPercentage": "Show Coordinates of Move Actions in Screen Dimension Percentages", + "showMoveActionCoordsInPixels": "Show Coordinates of Move Actions in Pixels", + "toggleMoveActionCoordPicker": "Toggle Setting Coordinates via Clicking on Screenshot", "Action Type": "操作类型", - "Pointer Up": "指针抬起", - "Pointer Down": "指针按下", + "Pointer Up": "Pointer Up", + "Pointer Down": "Pointer Down", "Pause": "暂停", "Move": "移动", "Action Type Not Defined": "操作类型未定义", "Duration": "期限", "Button": "按钮", - "Untitled Gesture": "未命名手势", + "Untitled Gesture": "Untitled Gesture", "Add Description": "添加描述", - "Gesture saved": "手势已保存", - "Gesture saved as": "手势已保存为 '{{gestureName}}'", - "Duplicate pointer names are not allowed": "不允许重复的指针名称", + "Gesture saved": "Gesture saved", + "Gesture saved as": "Gesture saved as '{{gestureName}}'", + "Duplicate pointer names are not allowed": "Duplicate pointer names are not allowed", "Left": "左方向键", "Right": "右方向键", "Play": "播放", - "Download": "下载", + "Download": "Download", "Save Capability Set As": "保存能力设置为…", "Edit Raw JSON": "直接编辑 JSON", "Enter Parameters for:": "输入参数:", @@ -234,60 +236,60 @@ "App Management": "应用管理", "File Transfer": "文件传输", "Device Interaction": "设备交互", - "Session": "会话", + "Session": "Session会话", "Web": "Web", "Context": "上下文", "simulatorOnly": "模拟器/仅模拟器", - "minAndroidSDK": "最小的 Android SDK 版本", + "minAndroidSDK": "最小的Android SDK版本", "Error": "错误", - "findingElementInSourceFailed": "找不到指定的元素。当前应用程序来源或元素 ID 可能已经改变,或者可能有太多具有相同坐标的元素。", + "findingElementInSourceFailed": "找不到指定的元素。 当前应用程序来源或元素 ID 可能已经改变,或者可能有太多具有相同坐标的元素。", "callToMethodFailed": "调用 '{{methodName}}' 失败", "methodCallResult": "'{{methodName}}' 结果", - "TestingBot Key": "TestingBot 密钥", - "TestingBot Secret": "TestingBot 密钥", + "TestingBot Key": "TestingBot 键", + "TestingBot Secret": "TestingBot Secret", "Appium Server": "Appium 服务", "Select Cloud Providers": "选择云提供商", "Advanced Settings": "高级设置", - "Native App Mode": "原生应用模式", - "Web/Hybrid App Mode": "Web/混合应用模式", + "Native App Mode": "Native App Mode", + "Web/Hybrid App Mode": "Web/Hybrid App Mode", "autoAddPrefixes": "启动时自动添加必要的 Appium 供应商前缀", - "attachSessionNotRunning": "无法确认会话 {{attachSessId}} 在提供的服务器上运行。请在尝试再次附加到会话之前检查详细信息。", - "Mobitru WebDriver URL": "Mobitru WebDriver 网址", - "Mobitru Billing Unit": "Mobitru 计费单位", + "attachSessionNotRunning": "Could not confirm that session {{attachSessId}} is running on the provided server. Please check details before trying to attach to the session again.", + "Mobitru WebDriver URL": "Mobitru WebDriver URL", + "Mobitru Billing Unit": "Mobitru Billing Unit", "Mobitru Access Key": "Mobitru 访问密钥", - "Session URL": "Session URL", - "Server Details": "Server Details", - "Session Length": "Session Length", - "Session Details": "Session Details", - "Currently Active App ID": "Currently Active App ID", + "Session URL": "会话URL", + "Server Details": "服务器详细信息", + "Session Length": "会话长度", + "Session Details": "会话详情", + "Currently Active App ID": "当前活动的应用程序 ID", "confirmDeletion": "您确定要删除吗?", "Copied!": "复制成功!", - "Error Fetching Session URL": "获取会话 URL 时出错", + "Error Fetching Session URL": "获取会话URL 时出错", "noResultsFound": "未找到结果", - "invalidCapType": "无效的 capability 类型:{{type}}", + "invalidCapType": "无效的capability类型: {{type}}", "whitespaceDetected": "文本开始和/或以空格结束", - "duplicateCapabilityNameError": "已存在同名的能力设置", - "errorLoadingGestures": "加载手势时出错", - "unableToUploadGestureFiles": "无法从以下文件上传手势:", - "gestureEmptyTickError": "动作应该有有效的时间点", - "gestureInvalidEventError": "无效的事件类型 '{{invalidEvent}}'。有效值为 {{validEvents}}", - "gestureRequiredFieldsError": "'{{eventType}}' 事件需要 '{{fields}}' 值", - "gestureNameCannotBeEmptyError": "手势名称不能为空", - "gestureInvalidJsonError": "无效的 JSON 文件。无法解析文件内容", - "gestureImportedFrom": "已从 '{{fileName}}' 导入手势", - "invalidSessionFile": "无效的会话文件", - "TV Labs API Key": "TV Labs API 密钥", - "TestcribeAPIKey": "Testcribe API 密钥", - "sessionTestcribeApiKeyDescription": "你可以从 https://app.testcribe.com/settings/apiKeys 获取你的 API 密钥", - "missingVendorProperties": "请提供以下 {{vendorName}} 的服务器详细信息:{{vendorProps}}", - "Username": "用户名", + "duplicateCapabilityNameError": "A capability set with the same name already exists", + "errorLoadingGestures": "Error loading gestures", + "unableToUploadGestureFiles": "Could not upload gestures from below files:", + "gestureEmptyTickError": "Actions should have valid ticks", + "gestureInvalidEventError": "Invalid event type '{{invalidEvent}}'. Valid values are {{validEvents}}", + "gestureRequiredFieldsError": "Values '{{fields}}' are required for '{{eventType}}' event", + "gestureNameCannotBeEmptyError": "Gesture name cannot be empty", + "gestureInvalidJsonError": "Invalid JSON file. Unable to parse the file content", + "gestureImportedFrom": "Gesture imported from '{{fileName}}'", + "invalidSessionFile": "Invalid session file", + "TV Labs API Key": "TV Labs API Key", + "TestcribeAPIKey": "Testcribe API Key", + "sessionTestcribeApiKeyDescription": "You can get your api key from https://app.testcribe.com/settings/apiKeys", + "missingVendorProperties": "Please provide the following server details for {{vendorName}}: {{vendorProps}}", + "Username": "Username", "URL": "URL", "WebDriver URL": "WebDriver URL", - "API Key": "API 密钥", - "Access Key": "访问密钥", - "SecurityToken": "安全令牌", - "AccessToken": "访问令牌", - "Token": "令牌", - "Key": "密钥", - "Secret": "密钥" -} + "API Key": "API Key", + "Access Key": "Access Key", + "SecurityToken": "SecurityToken", + "AccessToken": "AccessToken", + "Token": "Token", + "Key": "Key", + "Secret": "Secret" +} \ No newline at end of file From c0f2df55c12bb970f8b636cc97211c1b2dcc62bb Mon Sep 17 00:00:00 2001 From: losingle Date: Thu, 17 Apr 2025 23:58:31 +0800 Subject: [PATCH 11/12] Fix code style issues --- app/common/public/locales/zh-CN/translation.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/common/public/locales/zh-CN/translation.json b/app/common/public/locales/zh-CN/translation.json index 75bc866600..eaedea1e1c 100644 --- a/app/common/public/locales/zh-CN/translation.json +++ b/app/common/public/locales/zh-CN/translation.json @@ -292,4 +292,4 @@ "Token": "Token", "Key": "Key", "Secret": "Secret" -} \ No newline at end of file +} From aa0ce39e410d9cfb2d0c9d2b249f18875dfcf621 Mon Sep 17 00:00:00 2001 From: losingle Date: Fri, 18 Apr 2025 00:23:57 +0800 Subject: [PATCH 12/12] Fix tab switch --- .../components/Session/SavedSessions.jsx | 4 ++-- .../renderer/components/Session/Session.jsx | 19 +++++++++++++++---- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/app/common/renderer/components/Session/SavedSessions.jsx b/app/common/renderer/components/Session/SavedSessions.jsx index fdb06f90a9..b3a617811e 100644 --- a/app/common/renderer/components/Session/SavedSessions.jsx +++ b/app/common/renderer/components/Session/SavedSessions.jsx @@ -27,7 +27,7 @@ const getSessionById = (savedSessions, id, t) => { }; const SavedSessions = (props) => { - const {savedSessions, deleteSavedSession, capsUUID, switchTabs, t} = props; + const {savedSessions, deleteSavedSession, capsUUID, handleSwitchTabs, t} = props; const handleCapsAndServer = (uuid) => { const { @@ -83,7 +83,7 @@ const SavedSessions = (props) => { icon={} onClick={() => { handleCapsAndServer(record.key); - switchTabs(SESSION_BUILDER_TABS.CAPS_BUILDER); + handleSwitchTabs(SESSION_BUILDER_TABS.CAPS_BUILDER); }} /> diff --git a/app/common/renderer/components/Session/Session.jsx b/app/common/renderer/components/Session/Session.jsx index 58a7c27010..e1a8fed779 100644 --- a/app/common/renderer/components/Session/Session.jsx +++ b/app/common/renderer/components/Session/Session.jsx @@ -1,7 +1,7 @@ import {LinkOutlined} from '@ant-design/icons'; import {Badge, Button, Dropdown, Spin, Tabs} from 'antd'; import _ from 'lodash'; -import {useEffect} from 'react'; +import {useEffect, useState} from 'react'; import {useNavigate} from 'react-router'; import {BUTTON} from '../../constants/antd-types'; @@ -45,6 +45,7 @@ const Session = (props) => { } = props; const navigate = useNavigate(); + const [activeTab, setActiveTab] = useState(SESSION_BUILDER_TABS.CAPS_BUILDER); const isAttaching = serverType === 'attach'; @@ -57,6 +58,16 @@ const Session = (props) => { await changeServerType(tab); }; + const handleTabChange = (tab) => { + setActiveTab(tab); + switchTabs(tab); + }; + + const handleSwitchTabs = (tab) => { + switchTabs(tab); + setActiveTab(tab); + }; + const loadNewSession = async (caps, attachSessId = null) => { if (await newSession(_.cloneDeep(caps), attachSessId)) { navigate('/inspector', {replace: true}); @@ -157,8 +168,8 @@ const Session = (props) => { { key: SESSION_BUILDER_TABS.SAVED_CAPS, className: SessionStyles.scrollingTab, disabled: savedSessions.length === 0, - children: , + children: , }, { label: t('Attach to Session'),