Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
// Desktop words for the attachment refusals, kept beside the other failure pieces' translations.

import { translate } from '@/i18n/i18n'
import {
AGENT_SESSION_FAILURE_COPY as COPY,
type AgentSessionFailureCopyId,
type AgentSessionFailureCopyValues
} from '../../../../shared/agent-session-failure-copy'

export const ATTACHMENT_FAILURE_PIECES = {
attachmentEmpty: () =>
translate('components.native-chat.failureWords.attachmentEmpty', COPY.attachmentEmpty),
attachmentTooLarge: () =>
translate('components.native-chat.failureWords.attachmentTooLarge', COPY.attachmentTooLarge),
attachmentLargerThan: (values) =>
translate(
'components.native-chat.failureWords.attachmentLargerThan',
COPY.attachmentLargerThan,
values
),
attachmentTooMany: () =>
translate('components.native-chat.failureWords.attachmentTooMany', COPY.attachmentTooMany),
attachmentAtMost: (values) =>
translate(
'components.native-chat.failureWords.attachmentAtMost',
COPY.attachmentAtMost,
values
),
attachmentTotalTooLarge: () =>
translate(
'components.native-chat.failureWords.attachmentTotalTooLarge',
COPY.attachmentTotalTooLarge
),
attachmentTotalMoreThan: (values) =>
translate(
'components.native-chat.failureWords.attachmentTotalMoreThan',
COPY.attachmentTotalMoreThan,
values
),
attachmentUnsupportedType: (values) =>
translate(
'components.native-chat.failureWords.attachmentUnsupportedType',
COPY.attachmentUnsupportedType,
values
),
attachmentNotAFile: () =>
translate('components.native-chat.failureWords.attachmentNotAFile', COPY.attachmentNotAFile),
attachmentNoSource: () =>
translate('components.native-chat.failureWords.attachmentNoSource', COPY.attachmentNoSource),
attachmentInvalid: () =>
translate('components.native-chat.failureWords.attachmentInvalid', COPY.attachmentInvalid),
attachmentUnreadable: () =>
translate('components.native-chat.failureWords.attachmentUnreadable', COPY.attachmentUnreadable)
} satisfies Partial<
Record<AgentSessionFailureCopyId, (values: AgentSessionFailureCopyValues) => string>
>
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
type AgentSessionFailureCopyValues,
type AgentSessionFailureSay
} from '../../../../shared/agent-session-failure-copy'
import { ATTACHMENT_FAILURE_PIECES } from './agent-session-failure-attachment-words-text'

// The pieces a refusal notice says too keep the notice's keys, so each has one translation.
const PIECES: Record<AgentSessionFailureCopyId, (values: AgentSessionFailureCopyValues) => string> =
Expand Down Expand Up @@ -155,52 +156,7 @@ const PIECES: Record<AgentSessionFailureCopyId, (values: AgentSessionFailureCopy
COPY.providerRejectedQuoted,
values
),
attachmentEmpty: () =>
translate('components.native-chat.failureWords.attachmentEmpty', COPY.attachmentEmpty),
attachmentTooLarge: () =>
translate('components.native-chat.failureWords.attachmentTooLarge', COPY.attachmentTooLarge),
attachmentLargerThan: (values) =>
translate(
'components.native-chat.failureWords.attachmentLargerThan',
COPY.attachmentLargerThan,
values
),
attachmentTooMany: () =>
translate('components.native-chat.failureWords.attachmentTooMany', COPY.attachmentTooMany),
attachmentAtMost: (values) =>
translate(
'components.native-chat.failureWords.attachmentAtMost',
COPY.attachmentAtMost,
values
),
attachmentTotalTooLarge: () =>
translate(
'components.native-chat.failureWords.attachmentTotalTooLarge',
COPY.attachmentTotalTooLarge
),
attachmentTotalMoreThan: (values) =>
translate(
'components.native-chat.failureWords.attachmentTotalMoreThan',
COPY.attachmentTotalMoreThan,
values
),
attachmentUnsupportedType: (values) =>
translate(
'components.native-chat.failureWords.attachmentUnsupportedType',
COPY.attachmentUnsupportedType,
values
),
attachmentNotAFile: () =>
translate('components.native-chat.failureWords.attachmentNotAFile', COPY.attachmentNotAFile),
attachmentNoSource: () =>
translate('components.native-chat.failureWords.attachmentNoSource', COPY.attachmentNoSource),
attachmentInvalid: () =>
translate('components.native-chat.failureWords.attachmentInvalid', COPY.attachmentInvalid),
attachmentUnreadable: () =>
translate(
'components.native-chat.failureWords.attachmentUnreadable',
COPY.attachmentUnreadable
),
...ATTACHMENT_FAILURE_PIECES,
emptyMessage: () =>
translate('components.native-chat.failureWords.emptyMessage', COPY.emptyMessage),
queueFull: () => translate('components.native-chat.failureWords.queueFull', COPY.queueFull),
Expand Down
Loading