Skip to content

Commit

Permalink
refactor: updated translations
Browse files Browse the repository at this point in the history
  • Loading branch information
PKulkoRaccoonGang committed Mar 13, 2024
1 parent c7d6a1e commit 227a19b
Show file tree
Hide file tree
Showing 16 changed files with 4 additions and 68 deletions.
42 changes: 4 additions & 38 deletions src/generic/clipboard/hooks/useCopyToClipboard.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,45 +2,11 @@ import { renderHook } from '@testing-library/react-hooks';
import { Provider } from 'react-redux';
import { initializeMockApp } from '@edx/frontend-platform';
import { IntlProvider } from '@edx/frontend-platform/i18n';
import { act } from 'react-dom/test-utils';

import initializeStore from '../../../store';
import { clipboardUnit, clipboardXBlock } from '../../../__mocks__';
import useCopyToClipboard from './useCopyToClipboard';

const clipboardUnit = {
content: {
id: 67,
userId: 3,
created: '2024-01-16T13:09:11.540615Z',
purpose: 'clipboard',
status: 'ready',
blockType: 'vertical',
blockTypeDisplay: 'Unit',
olxUrl: 'http://localhost:18010/api/content-staging/v1/staged-content/67/olx',
displayName: 'Introduction: Video and Sequences',
},
sourceUsageKey: 'block-v1:edX+DemoX+Demo_Course+type@vertical+block@vertical_0270f6de40fc',
sourceContextTitle: 'Demonstration Course',
sourceEditUrl: 'http://localhost:18010/container/block-v1:edX+DemoX+Demo_Course+type@vertical+block@vertical_0270f6de40fc',
};

const clipboardXBlock = {
content: {
id: 69,
userId: 3,
created: '2024-01-16T13:33:21.314439Z',
purpose: 'clipboard',
status: 'ready',
blockType: 'html',
blockTypeDisplay: 'Text',
olxUrl: 'http://localhost:18010/api/content-staging/v1/staged-content/69/olx',
displayName: 'Blank HTML Page',
},
sourceUsageKey: 'block-v1:edX+DemoX+Demo_Course+type@html+block@html1',
sourceContextTitle: 'Demonstration Course',
sourceEditUrl: 'http://localhost:18010/container/block-v1:edX+DemoX+Demo_Course+type@vertical+block@vertical1',
};

let store;

const clipboardBroadcastChannelMock = {
Expand Down Expand Up @@ -88,9 +54,7 @@ describe('useCopyToClipboard', () => {
expect(result.current.showPasteXBlock).toBe(false);
expect(result.current.sharedClipboardData).toEqual(clipboardUnit);

act(() => {
rerender({ clipboardData: clipboardXBlock });
});
rerender({ clipboardData: clipboardXBlock });

expect(result.current.showPasteUnit).toBe(false);
expect(result.current.showPasteXBlock).toBe(true);
Expand All @@ -111,12 +75,14 @@ describe('useCopyToClipboard', () => {
const { result } = renderHook(({ clipboardData }) => useCopyToClipboard(clipboardData, true), {
initialProps: { clipboardData: clipboardUnit },
});

clipboardBroadcastChannelMock.onmessage({ data: clipboardUnit });

expect(result.current.showPasteUnit).toBe(true);
expect(result.current.showPasteXBlock).toBe(false);

clipboardBroadcastChannelMock.onmessage({ data: clipboardXBlock });

expect(result.current.showPasteUnit).toBe(false);
expect(result.current.showPasteXBlock).toBe(true);
});
Expand Down
2 changes: 0 additions & 2 deletions src/i18n/messages/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -1149,8 +1149,6 @@
"course-authoring.textbooks.form.delete-modal.description": "Deleting a textbook cannot be undone and once deleted any reference to it in your courseware's navigation will also be removed.",
"course-authoring.course-unit.xblock.iframe.error.text": "Unit iframe failed to load. Server possibly returned 4xx or 5xx response.",
"course-authoring.course-unit.paste-component.btn.text": "Paste component",
"course-authoring.course-unit.popover.content.text": "From:",
"course-authoring.course-unit.paste-component.whats-in-clipboard.text": "What's in my clipboard?",
"course-authoring.course-unit.paste-notification.has-conflicting-errors.title": "Files need to be updated manually.",
"course-authoring.course-unit.paste-notification.has-conflicting-errors.description": "The following files must be updated manually for components to work as intended:",
"course-authoring.course-unit.paste-notification.has-conflicting-errors.button.text": "Upload files",
Expand Down
2 changes: 0 additions & 2 deletions src/i18n/messages/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -1150,8 +1150,6 @@
"course-authoring.textbooks.form.delete-modal.description": "Deleting a textbook cannot be undone and once deleted any reference to it in your courseware's navigation will also be removed.",
"course-authoring.course-unit.xblock.iframe.error.text": "Unit iframe failed to load. Server possibly returned 4xx or 5xx response.",
"course-authoring.course-unit.paste-component.btn.text": "Paste component",
"course-authoring.course-unit.popover.content.text": "From:",
"course-authoring.course-unit.paste-component.whats-in-clipboard.text": "What's in my clipboard?",
"course-authoring.course-unit.paste-notification.has-conflicting-errors.title": "Files need to be updated manually.",
"course-authoring.course-unit.paste-notification.has-conflicting-errors.description": "The following files must be updated manually for components to work as intended:",
"course-authoring.course-unit.paste-notification.has-conflicting-errors.button.text": "Upload files",
Expand Down
2 changes: 0 additions & 2 deletions src/i18n/messages/de_DE.json
Original file line number Diff line number Diff line change
Expand Up @@ -1150,8 +1150,6 @@
"course-authoring.textbooks.form.delete-modal.description": "Deleting a textbook cannot be undone and once deleted any reference to it in your courseware's navigation will also be removed.",
"course-authoring.course-unit.xblock.iframe.error.text": "Unit iframe failed to load. Server possibly returned 4xx or 5xx response.",
"course-authoring.course-unit.paste-component.btn.text": "Paste component",
"course-authoring.course-unit.popover.content.text": "From:",
"course-authoring.course-unit.paste-component.whats-in-clipboard.text": "What's in my clipboard?",
"course-authoring.course-unit.paste-notification.has-conflicting-errors.title": "Files need to be updated manually.",
"course-authoring.course-unit.paste-notification.has-conflicting-errors.description": "The following files must be updated manually for components to work as intended:",
"course-authoring.course-unit.paste-notification.has-conflicting-errors.button.text": "Upload files",
Expand Down
2 changes: 0 additions & 2 deletions src/i18n/messages/es_419.json
Original file line number Diff line number Diff line change
Expand Up @@ -1150,8 +1150,6 @@
"course-authoring.textbooks.form.delete-modal.description": "Deleting a textbook cannot be undone and once deleted any reference to it in your courseware's navigation will also be removed.",
"course-authoring.course-unit.xblock.iframe.error.text": "Unit iframe failed to load. Server possibly returned 4xx or 5xx response.",
"course-authoring.course-unit.paste-component.btn.text": "Paste component",
"course-authoring.course-unit.popover.content.text": "From:",
"course-authoring.course-unit.paste-component.whats-in-clipboard.text": "What's in my clipboard?",
"course-authoring.course-unit.paste-notification.has-conflicting-errors.title": "Files need to be updated manually.",
"course-authoring.course-unit.paste-notification.has-conflicting-errors.description": "The following files must be updated manually for components to work as intended:",
"course-authoring.course-unit.paste-notification.has-conflicting-errors.button.text": "Upload files",
Expand Down
2 changes: 0 additions & 2 deletions src/i18n/messages/fa_IR.json
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,6 @@
"course-authoring.textbooks.form.delete-modal.description": "Deleting a textbook cannot be undone and once deleted any reference to it in your courseware's navigation will also be removed.",
"course-authoring.course-unit.xblock.iframe.error.text": "Unit iframe failed to load. Server possibly returned 4xx or 5xx response.",
"course-authoring.course-unit.paste-component.btn.text": "Paste component",
"course-authoring.course-unit.popover.content.text": "From:",
"course-authoring.course-unit.paste-component.whats-in-clipboard.text": "What's in my clipboard?",
"course-authoring.course-unit.paste-notification.has-conflicting-errors.title": "Files need to be updated manually.",
"course-authoring.course-unit.paste-notification.has-conflicting-errors.description": "The following files must be updated manually for components to work as intended:",
"course-authoring.course-unit.paste-notification.has-conflicting-errors.button.text": "Upload files",
Expand Down
2 changes: 0 additions & 2 deletions src/i18n/messages/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -1150,8 +1150,6 @@
"course-authoring.textbooks.form.delete-modal.description": "Deleting a textbook cannot be undone and once deleted any reference to it in your courseware's navigation will also be removed.",
"course-authoring.course-unit.xblock.iframe.error.text": "Unit iframe failed to load. Server possibly returned 4xx or 5xx response.",
"course-authoring.course-unit.paste-component.btn.text": "Paste component",
"course-authoring.course-unit.popover.content.text": "From:",
"course-authoring.course-unit.paste-component.whats-in-clipboard.text": "What's in my clipboard?",
"course-authoring.course-unit.paste-notification.has-conflicting-errors.title": "Files need to be updated manually.",
"course-authoring.course-unit.paste-notification.has-conflicting-errors.description": "The following files must be updated manually for components to work as intended:",
"course-authoring.course-unit.paste-notification.has-conflicting-errors.button.text": "Upload files",
Expand Down
2 changes: 0 additions & 2 deletions src/i18n/messages/fr_CA.json
Original file line number Diff line number Diff line change
Expand Up @@ -1150,8 +1150,6 @@
"course-authoring.textbooks.form.delete-modal.description": "Deleting a textbook cannot be undone and once deleted any reference to it in your courseware's navigation will also be removed.",
"course-authoring.course-unit.xblock.iframe.error.text": "Unit iframe failed to load. Server possibly returned 4xx or 5xx response.",
"course-authoring.course-unit.paste-component.btn.text": "Paste component",
"course-authoring.course-unit.popover.content.text": "From:",
"course-authoring.course-unit.paste-component.whats-in-clipboard.text": "What's in my clipboard?",
"course-authoring.course-unit.paste-notification.has-conflicting-errors.title": "Files need to be updated manually.",
"course-authoring.course-unit.paste-notification.has-conflicting-errors.description": "The following files must be updated manually for components to work as intended:",
"course-authoring.course-unit.paste-notification.has-conflicting-errors.button.text": "Upload files",
Expand Down
2 changes: 0 additions & 2 deletions src/i18n/messages/hi.json
Original file line number Diff line number Diff line change
Expand Up @@ -1150,8 +1150,6 @@
"course-authoring.textbooks.form.delete-modal.description": "Deleting a textbook cannot be undone and once deleted any reference to it in your courseware's navigation will also be removed.",
"course-authoring.course-unit.xblock.iframe.error.text": "Unit iframe failed to load. Server possibly returned 4xx or 5xx response.",
"course-authoring.course-unit.paste-component.btn.text": "Paste component",
"course-authoring.course-unit.popover.content.text": "From:",
"course-authoring.course-unit.paste-component.whats-in-clipboard.text": "What's in my clipboard?",
"course-authoring.course-unit.paste-notification.has-conflicting-errors.title": "Files need to be updated manually.",
"course-authoring.course-unit.paste-notification.has-conflicting-errors.description": "The following files must be updated manually for components to work as intended:",
"course-authoring.course-unit.paste-notification.has-conflicting-errors.button.text": "Upload files",
Expand Down
2 changes: 0 additions & 2 deletions src/i18n/messages/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -1150,8 +1150,6 @@
"course-authoring.textbooks.form.delete-modal.description": "Deleting a textbook cannot be undone and once deleted any reference to it in your courseware's navigation will also be removed.",
"course-authoring.course-unit.xblock.iframe.error.text": "Unit iframe failed to load. Server possibly returned 4xx or 5xx response.",
"course-authoring.course-unit.paste-component.btn.text": "Paste component",
"course-authoring.course-unit.popover.content.text": "From:",
"course-authoring.course-unit.paste-component.whats-in-clipboard.text": "What's in my clipboard?",
"course-authoring.course-unit.paste-notification.has-conflicting-errors.title": "Files need to be updated manually.",
"course-authoring.course-unit.paste-notification.has-conflicting-errors.description": "The following files must be updated manually for components to work as intended:",
"course-authoring.course-unit.paste-notification.has-conflicting-errors.button.text": "Upload files",
Expand Down
2 changes: 0 additions & 2 deletions src/i18n/messages/it_IT.json
Original file line number Diff line number Diff line change
Expand Up @@ -1150,8 +1150,6 @@
"course-authoring.textbooks.form.delete-modal.description": "Deleting a textbook cannot be undone and once deleted any reference to it in your courseware's navigation will also be removed.",
"course-authoring.course-unit.xblock.iframe.error.text": "Unit iframe failed to load. Server possibly returned 4xx or 5xx response.",
"course-authoring.course-unit.paste-component.btn.text": "Paste component",
"course-authoring.course-unit.popover.content.text": "From:",
"course-authoring.course-unit.paste-component.whats-in-clipboard.text": "What's in my clipboard?",
"course-authoring.course-unit.paste-notification.has-conflicting-errors.title": "Files need to be updated manually.",
"course-authoring.course-unit.paste-notification.has-conflicting-errors.description": "The following files must be updated manually for components to work as intended:",
"course-authoring.course-unit.paste-notification.has-conflicting-errors.button.text": "Upload files",
Expand Down
2 changes: 0 additions & 2 deletions src/i18n/messages/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -1150,8 +1150,6 @@
"course-authoring.textbooks.form.upload-button.alt": "chapter-upload-button",
"course-authoring.textbooks.form.delete-button.tooltip": "Delete",
"course-authoring.textbooks.form.delete-button.alt": "chapter-delete-button",
"course-authoring.course-unit.popover.content.text": "From:",
"course-authoring.course-unit.paste-component.whats-in-clipboard.text": "What's in my clipboard?",
"course-authoring.course-unit.paste-notification.has-conflicting-errors.title": "Files need to be updated manually.",
"course-authoring.course-unit.paste-notification.has-conflicting-errors.description": "The following files must be updated manually for components to work as intended:",
"course-authoring.course-unit.paste-notification.has-conflicting-errors.button.text": "Upload files",
Expand Down
2 changes: 0 additions & 2 deletions src/i18n/messages/pt_PT.json
Original file line number Diff line number Diff line change
Expand Up @@ -1150,8 +1150,6 @@
"course-authoring.textbooks.form.delete-modal.description": "Deleting a textbook cannot be undone and once deleted any reference to it in your courseware's navigation will also be removed.",
"course-authoring.course-unit.xblock.iframe.error.text": "Unit iframe failed to load. Server possibly returned 4xx or 5xx response.",
"course-authoring.course-unit.paste-component.btn.text": "Paste component",
"course-authoring.course-unit.popover.content.text": "From:",
"course-authoring.course-unit.paste-component.whats-in-clipboard.text": "What's in my clipboard?",
"course-authoring.course-unit.paste-notification.has-conflicting-errors.title": "Files need to be updated manually.",
"course-authoring.course-unit.paste-notification.has-conflicting-errors.description": "The following files must be updated manually for components to work as intended:",
"course-authoring.course-unit.paste-notification.has-conflicting-errors.button.text": "Upload files",
Expand Down
2 changes: 0 additions & 2 deletions src/i18n/messages/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -1150,8 +1150,6 @@
"course-authoring.textbooks.form.delete-modal.description": "Deleting a textbook cannot be undone and once deleted any reference to it in your courseware's navigation will also be removed.",
"course-authoring.course-unit.xblock.iframe.error.text": "Unit iframe failed to load. Server possibly returned 4xx or 5xx response.",
"course-authoring.course-unit.paste-component.btn.text": "Paste component",
"course-authoring.course-unit.popover.content.text": "From:",
"course-authoring.course-unit.paste-component.whats-in-clipboard.text": "What's in my clipboard?",
"course-authoring.course-unit.paste-notification.has-conflicting-errors.title": "Files need to be updated manually.",
"course-authoring.course-unit.paste-notification.has-conflicting-errors.description": "The following files must be updated manually for components to work as intended:",
"course-authoring.course-unit.paste-notification.has-conflicting-errors.button.text": "Upload files",
Expand Down
2 changes: 0 additions & 2 deletions src/i18n/messages/uk.json
Original file line number Diff line number Diff line change
Expand Up @@ -1150,8 +1150,6 @@
"course-authoring.textbooks.form.delete-modal.description": "Deleting a textbook cannot be undone and once deleted any reference to it in your courseware's navigation will also be removed.",
"course-authoring.course-unit.xblock.iframe.error.text": "Unit iframe failed to load. Server possibly returned 4xx or 5xx response.",
"course-authoring.course-unit.paste-component.btn.text": "Paste component",
"course-authoring.course-unit.popover.content.text": "From:",
"course-authoring.course-unit.paste-component.whats-in-clipboard.text": "What's in my clipboard?",
"course-authoring.course-unit.paste-notification.has-conflicting-errors.title": "Files need to be updated manually.",
"course-authoring.course-unit.paste-notification.has-conflicting-errors.description": "The following files must be updated manually for components to work as intended:",
"course-authoring.course-unit.paste-notification.has-conflicting-errors.button.text": "Upload files",
Expand Down
2 changes: 0 additions & 2 deletions src/i18n/messages/zh_CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -1150,8 +1150,6 @@
"course-authoring.textbooks.form.delete-modal.description": "Deleting a textbook cannot be undone and once deleted any reference to it in your courseware's navigation will also be removed.",
"course-authoring.course-unit.xblock.iframe.error.text": "Unit iframe failed to load. Server possibly returned 4xx or 5xx response.",
"course-authoring.course-unit.paste-component.btn.text": "Paste component",
"course-authoring.course-unit.popover.content.text": "From:",
"course-authoring.course-unit.paste-component.whats-in-clipboard.text": "What's in my clipboard?",
"course-authoring.course-unit.paste-notification.has-conflicting-errors.title": "Files need to be updated manually.",
"course-authoring.course-unit.paste-notification.has-conflicting-errors.description": "The following files must be updated manually for components to work as intended:",
"course-authoring.course-unit.paste-notification.has-conflicting-errors.button.text": "Upload files",
Expand Down

0 comments on commit 227a19b

Please sign in to comment.