From 70f10e741c9ba0416f3b41eeaf09f690a1a189be Mon Sep 17 00:00:00 2001 From: Jaw <53564781+jaw52@users.noreply.github.com> Date: Wed, 28 Oct 2026 12:18:46 +0800 Subject: [PATCH] fix(i18n): Translate the remaining UI text (Git, hierarchy, pull requests, dialogs, aria labels) (#114) Hard-coded UI text, titles and aria-labels in about 110 components (Git panels, hierarchy, pull requests, dialogs, settings, welcome) now go through tx; spliced fragments became whole sentences (fileCount, noneFoundLabel, hierarchyTitle) and pull request states use keyed messages. 225 zh entries added, stale fragment entries removed. Also: tx used as a tag without interpolations (tx`No checks`) now looks the text up exactly instead of as a template, so it is translated like tx("No checks"); the text-catalog test checks such tags as plain literals. Check and test counts reuse the existing "{count} passed" / "{failed} failing" entries. Claude-Session: https://claude.ai/code/session_01VUYsdXA2nkF5v6zsC93dpn Co-authored-by: jaw52 <53564781+jaw52@users.noreply.github.com> --- NOTICE | 4 + THIRD_PARTY_LICENSES.md | 39 +++ src/editor/core/view/Banner.tsx | 3 +- src/editor/core/view/EditorArea.tsx | 2 +- src/editor/core/view/GotoLineDialog.tsx | 3 +- src/editor/core/view/NavBarPopup.tsx | 5 +- src/editor/core/view/StatusItems.tsx | 5 +- src/editor/lsp/Popups.tsx | 9 +- src/features/agents/SessionEditor.tsx | 6 +- src/features/analysis/AnalysisDialogs.tsx | 6 +- src/features/analysis/DuplicatesView.tsx | 7 +- .../build-tools/DependencyAnalyzer.tsx | 6 +- src/features/build/BuildView.tsx | 5 +- src/features/code-insight/HierarchyView.tsx | 10 +- src/features/code-insight/UsagesPopup.tsx | 12 +- src/features/code-insight/hierarchy.ts | 17 +- src/features/database/DataDialogs.tsx | 2 +- src/features/database/DataView.tsx | 6 +- src/features/database/DatabaseView.tsx | 7 +- src/features/database/Grid.tsx | 3 +- src/features/database/ObjectDialogs.tsx | 9 +- src/features/database/ResultsView.tsx | 9 +- src/features/database/SourceDialog.tsx | 8 +- src/features/database/TableEditor.tsx | 2 +- src/features/debugger/ui/DebugToolWindow.tsx | 20 +- src/features/debugger/ui/Overlays.tsx | 30 +- src/features/deployment/RemoteHostView.tsx | 2 +- src/features/github/PullRequestsView.tsx | 40 +-- src/features/github/dialogs.tsx | 6 +- src/features/github/github.test.ts | 2 +- src/features/github/model.ts | 52 ++-- src/features/http-client/HttpClientView.tsx | 8 +- src/features/macros/MacrosDialog.tsx | 2 +- src/features/perf/MemoryStatus.tsx | 2 +- src/features/perf/PerfOverlay.tsx | 5 +- src/features/plugins/PluginsPage.tsx | 26 +- src/features/profiler/ProfilerView.tsx | 5 +- .../project-tree/FileRefactorDialogs.tsx | 9 +- .../project-tree/RefactoringPreview.tsx | 5 +- src/features/run/ConfigChooser.tsx | 14 +- src/features/run/ConsoleView.tsx | 7 +- src/features/run/EditConfigsDialog.tsx | 7 +- src/features/run/RunView.tsx | 4 +- src/features/run/TestTreeView.tsx | 10 +- .../search/bookmarks/BookmarksView.tsx | 2 +- src/features/search/find/FindInFiles.tsx | 12 +- src/features/search/find/FindToolWindow.tsx | 12 +- src/features/search/find/parts.tsx | 5 +- src/features/search/recent/RecentPopups.tsx | 25 +- .../search/structure/StructureView.tsx | 9 +- src/features/services/ServicesTree.tsx | 4 +- src/features/services/docker.tsx | 5 +- src/features/settings/components/Form.tsx | 4 +- .../settings/dialog/SettingsDialog.tsx | 2 +- src/features/settings/keymap/KeymapPage.tsx | 2 +- .../languages/AddInterpreterDialog.tsx | 9 +- .../settings/languages/DownloadJdkDialog.tsx | 4 +- .../languages/ProjectStructurePage.tsx | 12 +- .../languages/PythonInterpreterPage.tsx | 12 +- src/features/settings/pages/FileTypes.tsx | 8 +- src/features/settings/pages/behavior.tsx | 8 +- src/features/settings/pages/deployment.tsx | 12 +- .../settings/pages/editor/codeStyle.tsx | 15 +- .../settings/pages/editor/codeStyleScheme.tsx | 3 +- .../settings/pages/editor/colorScheme.tsx | 6 +- src/features/settings/pages/editor/font.tsx | 2 +- .../settings/pages/editor/general.tsx | 5 +- src/features/settings/pages/runTargets.tsx | 6 +- src/features/settings/pages/ssh.tsx | 6 +- src/features/settings/pages/tools.tsx | 4 +- src/features/settings/pages/vcs.tsx | 13 +- .../templates/emmet/UpdateTagDialog.tsx | 3 +- .../templates/files/NewFileDialog.tsx | 2 +- src/features/templates/popup/Chooser.tsx | 3 +- .../templates/settings/LiveTemplatesPage.tsx | 11 +- .../templates/settings/PostfixPage.tsx | 4 +- src/features/terminal/FindBar.tsx | 3 +- src/features/todo/TodoSettingsPage.tsx | 2 +- src/features/todo/TodoView.tsx | 2 +- src/features/tools/LanguageServersPage.tsx | 9 +- src/features/vcs/BranchWidget.tsx | 29 +- src/features/vcs/CommitView.tsx | 20 +- src/features/vcs/DiffEditor.tsx | 10 +- src/features/vcs/GitLog.tsx | 40 ++- src/features/vcs/HunkPopup.tsx | 3 +- src/features/vcs/LocalHistory.tsx | 8 +- src/features/vcs/MergeEditor.tsx | 12 +- src/features/vcs/branches.ts | 3 +- src/features/vcs/changeOps.tsx | 27 +- src/features/vcs/changelistsUi.tsx | 7 +- src/features/vcs/commitChecks.tsx | 17 +- src/features/vcs/conflictsUi.tsx | 7 +- src/features/vcs/dialogs.tsx | 10 +- src/features/vcs/gitMenuDialogs.tsx | 12 +- src/features/vcs/model.ts | 5 + src/features/vcs/operations.tsx | 8 +- src/features/vcs/patches.tsx | 6 +- src/features/vcs/rebase.tsx | 4 +- src/features/vcs/remoteUi.tsx | 16 +- src/features/vcs/shelf.tsx | 15 +- src/features/viewers/HexViewer.tsx | 9 +- src/features/viewers/ImageViewer.tsx | 5 +- .../viewers/markdown/MarkdownEditor.tsx | 5 +- src/features/vim/VimSettingsPage.tsx | 6 +- src/features/web/WebEditor.tsx | 5 +- src/features/welcome/CustomizePage.tsx | 3 +- src/features/welcome/ProjectPopup.tsx | 3 +- src/features/welcome/ProjectsPage.tsx | 8 +- src/features/welcome/RecentList.tsx | 4 +- src/features/welcome/WelcomeView.tsx | 4 +- src/platform/i18n.test.ts | 7 + src/platform/i18n.ts | 2 + src/platform/locales/en.json | 5 + src/platform/locales/text/zh.json | 271 +++++++++++++++--- src/platform/locales/textCatalog.test.ts | 4 +- src/platform/locales/zh.json | 5 + src/ui/Dialog.tsx | 8 +- src/ui/SourcePreview.tsx | 3 +- src/ui/Tabs.tsx | 4 +- src/workbench/StatusBar.tsx | 2 +- src/workbench/toolwindows/ToolWindows.tsx | 2 +- 121 files changed, 854 insertions(+), 457 deletions(-) diff --git a/NOTICE b/NOTICE index 0d6c0299..b6c2fe73 100644 --- a/NOTICE +++ b/NOTICE @@ -6,6 +6,10 @@ contributors as part of the IntelliJ Platform (https://github.com/JetBrains/inte https://github.com/JetBrains/intellij-plugins), licensed under the Apache License 2.0. Copyright 2000-2026 JetBrains s.r.o. and contributors. +Some Simplified Chinese UI terms follow the Visual Studio Code Simplified Chinese +language pack (https://github.com/microsoft/vscode-loc), Copyright (c) Microsoft +Corporation, licensed under the MIT License. + OpenIDEA is not affiliated with, endorsed by or sponsored by JetBrains s.r.o. IntelliJ and IntelliJ IDEA are trademarks of JetBrains s.r.o. diff --git a/THIRD_PARTY_LICENSES.md b/THIRD_PARTY_LICENSES.md index 8b25ee29..202e475b 100644 --- a/THIRD_PARTY_LICENSES.md +++ b/THIRD_PARTY_LICENSES.md @@ -250,3 +250,42 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ``` + + +## Chinese UI terminology from Visual Studio Code + +Some Simplified Chinese terms in `src/platform/locales/text/zh.json` follow the +wording of the Visual Studio Code Simplified Chinese language pack +([microsoft/vscode-loc](https://github.com/microsoft/vscode-loc), MIT), e.g. +"未跟踪" (untracked), "合并冲突" (merge conflicts), "当前" (current), "已修改" +(modified), "已过时" (outdated), "中止" (abort), "正在卸载" (uninstalling), +"深色" / "浅色" (dark / light) and "只读" (read-only). The remaining translations +are written for this project. + +``` +Visual Studio Code Localization Packs + +Copyright (c) Microsoft Corporation + +All rights reserved. + +MIT License + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE +``` diff --git a/src/editor/core/view/Banner.tsx b/src/editor/core/view/Banner.tsx index daa147df..c8891131 100644 --- a/src/editor/core/view/Banner.tsx +++ b/src/editor/core/view/Banner.tsx @@ -3,6 +3,7 @@ import { Icon, T } from "@/ui"; import { useEditorBanners, type EditorBannerContribution } from "@/workbench/contributions"; import { useDocMeta } from "../model/document"; import styles from "./EditorArea.module.css"; +import { tx } from "@/platform/i18n"; const TEXT = { binary: "This file appears to be binary and is shown read-only.", @@ -30,7 +31,7 @@ export function VirtualBanner({ decompiled, description }: { decompiled: boolean