fix(build-sheet): pluralize the running-sandbox limit copy (1 sandbox, Put it to sleep) (#278)

This commit is contained in:
Neil
2026-11-10 07:50:54 -08:00
committed by GitHub
parent e48cf41c69
commit 61d12fbdfd
4 changed files with 50 additions and 24 deletions
@@ -5,6 +5,7 @@ import type {
OrcaBillingStatusResult
} from '../../../../shared/orca-billing'
import type { VmBuildFailure } from './vm-build-failure'
import { sandboxLimitBody } from './vm-build-limit-copy'
/** The running-sandbox caps billing enforces: per member, and per team (per seat × seats). */
export type SandboxLimit = { perSeat: number; team: number }
@@ -167,16 +168,7 @@ export function vmBuildFailureCopy(
'auto.components.worktree.creation.VmBuildFailureCard.teamLimitTitle',
'You’re at your team’s limit of running sandboxes'
),
body: sandboxLimit
? t(
'auto.components.worktree.creation.VmBuildFailureCard.teamLimitBody',
'Your team can run {{value0}} sandboxes at once ({{value1}} per seat). Put one to sleep or delete it, then try again. Nothing was created, and you weren’t charged.',
{ value0: String(sandboxLimit.team), value1: String(sandboxLimit.perSeat) }
)
: t(
'auto.components.worktree.creation.VmBuildFailureCard.limitBody',
'Put one to sleep or delete it, then try again. Nothing was created, and you weren’t charged.'
)
body: sandboxLimitBody(t, 'team', sandboxLimit)
}
case 'memberConcurrency':
return {
@@ -184,16 +176,7 @@ export function vmBuildFailureCopy(
'auto.components.worktree.creation.VmBuildFailureCard.memberLimitTitle',
'You’re at your limit of running sandboxes'
),
body: sandboxLimit
? t(
'auto.components.worktree.creation.VmBuildFailureCard.memberLimitBody2',
'You can run {{value0}} sandboxes at once. Put one to sleep or delete it, then try again. Nothing was created, and you weren’t charged.',
{ value0: String(sandboxLimit.perSeat) }
)
: t(
'auto.components.worktree.creation.VmBuildFailureCard.limitBody',
'Put one to sleep or delete it, then try again. Nothing was created, and you weren’t charged.'
)
body: sandboxLimitBody(t, 'member', sandboxLimit)
}
case 'githubNotConnected':
return {
@@ -0,0 +1,37 @@
import type { Translate } from '@/i18n/use-translate'
import type { SandboxLimit } from './vm-build-failure-copy'
/** Body of the running-sandbox limit cards, pluralized ("1 sandbox … Put it to sleep"). */
export function sandboxLimitBody(
t: Translate,
scope: 'team' | 'member',
limit: SandboxLimit | null | undefined
): string {
if (!limit) {
return t(
'auto.components.worktree.creation.VmBuildFailureCard.limitBody',
'Put one to sleep or delete it, then try again. Nothing was created, and you weren’t charged.'
)
}
if (scope === 'team') {
return t(
'auto.components.worktree.creation.VmBuildFailureCard.teamLimitBodyCount',
'Your team can run {{count}} sandboxes at once ({{value1}} per seat). Put one to sleep or delete it, then try again. Nothing was created, and you weren’t charged.',
{
count: limit.team,
value1: String(limit.perSeat),
defaultValue_one:
'Your team can run {{count}} sandbox at once ({{value1}} per seat). Put it to sleep or delete it, then try again. Nothing was created, and you weren’t charged.'
}
)
}
return t(
'auto.components.worktree.creation.VmBuildFailureCard.memberLimitBodyCount',
'You can run {{count}} sandboxes at once. Put one to sleep or delete it, then try again. Nothing was created, and you weren’t charged.',
{
count: limit.perSeat,
defaultValue_one:
'You can run {{count}} sandbox at once. Put it to sleep or delete it, then try again. Nothing was created, and you weren’t charged.'
}
)
}
+5 -1
View File
@@ -1345,7 +1345,11 @@
"checksCountTitleCloud_one": "The sandbox is up, but {{count}} environment check failed",
"checksCountTitleCloud_other": "The sandbox is up, but {{count}} environment checks failed",
"checksCountTitleVm_one": "The VM is up, but {{count}} environment check failed",
"checksCountTitleVm_other": "The VM is up, but {{count}} environment checks failed"
"checksCountTitleVm_other": "The VM is up, but {{count}} environment checks failed",
"memberLimitBodyCount_one": "You can run {{count}} sandbox at once. Put it to sleep or delete it, then try again. Nothing was created, and you weren’t charged.",
"memberLimitBodyCount_other": "You can run {{count}} sandboxes at once. Put one to sleep or delete it, then try again. Nothing was created, and you weren’t charged.",
"teamLimitBodyCount_one": "Your team can run {{count}} sandbox at once ({{value1}} per seat). Put it to sleep or delete it, then try again. Nothing was created, and you weren’t charged.",
"teamLimitBodyCount_other": "Your team can run {{count}} sandboxes at once ({{value1}} per seat). Put one to sleep or delete it, then try again. Nothing was created, and you weren’t charged."
},
"VmBuildLog": {
"hiddenTechnicalLines_one": "{{count}} technical line hidden. Copy log includes it.",
+5 -3
View File
@@ -4255,8 +4255,6 @@
"paymentFailedBody": "New sandboxes can’t start until the payment goes through. Nothing was created, and you weren’t charged.",
"teamLimitTitle": "You’re at your team’s limit of running sandboxes",
"limitBody": "Put one to sleep or delete it, then try again. Nothing was created, and you weren’t charged.",
"teamLimitBody": "Your team can run {{value0}} sandboxes at once ({{value1}} per seat). Put one to sleep or delete it, then try again. Nothing was created, and you weren’t charged.",
"memberLimitBody2": "You can run {{value0}} sandboxes at once. Put one to sleep or delete it, then try again. Nothing was created, and you weren’t charged.",
"memberLimitTitle": "You’re at your limit of running sandboxes",
"githubNotConnectedTitle": "GitHub isn’t connected for {{repo}}",
"githubNotConnectedBody": "Orca Cloud clones your code from GitHub and needs access to this repository first. Connect GitHub, then try again. Nothing was created, and you weren’t charged.",
@@ -4282,7 +4280,11 @@
"checksBodyCloud2_one": "Open it anyway and fix it inside the workspace, or run the checks again after changing your project.",
"checksBodyCloud2_other": "Open it anyway and fix them inside the workspace, or run the checks again after changing your project.",
"provisionBodyCloudKept": "Something went wrong while starting the sandbox. Try again, or delete the sandbox to stop using sandbox hours.",
"provisionBodyCloud2": "Something went wrong while starting the sandbox. Nothing was created, and you weren’t charged."
"provisionBodyCloud2": "Something went wrong while starting the sandbox. Nothing was created, and you weren’t charged.",
"teamLimitBodyCount_one": "Your team can run {{count}} sandbox at once ({{value1}} per seat). Put it to sleep or delete it, then try again. Nothing was created, and you weren’t charged.",
"teamLimitBodyCount_other": "Your team can run {{count}} sandboxes at once ({{value1}} per seat). Put one to sleep or delete it, then try again. Nothing was created, and you weren’t charged.",
"memberLimitBodyCount_one": "You can run {{count}} sandbox at once. Put it to sleep or delete it, then try again. Nothing was created, and you weren’t charged.",
"memberLimitBodyCount_other": "You can run {{count}} sandboxes at once. Put one to sleep or delete it, then try again. Nothing was created, and you weren’t charged."
},
"VmBuildLog": {
"jumpToError": "Jump to first error",