diff --git a/config/scripts/locale-ko-key-overrides.json b/config/scripts/locale-ko-key-overrides.json index a005be8af87..a945381fd79 100644 --- a/config/scripts/locale-ko-key-overrides.json +++ b/config/scripts/locale-ko-key-overrides.json @@ -239,6 +239,30 @@ "auto.components.NewWorkspaceComposerModal.fa90f739a5": { "ko": "워크스페이스를 만들기 전에 프로젝트, 워크스페이스 이름, agent를 선택하세요." }, + "auto.components.PullRequestConfirmation.closeTitle": { + "ko": "PR #{{number}}을(를) 닫으시겠습니까?" + }, + "auto.components.PullRequestConfirmation.mergeLabel": { + "ko": "병합 커밋 생성" + }, + "auto.components.PullRequestConfirmation.mergeTitle": { + "ko": "병합 커밋을 생성하여 PR #{{number}}을(를) 병합하시겠습니까?" + }, + "auto.components.PullRequestConfirmation.rebaseLabel": { + "ko": "리베이스 및 병합" + }, + "auto.components.PullRequestConfirmation.rebaseTitle": { + "ko": "PR #{{number}}을(를) 리베이스하여 병합하시겠습니까?" + }, + "auto.components.PullRequestConfirmation.reopenTitle": { + "ko": "PR #{{number}}을(를) 다시 여시겠습니까?" + }, + "auto.components.PullRequestConfirmation.squashLabel": { + "ko": "스쿼시 및 병합" + }, + "auto.components.PullRequestConfirmation.squashTitle": { + "ko": "PR #{{number}}을(를) 스쿼시하여 병합하시겠습니까?" + }, "auto.components.PullRequestPage.00b7b82329": { "ko": "헤드 브랜치" }, diff --git a/src/renderer/src/components/github-item-dialog/land-pull-request/pr-actions-merge-menu.tsx b/src/renderer/src/components/github-item-dialog/land-pull-request/pr-actions-merge-menu.tsx index 110a3d44d8a..72fb7ff3535 100644 --- a/src/renderer/src/components/github-item-dialog/land-pull-request/pr-actions-merge-menu.tsx +++ b/src/renderer/src/components/github-item-dialog/land-pull-request/pr-actions-merge-menu.tsx @@ -14,6 +14,7 @@ import type { presentGitHubPRMergeState } from '@/components/github-pr-merge-sta import type { resolveGitHubPRMergeMethods } from '../../../../../shared/github/pull-request-merge-methods' import type { GitHubPRMergeMethod } from '../../../../../shared/github/pull-request-types' import { translate } from '@/i18n/i18n' +import { getPullRequestMergeMethodLabel } from '@/components/github/pull-request-confirmation-copy' export function PRActionsMergeMenu({ itemUrl, @@ -54,7 +55,7 @@ export function PRActionsMergeMenu({ )} {mergePresentation.autoMergeAction?.label ?? (mergePresentation.directMergeAvailable - ? mergeMethods.defaultLabel + ? getPullRequestMergeMethodLabel(mergeMethods.defaultMethod) : mergePresentation.label)} @@ -80,10 +81,10 @@ export function PRActionsMergeMenu({ )} {mergePresentation.autoMergeAction && } - {mergeMethods.methods.map(({ method, label }) => ( + {mergeMethods.methods.map((method) => ( onMerge(method)}> - {label} + {getPullRequestMergeMethodLabel(method)} ))} window.api.shell.openUrl(itemUrl)}> diff --git a/src/renderer/src/components/github-item-dialog/land-pull-request/pr-actions-panel.tsx b/src/renderer/src/components/github-item-dialog/land-pull-request/pr-actions-panel.tsx index 55d96eb0806..8586d20737b 100644 --- a/src/renderer/src/components/github-item-dialog/land-pull-request/pr-actions-panel.tsx +++ b/src/renderer/src/components/github-item-dialog/land-pull-request/pr-actions-panel.tsx @@ -12,14 +12,16 @@ import { getGitHubRuntimeRepoId } from '@/lib/github-source-runtime-context' import { presentGitHubPRMergeState } from '@/components/github-pr-merge-state' -import { - GITHUB_PR_MERGE_METHOD_LABELS, - resolveGitHubPRMergeMethods -} from '../../../../../shared/github/pull-request-merge-methods' +import { resolveGitHubPRMergeMethods } from '../../../../../shared/github/pull-request-merge-methods' import type { GitHubPRMergeMethod } from '../../../../../shared/github/pull-request-types' import type { GitHubWorkItem } from '../../../../../shared/github/work-item-types' import type { TaskSourceContext } from '../../../../../shared/task-source-context' import { translate } from '@/i18n/i18n' +import { + getPullRequestMergeConfirmationTitle, + getPullRequestMergeMethodLabel, + getPullRequestStateConfirmationTitle +} from '@/components/github/pull-request-confirmation-copy' import { assertTaskPageGitHubDialogStateAuthority } from '@/components/task-page/github/task-page-github-dialog-state-authority' import { resolvePullRequestRepo } from '@/components/github/github-work-item-identity' import { notifyWorkItemDetailsMutation } from '@/components/github/github-work-item-comment-mutations' @@ -95,11 +97,7 @@ export function PRActionsPanel({ ? translate('auto.components.GitHubItemDialog.4aecf121e7', 'Close') : translate('auto.components.GitHubItemDialog.8812225174', 'Reopen') const confirmed = await confirm({ - title: translate( - 'auto.components.GitHubItemDialog.03d7216d62', - '{{value0}} PR #{{value1}}?', - { value0: label, value1: item.number } - ), + title: getPullRequestStateConfirmationTitle(nextState, item.number), description: nextState === 'closed' ? translate( @@ -170,13 +168,9 @@ export function PRActionsPanel({ if (mergeDisabled) { return } - const label = GITHUB_PR_MERGE_METHOD_LABELS[method] + const label = getPullRequestMergeMethodLabel(method) const confirmed = await confirm({ - title: translate( - 'auto.components.GitHubItemDialog.03d7216d62', - '{{value0}} PR #{{value1}}?', - { value0: label, value1: item.number } - ), + title: getPullRequestMergeConfirmationTitle(method, item.number), description: translate( 'auto.components.GitHubItemDialog.a27ee5ca1a', 'This will update the pull request on GitHub.' diff --git a/src/renderer/src/components/github/pull-request-confirmation-copy.ts b/src/renderer/src/components/github/pull-request-confirmation-copy.ts new file mode 100644 index 00000000000..19da4293258 --- /dev/null +++ b/src/renderer/src/components/github/pull-request-confirmation-copy.ts @@ -0,0 +1,52 @@ +import type { GitHubPRMergeMethod } from '../../../../shared/github/pull-request-types' +import { translate } from '@/i18n/i18n' + +export function getPullRequestStateConfirmationTitle( + nextState: 'open' | 'closed', + number: number +): string { + return nextState === 'closed' + ? translate('auto.components.PullRequestConfirmation.closeTitle', 'Close PR #{{number}}?', { + number + }) + : translate('auto.components.PullRequestConfirmation.reopenTitle', 'Reopen PR #{{number}}?', { + number + }) +} + +export function getPullRequestMergeConfirmationTitle( + method: GitHubPRMergeMethod, + number: number +): string { + switch (method) { + case 'merge': + return translate( + 'auto.components.PullRequestConfirmation.mergeTitle', + 'Merge PR #{{number}} with a merge commit?', + { number } + ) + case 'squash': + return translate( + 'auto.components.PullRequestConfirmation.squashTitle', + 'Squash and merge PR #{{number}}?', + { number } + ) + case 'rebase': + return translate( + 'auto.components.PullRequestConfirmation.rebaseTitle', + 'Rebase and merge PR #{{number}}?', + { number } + ) + } +} + +export function getPullRequestMergeMethodLabel(method: GitHubPRMergeMethod): string { + switch (method) { + case 'merge': + return translate('auto.components.PullRequestConfirmation.mergeLabel', 'Create merge commit') + case 'squash': + return translate('auto.components.PullRequestConfirmation.squashLabel', 'Squash and merge') + case 'rebase': + return translate('auto.components.PullRequestConfirmation.rebaseLabel', 'Rebase and merge') + } +} diff --git a/src/renderer/src/components/pull-request-page/actions/merge-actions.ts b/src/renderer/src/components/pull-request-page/actions/merge-actions.ts index 58b299ea282..47f49379b4e 100644 --- a/src/renderer/src/components/pull-request-page/actions/merge-actions.ts +++ b/src/renderer/src/components/pull-request-page/actions/merge-actions.ts @@ -4,7 +4,11 @@ import type { RuntimeClientTarget } from '../../../../../shared/runtime-client-t import { notifyWorkItemDetailsMutation } from '@/components/github/github-work-item-comment-mutations' import { runPullRequestStateUpdate } from '@/components/github/github-work-item-edit-mutations' import { getGitHubRuntimeRepoId } from '@/lib/github-source-runtime-context' -import { GITHUB_PR_MERGE_METHOD_LABELS } from '../../../../../shared/github/pull-request-merge-methods' +import { + getPullRequestMergeConfirmationTitle, + getPullRequestMergeMethodLabel, + getPullRequestStateConfirmationTitle +} from '@/components/github/pull-request-confirmation-copy' import type { resolveGitHubPRMergeMethods } from '../../../../../shared/github/pull-request-merge-methods' import type { GitHubOwnerRepo, @@ -45,10 +49,7 @@ export async function changePullRequestState(args: { ? translate('auto.components.PullRequestPage.77482513f8', 'Close') : translate('auto.components.PullRequestPage.2f5195c6a0', 'Reopen') const confirmed = await args.confirm({ - title: translate('auto.components.PullRequestPage.eec3706a6a', '{{value0}} PR #{{value1}}?', { - value0: label, - value1: args.item.number - }), + title: getPullRequestStateConfirmationTitle(args.nextState, args.item.number), description: args.nextState === 'closed' ? translate( @@ -126,12 +127,9 @@ export async function mergePullRequest(args: { if (args.mergeDisabled) { return } - const label = GITHUB_PR_MERGE_METHOD_LABELS[args.method] + const label = getPullRequestMergeMethodLabel(args.method) const confirmed = await args.confirm({ - title: translate('auto.components.PullRequestPage.eec3706a6a', '{{value0}} PR #{{value1}}?', { - value0: label, - value1: args.item.number - }), + title: getPullRequestMergeConfirmationTitle(args.method, args.item.number), description: translate( 'auto.components.PullRequestPage.a63b3c159c', 'This will update the pull request on GitHub.' diff --git a/src/renderer/src/components/pull-request-page/actions/panel.tsx b/src/renderer/src/components/pull-request-page/actions/panel.tsx index 173dac2afca..ca57086a1cb 100644 --- a/src/renderer/src/components/pull-request-page/actions/panel.tsx +++ b/src/renderer/src/components/pull-request-page/actions/panel.tsx @@ -26,6 +26,7 @@ import { presentGitHubPRMergeState } from '@/components/github-pr-merge-state' import { resolveGitHubPRMergeMethods } from '../../../../../shared/github/pull-request-merge-methods' import { resolvePullRequestRepo } from '@/components/github/github-work-item-identity' import { translate } from '@/i18n/i18n' +import { getPullRequestMergeMethodLabel } from '@/components/github/pull-request-confirmation-copy' import type { GitHubWorkItem } from '../../../../../shared/github/work-item-types' import type { TaskSourceContext } from '../../../../../shared/task-source-context' import type { PullRequestPageProjectOrigin } from '../page-types' @@ -122,7 +123,7 @@ export function PRActionsPanel({ )} {mergePresentation.autoMergeAction?.label ?? (mergePresentation.directMergeAvailable - ? mergeMethods.defaultLabel + ? getPullRequestMergeMethodLabel(mergeMethods.defaultMethod) : mergePresentation.label)} @@ -162,7 +163,7 @@ export function PRActionsPanel({ )} {mergePresentation.autoMergeAction && } - {mergeMethods.methods.map(({ method, label }) => ( + {mergeMethods.methods.map((method) => ( - {label} + {getPullRequestMergeMethodLabel(method)} ))} window.api.shell.openUrl(item.url)}> diff --git a/src/renderer/src/components/right-sidebar/HostedReviewActions.tsx b/src/renderer/src/components/right-sidebar/HostedReviewActions.tsx index 6b637276050..62a1a74dc84 100644 --- a/src/renderer/src/components/right-sidebar/HostedReviewActions.tsx +++ b/src/renderer/src/components/right-sidebar/HostedReviewActions.tsx @@ -16,6 +16,7 @@ import type { PRInfo } from '../../../../shared/github/pull-request-types' import type { Repo } from '../../../../shared/repo-types' import type { Worktree } from '../../../../shared/worktree/types' import { resolveGitHubPRMergeMethods } from '../../../../shared/github/pull-request-merge-methods' +import { getPullRequestMergeMethodLabel } from '@/components/github/pull-request-confirmation-copy' import { runWorktreeDelete } from '../sidebar/delete-worktree-flow' import { getDeleteStateForWorktreeHost } from '../sidebar/worktree-delete-state-host-match' import { presentGitLabMRMergeState } from './gitlab-mr-merge-state' @@ -224,7 +225,8 @@ export default function HostedReviewActions({ 'Working...' ) : mergePresentation.directMergeAvailable - ? (stackMergeLabel ?? mergeMethods.defaultLabel) + ? (stackMergeLabel ?? + getPullRequestMergeMethodLabel(mergeMethods.defaultMethod)) : (mergePresentation.autoMergeAction?.label ?? mergePresentation.label)} @@ -278,14 +280,14 @@ export default function HostedReviewActions({ )} {(!stackMergeScope || !stackUsesMergeQueue) && - mergeMethods.methods.map(({ method, label }) => ( + mergeMethods.methods.map((method) => ( void handleMerge(method)} > - {label} + {getPullRequestMergeMethodLabel(method)} ))} diff --git a/src/renderer/src/components/task-page/github/MergeCell.tsx b/src/renderer/src/components/task-page/github/MergeCell.tsx index f190b0e4159..846d798c391 100644 --- a/src/renderer/src/components/task-page/github/MergeCell.tsx +++ b/src/renderer/src/components/task-page/github/MergeCell.tsx @@ -8,11 +8,12 @@ import { useAppStore } from '@/store' import { useShallow } from 'zustand/react/shallow' import { getGitHubRepoRoutingTarget } from '@/lib/github-source-runtime-context' import { translate } from '@/i18n/i18n' -import { presentGitHubPRMergeState } from '@/components/github-pr-merge-state' import { - resolveGitHubPRMergeMethods, - GITHUB_PR_MERGE_METHOD_LABELS -} from '../../../../../shared/github/pull-request-merge-methods' + getPullRequestMergeConfirmationTitle, + getPullRequestMergeMethodLabel +} from '@/components/github/pull-request-confirmation-copy' +import { presentGitHubPRMergeState } from '@/components/github-pr-merge-state' +import { resolveGitHubPRMergeMethods } from '../../../../../shared/github/pull-request-merge-methods' import { callRuntimeRpc } from '@/runtime/runtime-rpc-client' import { DropdownMenu, @@ -75,12 +76,9 @@ export function PRMergeCell({ if (!repo || mergeDisabled) { return } - const label = GITHUB_PR_MERGE_METHOD_LABELS[method] + const label = getPullRequestMergeMethodLabel(method) const confirmed = await confirm({ - title: translate('auto.components.TaskPage.844dc193c7', '{{value0}} PR #{{value1}}?', { - value0: label, - value1: item.number - }), + title: getPullRequestMergeConfirmationTitle(method, item.number), description: translate( 'auto.components.TaskPage.0506a78337', 'This will update the pull request on GitHub.' @@ -233,14 +231,14 @@ export function PRMergeCell({ )} {mergePresentation.autoMergeAction && } - {mergeMethods.methods.map(({ method, label }) => ( + {mergeMethods.methods.map((method) => ( void handleMerge(method)} > - {label} + {getPullRequestMergeMethodLabel(method)} ))} window.api.shell.openUrl(item.url)}> diff --git a/src/renderer/src/i18n/locales/en.json b/src/renderer/src/i18n/locales/en.json index 2d0e8b3a217..e8c640b9b27 100644 --- a/src/renderer/src/i18n/locales/en.json +++ b/src/renderer/src/i18n/locales/en.json @@ -1767,7 +1767,6 @@ "aba792c8b3": "Failed to merge pull request", "dbe5e2448e": "Pull request merged", "a27ee5ca1a": "This will update the pull request on GitHub.", - "03d7216d62": "{{value0}} PR #{{value1}}?", "e9b7cb7d17": "Failed to {{value0}} PR", "bd3b4492a0": "Pull request reopened", "9f88657c4e": "Pull request closed", @@ -2213,6 +2212,16 @@ "createWorktree": "Create worktree", "createWorkspace": "Create workspace" }, + "PullRequestConfirmation": { + "closeTitle": "Close PR #{{number}}?", + "mergeLabel": "Create merge commit", + "mergeTitle": "Merge PR #{{number}} with a merge commit?", + "rebaseLabel": "Rebase and merge", + "rebaseTitle": "Rebase and merge PR #{{number}}?", + "reopenTitle": "Reopen PR #{{number}}?", + "squashLabel": "Squash and merge", + "squashTitle": "Squash and merge PR #{{number}}?" + }, "PullRequestPage": { "2560588245": "Failed to request reviewer", "3450247584": "Comment", @@ -2286,7 +2295,6 @@ "aae645d36d": "Failed to merge pull request", "c57873d721": "Pull request merged", "a63b3c159c": "This will update the pull request on GitHub.", - "eec3706a6a": "{{value0}} PR #{{value1}}?", "710e47aa06": "Pull request reopened", "7aa3b5f706": "Pull request closed", "3d77438c92": "This will reopen the pull request on GitHub.", @@ -2661,7 +2669,6 @@ "88f478cdef": "Failed to merge pull request", "a161925adc": "Pull request merged", "0506a78337": "This will update the pull request on GitHub.", - "844dc193c7": "{{value0}} PR #{{value1}}?", "995dd6af9b": "Open PR checks", "8a22eb3f7b": "No matching reviewers.", "67755a83a1": "Everyone else", diff --git a/src/renderer/src/i18n/locales/es.json b/src/renderer/src/i18n/locales/es.json index 99d958df6b5..4e279091669 100644 --- a/src/renderer/src/i18n/locales/es.json +++ b/src/renderer/src/i18n/locales/es.json @@ -1487,7 +1487,6 @@ "aba792c8b3": "No se pudo hacer merge del pull request", "dbe5e2448e": "Pull request mergeado", "a27ee5ca1a": "Esto actualizará el pull request en GitHub.", - "03d7216d62": "{{value0}} PR #{{value1}}?", "e9b7cb7d17": "No se pudo {{value0}} PR", "bd3b4492a0": "Pull request reabierto", "9f88657c4e": "Pull request cerrado", @@ -1933,6 +1932,16 @@ "createWorktree": "Crear worktree", "createWorkspace": "Crear espacio de trabajo" }, + "PullRequestConfirmation": { + "closeTitle": "¿Cerrar PR #{{number}}?", + "mergeLabel": "Crear commit de merge", + "mergeTitle": "¿Hacer merge de PR #{{number}} con un commit de merge?", + "rebaseLabel": "Rebase y merge", + "rebaseTitle": "¿Hacer rebase y merge de PR #{{number}}?", + "reopenTitle": "¿Reabrir PR #{{number}}?", + "squashLabel": "Squash y merge", + "squashTitle": "¿Hacer squash y merge de PR #{{number}}?" + }, "PullRequestPage": { "2560588245": "No se pudo solicitar el revisor", "3450247584": "Comentario", @@ -2002,7 +2011,6 @@ "aae645d36d": "No se pudo hacer merge del pull request", "c57873d721": "Pull request mergeado", "a63b3c159c": "Esto actualizará el pull request en GitHub.", - "eec3706a6a": "{{value0}} PR #{{value1}}?", "710e47aa06": "Pull request reabierto", "7aa3b5f706": "Pull request cerrado", "3d77438c92": "Esto reabrirá el pull request en GitHub.", @@ -2331,7 +2339,6 @@ "88f478cdef": "No se pudo hacer merge del pull request", "a161925adc": "Pull request mergeado", "0506a78337": "Esto actualizará el pull request en GitHub.", - "844dc193c7": "{{value0}} PR #{{value1}}?", "995dd6af9b": "Abrir checks del PR", "8a22eb3f7b": "No hay revisores que coincidan.", "67755a83a1": "Todos los demás", diff --git a/src/renderer/src/i18n/locales/fr.json b/src/renderer/src/i18n/locales/fr.json index 54004ddfe42..acc1d54c8fd 100644 --- a/src/renderer/src/i18n/locales/fr.json +++ b/src/renderer/src/i18n/locales/fr.json @@ -1631,7 +1631,6 @@ "aba792c8b3": "Échec de la fusion de la pull request", "dbe5e2448e": "Pull request fusionnée", "a27ee5ca1a": "Cela mettra à jour la pull request sur GitHub.", - "03d7216d62": "{{value0}} la PR #{{value1}} ?", "e9b7cb7d17": "Impossible de {{value0}} la PR", "bd3b4492a0": "Pull request rouverte", "9f88657c4e": "Pull request fermée", @@ -2077,6 +2076,16 @@ "createWorktree": "Créer un worktree", "createWorkspace": "Créer un espace de travail" }, + "PullRequestConfirmation": { + "closeTitle": "Fermer la PR #{{number}} ?", + "mergeLabel": "Créer un commit de merge", + "mergeTitle": "Merger la PR #{{number}} avec un commit de merge ?", + "rebaseLabel": "Rebaser et merger", + "rebaseTitle": "Rebaser et merger la PR #{{number}} ?", + "reopenTitle": "Rouvrir la PR #{{number}} ?", + "squashLabel": "Squasher et merger", + "squashTitle": "Squasher et merger la PR #{{number}} ?" + }, "PullRequestPage": { "2560588245": "Échec de la demande de reviewer", "3450247584": "Commentaire", @@ -2150,7 +2159,6 @@ "aae645d36d": "Échec de la fusion de la pull request", "c57873d721": "Pull request fusionnée", "a63b3c159c": "Cela mettra à jour la pull request sur GitHub.", - "eec3706a6a": "{{value0}} la PR #{{value1}} ?", "710e47aa06": "Pull request rouverte", "7aa3b5f706": "Pull request fermée", "3d77438c92": "Cela rouvrira la pull request sur GitHub.", @@ -2475,7 +2483,6 @@ "88f478cdef": "Échec de la fusion de la pull request", "a161925adc": "Pull request fusionnée", "0506a78337": "Cela mettra à jour la pull request sur GitHub.", - "844dc193c7": "{{value0}} la PR #{{value1}} ?", "995dd6af9b": "Ouvrir les vérifications de la PR", "8a22eb3f7b": "Aucun reviewer correspondant.", "67755a83a1": "Tous les autres", diff --git a/src/renderer/src/i18n/locales/ja.json b/src/renderer/src/i18n/locales/ja.json index f94f239b1a0..defb0520612 100644 --- a/src/renderer/src/i18n/locales/ja.json +++ b/src/renderer/src/i18n/locales/ja.json @@ -1472,7 +1472,6 @@ "aba792c8b3": "PR のマージに失敗しました", "dbe5e2448e": "PR がマージされました", "a27ee5ca1a": "これにより、GitHub 上の PR が更新されます。", - "03d7216d62": "{{value0}} PR #{{value1}}?", "e9b7cb7d17": "{{value0}} PR に失敗しました", "bd3b4492a0": "PR が再オープンされました", "9f88657c4e": "PR がクローズされました", @@ -1918,6 +1917,16 @@ "createWorktree": "ワークツリーを作成する", "createWorkspace": "ワークスペースを作成" }, + "PullRequestConfirmation": { + "closeTitle": "PR #{{number}} を閉じますか?", + "mergeLabel": "マージコミットを作成", + "mergeTitle": "マージコミットを作成して PR #{{number}} をマージしますか?", + "rebaseLabel": "リベースしてマージ", + "rebaseTitle": "PR #{{number}} をリベースしてマージしますか?", + "reopenTitle": "PR #{{number}} を再度開きますか?", + "squashLabel": "スカッシュしてマージ", + "squashTitle": "PR #{{number}} をスカッシュしてマージしますか?" + }, "PullRequestPage": { "2560588245": "レビュアーのリクエストに失敗しました", "3450247584": "コメント", @@ -1987,7 +1996,6 @@ "aae645d36d": "PR のマージに失敗しました", "c57873d721": "PR がマージされました", "a63b3c159c": "これにより、GitHub 上の PR が更新されます。", - "eec3706a6a": "{{value0}} PR #{{value1}}?", "710e47aa06": "PR が再オープンされました", "7aa3b5f706": "PR がクローズされました", "3d77438c92": "これにより、GitHub で PR が再開されます。", @@ -2316,7 +2324,6 @@ "88f478cdef": "PR のマージに失敗しました", "a161925adc": "PR がマージされました", "0506a78337": "これにより、GitHub 上の PR が更新されます。", - "844dc193c7": "{{value0}} PR #{{value1}}?", "995dd6af9b": "PR チェックを開く", "8a22eb3f7b": "一致するレビュアーがいません。", "67755a83a1": "他のみんな", diff --git a/src/renderer/src/i18n/locales/ko.json b/src/renderer/src/i18n/locales/ko.json index cc79914e899..fb522831377 100644 --- a/src/renderer/src/i18n/locales/ko.json +++ b/src/renderer/src/i18n/locales/ko.json @@ -1472,7 +1472,6 @@ "aba792c8b3": "PR을 병합하지 못했습니다.", "dbe5e2448e": "PR이 병합되었습니다", "a27ee5ca1a": "그러면 GitHub의 PR이 업데이트됩니다.", - "03d7216d62": "{{value0}} PR #{{value1}}?", "e9b7cb7d17": "{{value0}} PR에 실패했습니다.", "bd3b4492a0": "PR이 다시 열렸습니다", "9f88657c4e": "PR이 종료되었습니다.", @@ -1918,6 +1917,16 @@ "createWorktree": "작업 트리 만들기", "createWorkspace": "워크스페이스 만들기" }, + "PullRequestConfirmation": { + "closeTitle": "PR #{{number}}을(를) 닫으시겠습니까?", + "mergeLabel": "병합 커밋 생성", + "mergeTitle": "병합 커밋을 생성하여 PR #{{number}}을(를) 병합하시겠습니까?", + "rebaseLabel": "리베이스 및 병합", + "rebaseTitle": "PR #{{number}}을(를) 리베이스하여 병합하시겠습니까?", + "reopenTitle": "PR #{{number}}을(를) 다시 여시겠습니까?", + "squashLabel": "스쿼시 및 병합", + "squashTitle": "PR #{{number}}을(를) 스쿼시하여 병합하시겠습니까?" + }, "PullRequestPage": { "2560588245": "리뷰어를 요청하지 못했습니다.", "3450247584": "댓글", @@ -1987,7 +1996,6 @@ "aae645d36d": "PR을 병합하지 못했습니다.", "c57873d721": "PR이 병합되었습니다", "a63b3c159c": "그러면 GitHub의 PR이 업데이트됩니다.", - "eec3706a6a": "{{value0}} PR #{{value1}}?", "710e47aa06": "PR이 다시 열렸습니다", "7aa3b5f706": "PR이 종료되었습니다.", "3d77438c92": "그러면 GitHub에서 PR이 다시 열립니다.", @@ -2316,7 +2324,6 @@ "88f478cdef": "PR을 병합하지 못했습니다.", "a161925adc": "PR이 병합되었습니다", "0506a78337": "그러면 GitHub의 PR이 업데이트됩니다.", - "844dc193c7": "{{value0}} PR #{{value1}}?", "995dd6af9b": "PR 체크 열기", "8a22eb3f7b": "일치하는 리뷰어가 없습니다.", "67755a83a1": "다른 사람들", diff --git a/src/renderer/src/i18n/locales/pt.json b/src/renderer/src/i18n/locales/pt.json index 2b4fe417805..fc2233cd7a9 100644 --- a/src/renderer/src/i18n/locales/pt.json +++ b/src/renderer/src/i18n/locales/pt.json @@ -14006,7 +14006,6 @@ "88f478cdef": "Falha ao mergear o pull request", "a161925adc": "Pull request mergeado", "0506a78337": "Isso vai atualizar o pull request no GitHub.", - "844dc193c7": "{{value0}} PR #{{value1}}?", "995dd6af9b": "Abrir verificações do PR", "8a22eb3f7b": "Nenhum revisor correspondente.", "67755a83a1": "Todos os outros", @@ -15347,7 +15346,6 @@ "aba792c8b3": "Falha ao mergear o pull request", "dbe5e2448e": "Pull request mergeado", "a27ee5ca1a": "Isso vai atualizar o pull request no GitHub.", - "03d7216d62": "{{value0}} PR #{{value1}}?", "e9b7cb7d17": "Falha ao {{value0}} o PR", "bd3b4492a0": "Pull request reaberto", "9f88657c4e": "Pull request fechado", @@ -16063,6 +16061,16 @@ "89c7713645": "Tela inicial do Orca Mobile" } }, + "PullRequestConfirmation": { + "closeTitle": "Fechar o PR #{{number}}?", + "mergeLabel": "Criar commit de merge", + "mergeTitle": "Fazer merge do PR #{{number}} com um commit de merge?", + "rebaseLabel": "Rebase e merge", + "rebaseTitle": "Fazer rebase e merge do PR #{{number}}?", + "reopenTitle": "Reabrir o PR #{{number}}?", + "squashLabel": "Squash e merge", + "squashTitle": "Fazer squash e merge do PR #{{number}}?" + }, "PullRequestPage": { "2560588245": "Falha ao solicitar o revisor", "3450247584": "Comentário", @@ -16136,7 +16144,6 @@ "aae645d36d": "Falha ao mergear o pull request", "c57873d721": "Pull request mergeado", "a63b3c159c": "Isso vai atualizar o pull request no GitHub.", - "eec3706a6a": "{{value0}} PR #{{value1}}?", "710e47aa06": "Pull request reaberto", "7aa3b5f706": "Pull request fechado", "3d77438c92": "Isso vai reabrir o pull request no GitHub.", diff --git a/src/renderer/src/i18n/locales/zh.json b/src/renderer/src/i18n/locales/zh.json index ed36530bf10..d99b7f12c03 100644 --- a/src/renderer/src/i18n/locales/zh.json +++ b/src/renderer/src/i18n/locales/zh.json @@ -1472,7 +1472,6 @@ "aba792c8b3": "合并PR失败", "dbe5e2448e": "拉取请求已合并", "a27ee5ca1a": "这将更新 GitHub 上的PR。", - "03d7216d62": "{{value0}} PR #{{value1}}?", "e9b7cb7d17": "{{value0}} PR 失败", "bd3b4492a0": "拉取请求已重新打开", "9f88657c4e": "PR已关闭", @@ -1918,6 +1917,16 @@ "createWorktree": "创建工作树", "createWorkspace": "创建工作区" }, + "PullRequestConfirmation": { + "closeTitle": "关闭 PR #{{number}}?", + "mergeLabel": "创建合并提交", + "mergeTitle": "创建合并提交以合并 PR #{{number}}?", + "rebaseLabel": "变基合并", + "rebaseTitle": "变基合并 PR #{{number}}?", + "reopenTitle": "重新打开 PR #{{number}}?", + "squashLabel": "压缩合并", + "squashTitle": "压缩合并 PR #{{number}}?" + }, "PullRequestPage": { "2560588245": "请求评审人失败", "3450247584": "评论", @@ -1987,7 +1996,6 @@ "aae645d36d": "合并PR失败", "c57873d721": "拉取请求已合并", "a63b3c159c": "这将更新 GitHub 上的PR。", - "eec3706a6a": "{{value0}} PR #{{value1}}?", "710e47aa06": "拉取请求已重新打开", "7aa3b5f706": "PR已关闭", "3d77438c92": "这将在 GitHub 上重新打开PR。", @@ -2316,7 +2324,6 @@ "88f478cdef": "合并PR失败", "a161925adc": "拉取请求已合并", "0506a78337": "这将更新 GitHub 上的PR。", - "844dc193c7": "{{value0}} PR #{{value1}}?", "995dd6af9b": "开放PR检查", "8a22eb3f7b": "没有匹配的评审人。", "67755a83a1": "其他人", diff --git a/src/shared/github/pull-request-merge-methods.test.ts b/src/shared/github/pull-request-merge-methods.test.ts index 550bb00b0a5..072e95de670 100644 --- a/src/shared/github/pull-request-merge-methods.test.ts +++ b/src/shared/github/pull-request-merge-methods.test.ts @@ -8,12 +8,7 @@ describe('GitHub PR merge methods', () => { it('keeps the historical squash-first fallback when repository metadata is missing', () => { expect(resolveGitHubPRMergeMethods()).toEqual({ defaultMethod: 'squash', - defaultLabel: 'Squash and merge', - methods: [ - { method: 'squash', label: 'Squash and merge' }, - { method: 'merge', label: 'Create merge commit' }, - { method: 'rebase', label: 'Rebase and merge' } - ] + methods: ['squash', 'merge', 'rebase'] }) }) @@ -27,11 +22,7 @@ describe('GitHub PR merge methods', () => { expect(resolveGitHubPRMergeMethods(settings)).toEqual({ defaultMethod: 'rebase', - defaultLabel: 'Rebase and merge', - methods: [ - { method: 'rebase', label: 'Rebase and merge' }, - { method: 'squash', label: 'Squash and merge' } - ] + methods: ['rebase', 'squash'] }) }) @@ -44,8 +35,6 @@ describe('GitHub PR merge methods', () => { }) expect(settings?.defaultMethod).toBe('merge') - expect(resolveGitHubPRMergeMethods(settings).methods).toEqual([ - { method: 'merge', label: 'Create merge commit' } - ]) + expect(resolveGitHubPRMergeMethods(settings).methods).toEqual(['merge']) }) }) diff --git a/src/shared/github/pull-request-merge-methods.ts b/src/shared/github/pull-request-merge-methods.ts index 1cfb709635b..a4230551f7a 100644 --- a/src/shared/github/pull-request-merge-methods.ts +++ b/src/shared/github/pull-request-merge-methods.ts @@ -2,21 +2,9 @@ import type { GitHubPRMergeMethod, GitHubPRMergeMethodSettings } from './pull-re export const GITHUB_PR_MERGE_METHODS = ['squash', 'merge', 'rebase'] as const -export const GITHUB_PR_MERGE_METHOD_LABELS: Record = { - squash: 'Squash and merge', - merge: 'Create merge commit', - rebase: 'Rebase and merge' -} - -export type GitHubPRMergeMethodOption = { - method: GitHubPRMergeMethod - label: string -} - export type GitHubPRMergeMethodPresentation = { defaultMethod: GitHubPRMergeMethod - defaultLabel: string - methods: GitHubPRMergeMethodOption[] + methods: GitHubPRMergeMethod[] } function allMethodsAllowed(): Record { @@ -79,15 +67,8 @@ export function resolveGitHubPRMergeMethods( defaultMethod, ...GITHUB_PR_MERGE_METHODS.filter((method) => method !== defaultMethod) ].filter((method) => allowedMethods[method]) - const methods = (orderedMethods.length > 0 ? orderedMethods : GITHUB_PR_MERGE_METHODS).map( - (method) => ({ - method, - label: GITHUB_PR_MERGE_METHOD_LABELS[method] - }) - ) return { defaultMethod, - defaultLabel: GITHUB_PR_MERGE_METHOD_LABELS[defaultMethod], - methods + methods: orderedMethods.length > 0 ? orderedMethods : [...GITHUB_PR_MERGE_METHODS] } }