diff --git a/src/plugin-slots/AdditionalCourseContentPluginSlot/README.md b/src/plugin-slots/AdditionalCourseContentPluginSlot/README.md index e467dc506..e132e646c 100644 --- a/src/plugin-slots/AdditionalCourseContentPluginSlot/README.md +++ b/src/plugin-slots/AdditionalCourseContentPluginSlot/README.md @@ -3,4 +3,4 @@ ### Slot ID: `org.openedx.frontend.authoring.additional_course_content_plugin.v1` ### Slot ID Aliases -* `additional_course_content_plugin` +* `additional_course_content_plugin` \ No newline at end of file diff --git a/src/plugin-slots/AdditionalTranslationsComponentSlot/README.md b/src/plugin-slots/AdditionalTranslationsComponentSlot/README.md index 68d4f27e7..7d1677de5 100644 --- a/src/plugin-slots/AdditionalTranslationsComponentSlot/README.md +++ b/src/plugin-slots/AdditionalTranslationsComponentSlot/README.md @@ -13,3 +13,54 @@ * `additionalProps` - Object * `transcriptType` - String * `isAiTranslationsEnabled` - Boolean + + +## Description + +This slot is used to add a custom block in the **Video Transcription Settings** drawer. + +## Example + +The following `env.config.jsx` will add a custom transcript option in the Transcript Settings drawer. + +![Screenshot of the unit sidebar surrounded by border](./images/additional-translation-example.png) + +```jsx +import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-framework'; +import { Collapsible, Icon } from '@openedx/paragon'; +import { ChevronRight } from '@openedx/paragon/icons'; + +const TranslationsBlock = ({ setIsAiTranslations, courseId }) => ( +
+ setIsAiTranslations(courseId === 'anyId')} + > + + Custom transcript 💬 + + + +
+); + +const config = { + pluginSlots: { + 'org.openedx.frontend.authoring.video_transcript_additional_translations_component.v1': { + plugins: [ + { + op: PLUGIN_OPERATIONS.Insert, + widget: { + id: 'custom_additional_translation_id', + type: DIRECT_PLUGIN, + RenderWidget: TranslationsBlock, + }, + }, + ], + }, + }, +} + +export default config; +``` diff --git a/src/plugin-slots/AdditionalTranslationsComponentSlot/images/additional-translation-example.png b/src/plugin-slots/AdditionalTranslationsComponentSlot/images/additional-translation-example.png new file mode 100644 index 000000000..fa79a1610 Binary files /dev/null and b/src/plugin-slots/AdditionalTranslationsComponentSlot/images/additional-translation-example.png differ