export type EditorTranslationParams = Readonly>; export type EditorTranslationKey = | 'insert.toolbar' | 'insert.textBox' | 'insert.image' | 'insert.table' | 'insert.tableDimensions' | 'insert.chart' | 'insert.chartBar' | 'insert.chartLine' | 'insert.chartPie' | 'insert.line' | 'insert.linePresets.straight' | 'insert.linePresets.dashed' | 'insert.linePresets.arrow' | 'insert.linePresets.dashedArrow' | 'insert.linePresets.dottedEnd' | 'insert.linePresets.broken' | 'insert.linePresets.doubleBroken' | 'insert.linePresets.curve' | 'insert.linePresets.cubic' | 'insert.formula' | 'insert.video' | 'insert.audio' | 'asset.drop' | 'asset.orUrl' | 'asset.urlPlaceholder' | 'asset.insert' | 'asset.invalidType' | 'asset.readFailed' | 'element.toolbar' | 'zorder.toFront' | 'zorder.toBack' | 'delete' | 'image.toolbar' | 'image.replace' | 'image.flipH' | 'image.flipV' | 'latex.toolbar' | 'latex.editFormula' | 'latex.dialog' | 'latex.source' | 'latex.preview' | 'latex.symbols' | 'latex.presets' | 'latex.invalidSource' | 'video.toolbar' | 'video.poster' | 'audio.toolbar' | 'audio.preview' | 'audio.pause' | 'audio.loop' | 'background.label' | 'background.solid' | 'background.image' | 'background.color' | 'table.doubleClickToEdit' | 'common.cancel' | 'common.confirm' | 'contextMenu.horizontalAlignment' | 'contextMenu.verticalAlignment' | 'contextMenu.selectAll' | 'contextMenu.copy' | 'contextMenu.cut' | 'contextMenu.paste' | 'contextMenu.unlock' | 'contextMenu.lock' | 'contextMenu.group' | 'contextMenu.ungroup' | 'contextMenu.bringForward' | 'contextMenu.sendBackward' | 'contextMenu.alignTop' | 'contextMenu.alignMiddle' | 'contextMenu.alignBottom' | 'text.toolbar' | 'text.font' | 'text.fontDefault' | 'text.fontSize' | 'text.sizeDown' | 'text.sizeUp' | 'text.bold' | 'text.italic' | 'text.underline' | 'text.color' | 'text.alignLeft' | 'text.alignCenter' | 'text.alignRight' | 'text.bullet' | 'text.colorHex' | 'line.toolbar' | 'line.kind' | 'line.color' | 'line.width' | 'line.style' | 'line.start' | 'line.end' | 'line.straight' | 'line.broken' | 'line.broken2' | 'line.curve' | 'line.cubic' | 'line.solid' | 'line.dashed' | 'line.dotted' | 'line.none' | 'line.arrow' | 'line.dot'; export type EditorTranslate = ( key: EditorTranslationKey, params?: EditorTranslationParams, defaultMessage?: string, ) => string; export function translateEditorLabel( translate: EditorTranslate | undefined, key: EditorTranslationKey, defaultMessage: string, params?: EditorTranslationParams, ): string { return translate?.(key, params, defaultMessage) ?? defaultMessage; }