/* * Copyright (C) 2026 - present Instructure, Inc. * * This file is part of Canvas. * * Canvas is free software: you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License as published by the Free * Software Foundation, version 3 of the License. * * Canvas is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR * A PARTICULAR PURPOSE. See the GNU Affero General Public License for more * details. * * You should have received a copy of the GNU Affero General Public License along * with this program. If not, see . */ // consumers map each key to their own i18n system, same shape as platform-provider's TranslationBridge export interface ClosedCaptionPanelTranslations { captionsListLabel: () => string automaticCaptionLabel: (opts: {languageLabel?: string}) => string deletingCaption: (opts: {captionName: string}) => string uploadingCaption: (opts: {lang: string}) => string requestingCaption: (opts: {lang: string}) => string captionsDeletedFor: (opts: {lang: string}) => string captionsAddedFor: (opts: {lang: string}) => string captionUploadFailed: (opts: {captionName: string}) => string captionDeleteFailed: (opts: {captionName: string}) => string captionGenerationFailed: (opts: {captionName: string}) => string processing: () => string deleteFailed: () => string generationFailed: () => string uploadFailed: () => string retryCaption: (opts: {captionName: string}) => string deleteCaption: (opts: {captionName: string}) => string downloadCaption: (opts: {captionName: string}) => string inheritedCaptionsMessage: () => string autoCaptioningHeading: () => string autoCaptioningDescription: () => string languageSpokenLabel: () => string selectLanguagePlaceholder: () => string useArrowKeys: () => string listCollapsed: () => string listExpanded: () => string pleaseSelectLanguage: () => string cancel: () => string request: () => string addNew: () => string addNewCaption: () => string uploadSubtitleHint: () => string languageRequiredLabel: () => string fileRequiredLabel: () => string selectedFile: (opts: {name: string}) => string chooseFileRequired: () => string chooseFile: () => string noFileChosen: () => string pleaseSelectFileBeforeUploading: () => string upload: () => string fileSizeExceeded: (opts: {maxSize: number}) => string invalidFileType: () => string } export const defaultClosedCaptionPanelTranslations: ClosedCaptionPanelTranslations = { captionsListLabel: () => 'Captions', automaticCaptionLabel: ({languageLabel}) => `${languageLabel ?? ''} (Automatic)`, deletingCaption: ({captionName}) => `Deleting ${captionName}`, uploadingCaption: ({lang}) => `Uploading ${lang} caption`, requestingCaption: ({lang}) => `Requesting ${lang} caption`, captionsDeletedFor: ({lang}) => `Captions have been deleted for ${lang}`, captionsAddedFor: ({lang}) => `Captions have been added for ${lang}`, captionUploadFailed: ({captionName}) => `${captionName} caption upload failed`, captionDeleteFailed: ({captionName}) => `${captionName} caption delete failed`, captionGenerationFailed: ({captionName}) => `${captionName} caption generation failed`, processing: () => 'Processing...', deleteFailed: () => 'Delete failed', generationFailed: () => 'Generation failed', uploadFailed: () => 'Upload failed', retryCaption: ({captionName}) => `Retry ${captionName}`, deleteCaption: ({captionName}) => `Delete ${captionName}`, downloadCaption: ({captionName}) => `Download ${captionName}`, inheritedCaptionsMessage: () => 'Captions inherited from a parent course cannot be removed. You can replace by uploading a new caption file.', autoCaptioningHeading: () => 'Automatic captioning', autoCaptioningDescription: () => 'Our technology generates ~85% accurate captions.', languageSpokenLabel: () => 'Language Spoken in This Media*', selectLanguagePlaceholder: () => 'Select Language', useArrowKeys: () => 'Use arrow keys to navigate options.', listCollapsed: () => 'List collapsed.', listExpanded: () => 'List expanded.', pleaseSelectLanguage: () => 'Please select a language', cancel: () => 'Cancel', request: () => 'Request', addNew: () => 'Add New', addNewCaption: () => 'Add New Caption', uploadSubtitleHint: () => 'Upload a subtitle track in either the SRT or WebVTT format.', languageRequiredLabel: () => 'Language*', fileRequiredLabel: () => 'File*', selectedFile: ({name}) => `Selected file: ${name}`, chooseFileRequired: () => 'Choose File (required)', chooseFile: () => 'Choose File', noFileChosen: () => 'No file chosen', pleaseSelectFileBeforeUploading: () => 'Please select a file before uploading.', upload: () => 'Upload', fileSizeExceeded: ({maxSize}) => `The selected file exceeds the ${maxSize} Byte limit`, invalidFileType: () => 'Please select a .vtt or .srt file', }