Files
orca/src/shared/pdf-export-failure-copy.ts
T
OrcaWinandOrcaWin 4c963268d2 fix(i18n): code Mobile Emulator, PDF export, and diagnostics failures (#35742)
* fix(i18n): code Mobile Emulator, PDF export, and diagnostics failures

* fix(i18n): read emulator error params without Reflect.get

---------

Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
2026-10-29 00:03:35 -07:00

21 lines
724 B
TypeScript

// One English table for Markdown PDF export failures: main builds the English `error`, the renderer translates by code.
export const PDF_EXPORT_FAILURE_COPY = {
noContent: 'No content to export',
timedOut: 'Export timed out',
failed: 'Failed to export PDF'
} as const
export type PdfExportFailureCode = keyof typeof PDF_EXPORT_FAILURE_COPY
export type PdfExportResult =
| { success: true; filePath: string }
| { success: false; cancelled?: boolean; error?: string; errorCode?: string }
export function pdfExportFailure(errorCode: PdfExportFailureCode): {
success: false
error: string
errorCode: PdfExportFailureCode
} {
return { success: false, error: PDF_EXPORT_FAILURE_COPY[errorCode], errorCode }
}