fix(forge-panel): register all shipped locale dictionaries
This commit is contained in:
1 parent
a6883f4038
commit
2fa853870f
6 files changed
+1210
-4
No files matched your search
@@ -15,8 +15,8 @@
|
||||
en: d152484eb41ac6b4
|
||||
zh: 2f8a621b991260a1
|
||||
/deepseek-ai-dsh-experimental-client-ui-forge/use-this-package:
|
||||
en: 10cb328b8b92f077
|
||||
zh: 473121a22ce76dfb
|
||||
en: 675b24649622d158
|
||||
zh: 3c27fc1d7e20731f
|
||||
/deepseek-ai-dsh-experimental-client-ui-forge/understand-the-implementation:
|
||||
en: 0cb26601d077a723
|
||||
zh: af04ea90c3d3b704
|
||||
|
||||
@@ -27,6 +27,8 @@ This optional two-face package shows the change requests a Session created or pu
|
||||
|
||||
Enable the [forge bundle](../forge-bundle/README.md) on the Plugins page; it composes this package with the forge registry, the GitHub provider, the Session bindings, and its own [worktree service](../worktree/README.md).
|
||||
|
||||
Panel text follows the application language: Chinese, English, Japanese, Spanish, French, German, Russian, or Portuguese.
|
||||
|
||||
- **Worktree option** — on the New Session screen, Worktree sits at the right end of the row with the workspace and mode pickers. Checking it shows the base branch, the current branch by default; the menu lists recent local branches. The option is disabled, with the reason in its tooltip, outside a Git checkout, in a read-only Session, and when the checkout or its Git directory lies outside the Session's writable root, as for a project that is itself a linked worktree. Sending the first message hands it to the Session at once, and it waits there while the branch `dsh-<first 8 hexadecimal digits of the Session id>-<4 random hexadecimal digits>` is created from the base under the repository's `.agents/worktrees/` and its checkout becomes the Session's working directory; the message's turn starts once the worktree exists.
|
||||
- **Creation card** — while the worktree is created, a card above the composer shows the new branch and its two steps, creating the branch and checking out files; More details adds the branch and base. Cancel stops the attempt. After a stopped or failed attempt the message keeps waiting, and the card shows the reason of a failure: Retry tries again with a new branch name, and Continue without a worktree withdraws the request so the message goes on in the current checkout.
|
||||
- **Removed worktree** — when the worktree the Session works in has been removed outside the Session, a card above the composer says so, and a message sent meanwhile waits without starting its turn until the worktree is restored or left; the card then says that the message goes on afterwards. Restore worktree, also offered as Restore in the tab, checks the branch out again at the same directory, or creates the branch again at the commit it started from when the branch is gone too; while it runs, the card follows its two steps, preparing the worktree and checking out files, and the tab's Restore turns into a spinner. Continue in the project moves the Session to the source checkout. Meanwhile the tab's first row shows a warning glyph.
|
||||
|
||||
@@ -27,6 +27,8 @@ kind: "package-reference"
|
||||
|
||||
在插件页启用 [forge 套件](../forge-bundle/README.zh.md);它把本包与 forge 注册表、GitHub 提供方、Session 绑定以及它自己的 [worktree 服务](../worktree/README.zh.md)组合在一起。
|
||||
|
||||
面板文案跟随应用语言,支持中文、英文、日语、西班牙语、法语、德语、俄语和葡萄牙语。
|
||||
|
||||
- **工作树选项**——在新会话页面上,“工作树”位于工作区与模式选择器那一行的右端。勾选后显示基准分支,默认为当前分支;菜单列出最近的本地分支。不在 Git 检出中、Session 为只读,或检出及其 Git 目录不在 Session 的可写根内(例如项目本身就是链接 worktree)时,该选项不可用,提示中说明原因。发送第一条消息后,消息立即交给 Session 并在那里等待,同时从基准分支在仓库的 `.agents/worktrees/` 下创建分支 `dsh-<Session id 前 8 位十六进制数>-<4 位随机十六进制数>`,并把它的检出设为 Session 的工作目录;worktree 建好后这条消息的这一轮才开始。
|
||||
- **创建卡片**——创建 worktree 期间,输入框上方的卡片显示新分支以及“创建分支”“检出文件”两个步骤;“更多详情”会列出分支与基准。“取消”停止这次尝试。尝试被停止或失败后,消息继续等待,失败时卡片显示原因:“重试”换一个新分支名再试;“不使用工作树”撤回请求,消息在当前检出中继续发送。
|
||||
- **工作树已被删除**——Session 所在的 worktree 在 Session 之外被删除后,输入框上方的卡片会说明这一点;此期间发送的消息会等待、不开始这一轮,直到该 worktree 被恢复或离开,卡片也会说明消息之后会接着发送。“恢复工作树”(标签页中的“恢复”与之相同)在原目录重新检出该分支;分支也已删除时,从它开始时的提交重新创建分支;恢复期间卡片显示“准备工作树”“检出文件”两个步骤,标签页中的“恢复”变为加载状态。“在项目目录继续”把 Session 移回源检出。此期间标签页顶部一行显示警示图标。
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -22,7 +22,7 @@ import { ChangesTabTitle } from './ChangesTabTitle.tsx'
|
||||
import { ForgeTab, type ForgeTabInjected } from './ForgeTab.tsx'
|
||||
import { ForgeTabTitle } from './ForgeTabTitle.tsx'
|
||||
import { HeaderButton, type HeaderButtonInjected } from './HeaderButton.tsx'
|
||||
import { en, NS, zh, type ForgePanelKey } from './locales.ts'
|
||||
import { de, en, es, fr, ja, NS, pt, ru, zh, type ForgePanelKey } from './locales.ts'
|
||||
import {
|
||||
createNoticeSource, createPanelSource, createVisibilitySource, type PanelSource, type VisibilitySource,
|
||||
} from './source.ts'
|
||||
@@ -55,7 +55,7 @@ interface SessionStores {
|
||||
}
|
||||
|
||||
function registerUi(ctx: Context): void {
|
||||
ctx.effect(() => ctx.locale.register(NS, { zh, en }), 'forge-panel: dictionaries')
|
||||
ctx.effect(() => ctx.locale.register(NS, { zh, en, ja, es, fr, de, ru, pt }), 'forge-panel: dictionaries')
|
||||
const t = ctx.locale.bind(NS)
|
||||
const notices = createNoticeSource()
|
||||
const stores = new Map<SessionId, SessionStores>()
|
||||
|
||||
@@ -361,6 +361,8 @@ describe('mountForgePanel Session stores', () => {
|
||||
f.ctx.locale.addLanguage({ id: 'de', label: 'Deutsch', fallback: 'en' })
|
||||
f.ctx.locale.setLocale('de')
|
||||
expect(locale.getSnapshot()).toBe('de')
|
||||
expect(f.ctx.locale.bind(NS)('header.label')).toBe('Änderungsanfragen dieser Sitzung')
|
||||
expect(f.ctx.locale.bind(NS)('change.mergeTitle', { name: '#7', base: 'main' })).toBe('#7 in main zusammenführen')
|
||||
expect(changed).toHaveBeenCalled()
|
||||
unsubscribe()
|
||||
f.sessions.scope.mockReturnValue(undefined)
|
||||
|
||||
Reference in new issue
Block a user