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
Expand Up @@ -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`
51 changes: 51 additions & 0 deletions src/plugin-slots/AdditionalTranslationsComponentSlot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 }) => (
<div key="transcript-type-selection" className="mt-3">
<Collapsible.Advanced
onOpen={() => setIsAiTranslations(courseId === 'anyId')}
>
<Collapsible.Trigger
className="row m-0 justify-content-between align-items-center"
>
Custom transcript 💬
<Icon src={ChevronRight} />
</Collapsible.Trigger>
</Collapsible.Advanced>
</div>
);

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;
```
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.