Skip to content

Commit e46709e

Browse files
committed
fix(texteditor)[i18n]: missing unwrapped strings
1 parent f860e4f commit e46709e

File tree

3 files changed

+52
-8
lines changed

3 files changed

+52
-8
lines changed

contentcuration/contentcuration/frontend/shared/views/TipTapEditor/TipTapEditor/TipTapEditor.vue

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
:class="{ 'view-mode': editorMode === 'view' }"
77
:tabindex="tabindex"
88
role="textbox"
9-
:aria-label="
10-
editorMode === 'edit' ? 'text editor - Press Enter to start editing' : 'text editor content'
11-
"
9+
:aria-label="editorMode === 'edit' ? TipTapEditorLabel$() : TipTapViewerLabel$()"
1210
aria-multiline="true"
1311
@keydown="handleContainerKeydown"
1412
>
@@ -127,6 +125,7 @@
127125
import MobileTopBar from './components/toolbar/MobileTopBar.vue';
128126
import MobileFormattingBar from './components/toolbar/MobileFormattingBar.vue';
129127
import { useBreakpoint } from './composables/useBreakpoint';
128+
import { getTipTapEditorStrings } from './TipTapEditorStrings';
130129
131130
export default defineComponent({
132131
name: 'RichTextEditor',
@@ -260,6 +259,8 @@
260259
}
261260
};
262261
262+
const { TipTapEditorLabel$, TipTapViewerLabel$ } = getTipTapEditorStrings();
263+
263264
return {
264265
editorContainer,
265266
isReady,
@@ -276,6 +277,8 @@
276277
emit('minimize');
277278
},
278279
handleContainerKeydown,
280+
TipTapEditorLabel$,
281+
TipTapViewerLabel$,
279282
};
280283
},
281284
props: {

contentcuration/contentcuration/frontend/shared/views/TipTapEditor/TipTapEditor/TipTapEditorStrings.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,14 @@ const MESSAGES = {
152152
message: 'Clipboard access failed. Try copying again.',
153153
context: 'Message shown when clipboard access fails during paste operation',
154154
},
155+
TipTapEditorLabel: {
156+
message: 'text editor - Press Enter to start editing',
157+
context: 'Label for the TipTap editor',
158+
},
159+
TipTapViewerLabel: {
160+
message: 'text editor content',
161+
context: 'Label for the TipTap editor in view mode',
162+
},
155163

156164
// Image Upload
157165
editImage: {
@@ -335,6 +343,24 @@ const MESSAGES = {
335343
message: 'Format size',
336344
context: 'Alt text for the format size icon',
337345
},
346+
347+
// for MobileTopBar
348+
editorControls: {
349+
message: 'Editor controls',
350+
context: 'Accessibility label for the editor controls toolbar',
351+
},
352+
insertContent: {
353+
message: 'Insert content',
354+
context: 'Button title for inserting content',
355+
},
356+
insertContentMenu: {
357+
message: 'Insert content menu',
358+
context: 'Accessibility label for the insert content menu button',
359+
},
360+
insertContentOption: {
361+
message: 'Insert content option',
362+
context: 'Accessibility label for the insert content dropdown menu',
363+
},
338364
};
339365

340366
let TipTapEditorStrings = null;

contentcuration/contentcuration/frontend/shared/views/TipTapEditor/TipTapEditor/components/toolbar/MobileTopBar.vue

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
<div
44
class="toolbar top-bar"
55
role="toolbar"
6-
aria-label="Editor controls"
6+
:aria-label="editorControls$()"
77
>
88
<div
99
class="history-actions"
1010
role="group"
11-
aria-label="History actions"
11+
:aria-label="historyActions$()"
1212
>
1313
<ToolbarButton
1414
v-for="action in historyActions"
@@ -24,8 +24,8 @@
2424
<div class="topbar-actions">
2525
<button
2626
class="insert-button"
27-
title="Insert content"
28-
aria-label="Insert content menu"
27+
:title="insertContent$()"
28+
:aria-label="insertContentMenu$()"
2929
:aria-expanded="isInsertMenuOpen"
3030
aria-haspopup="menu"
3131
aria-controls="insert-menu"
@@ -46,7 +46,7 @@
4646
ref="dropdown"
4747
class="insert-dropdown"
4848
role="menu"
49-
aria-label="Insert content options"
49+
:aria-label="insertContentOption$()"
5050
>
5151
<button
5252
v-for="tool in insertTools"
@@ -74,6 +74,7 @@
7474
7575
import { defineComponent, ref, onMounted, onBeforeUnmount } from 'vue';
7676
import { useToolbarActions } from '../../composables/useToolbarActions';
77+
import { getTipTapEditorStrings } from '../../TipTapEditorStrings';
7778
import ToolbarButton from './ToolbarButton.vue';
7879
7980
export default defineComponent({
@@ -85,6 +86,15 @@
8586
8687
const { historyActions, insertTools, minimizeAction } = useToolbarActions(emit);
8788
89+
// Get translation functions
90+
const {
91+
editorControls$,
92+
historyActions$,
93+
insertContent$,
94+
insertContentMenu$,
95+
insertContentOption$,
96+
} = getTipTapEditorStrings();
97+
8898
const handleClickOutside = event => {
8999
if (
90100
isInsertMenuOpen.value &&
@@ -110,6 +120,11 @@
110120
minimizeAction,
111121
isInsertMenuOpen,
112122
dropdown,
123+
editorControls$,
124+
historyActions$,
125+
insertContent$,
126+
insertContentMenu$,
127+
insertContentOption$,
113128
};
114129
},
115130
});

0 commit comments

Comments
 (0)