Component
Translated textarea
Renders a textarea and the english translation within a details component if one is present
This combines two other publishing components:
It should be used on pages where translations of objects can be created or edited.
How it looks (preview) (preview all)
There is no original text for textarea
How to call this component
<%= render "components/translated_textarea", {
textarea: {
label: {
text: "Textarea (required)",
heading_size: "l"
},
name: "textarea"
}
} %>
Accessibility acceptance criteria
- accept focus
- be focusable with a keyboard
- be usable with a keyboard
- indicate when it has focus
Other examples
With details text (preview)
Original text for textarea
This is the English translation
<%= render "components/translated_textarea", {
textarea: {
label: {
text: "Textarea (required)",
heading_size: "l"
},
name: "textarea"
},
details: {
text: "This is the English translation"
}
} %>
With custom details title (preview)
French translation
Je suis en fait français.
<%= render "components/translated_textarea", {
textarea: {
label: {
text: "Textarea (required)",
heading_size: "l"
},
name: "textarea"
},
details: {
title: "French translation",
text: "Je suis en fait français."
}
} %>
With govspeak editor (preview)
Generating preview, please wait.
Original text for textarea
This is the English translation
<%= render "components/translated_textarea", {
textarea: {
label: {
text: "Textarea (required)",
heading_size: "l"
},
name: "textarea"
},
details: {
text: "This is the English translation"
},
govspeak_editor: true
} %>