diff --git a/.gitignore b/.gitignore index 0aaa6e8d16..07c187c044 100644 --- a/.gitignore +++ b/.gitignore @@ -57,6 +57,7 @@ launch.json #rspack .swc assets/.rsdoctor +*.ignore *storybook.log storybook-static diff --git a/assets/react/v3/@types/index.d.ts b/assets/react/v3/@types/index.d.ts index 4043001988..9a6db0451c 100644 --- a/assets/react/v3/@types/index.d.ts +++ b/assets/react/v3/@types/index.d.ts @@ -81,7 +81,7 @@ declare global { wp_rest_nonce: string; is_admin: string; is_admin_bar_showing: string; - max_upload_size: string; + max_upload_size: string; // in bytes content_change_event: string; is_tutor_course_edit: string; assignment_max_file_allowed: string; diff --git a/assets/react/v3/declaration.d.ts b/assets/react/v3/declaration.d.ts index b9629ab299..1ec60b150b 100644 --- a/assets/react/v3/declaration.d.ts +++ b/assets/react/v3/declaration.d.ts @@ -7,3 +7,5 @@ declare module '*.webp'; interface Window { tutor_get_nonce_data: (value: boolean) => { key: string; value: string }; } + +declare const __TUTOR_TEXT_DOMAIN__: string; diff --git a/assets/react/v3/entries/course-builder/components/course-basic/CourseBasicSidebar.tsx b/assets/react/v3/entries/course-builder/components/course-basic/CourseBasicSidebar.tsx index 8862130cdc..0ef62b76de 100644 --- a/assets/react/v3/entries/course-builder/components/course-basic/CourseBasicSidebar.tsx +++ b/assets/react/v3/entries/course-builder/components/course-basic/CourseBasicSidebar.tsx @@ -25,7 +25,7 @@ import { typography } from '@TutorShared/config/typography'; import Show from '@TutorShared/controls/Show'; import { useInstructorListQuery, useUserListQuery } from '@TutorShared/services/users'; import { styleUtils } from '@TutorShared/utils/style-utils'; -import { isAddonEnabled } from '@TutorShared/utils/util'; +import { formatBytes, isAddonEnabled } from '@TutorShared/utils/util'; import CoursePricing from './CoursePricing'; @@ -181,7 +181,10 @@ const CourseBasicSidebar = () => { buttonText={__('Upload Thumbnail', 'tutor')} infoText={ // translators: %s is the maximum allowed upload file size (e.g., "2MB") - sprintf(__('JPEG, PNG, GIF, and WebP formats, up to %s', 'tutor'), tutorConfig.max_upload_size) + sprintf( + __('JPEG, PNG, GIF, and WebP formats, up to %s', 'tutor'), + formatBytes(Number(tutorConfig?.max_upload_size || 0)), + ) } generateWithAi={!isTutorPro || isOpenAiEnabled} loading={!!isCourseDetailsFetching && !controllerProps.field.value} @@ -200,7 +203,10 @@ const CourseBasicSidebar = () => { buttonText={__('Upload Video', 'tutor')} infoText={ // translators: %s is the maximum allowed file size - sprintf(__('MP4, and WebM formats, up to %s', 'tutor'), tutorConfig.max_upload_size) + sprintf( + __('MP4, and WebM formats, up to %s', 'tutor'), + formatBytes(Number(tutorConfig?.max_upload_size || 0)), + ) } loading={!!isCourseDetailsFetching && !controllerProps.field.value} visibilityKey={VisibilityControlKeys.COURSE_BUILDER.BASICS.INTRO_VIDEO} diff --git a/assets/react/v3/entries/course-builder/components/course-basic/ScheduleOptions.tsx b/assets/react/v3/entries/course-builder/components/course-basic/ScheduleOptions.tsx index 4eaf1bb63e..4a2c8d43d2 100644 --- a/assets/react/v3/entries/course-builder/components/course-basic/ScheduleOptions.tsx +++ b/assets/react/v3/entries/course-builder/components/course-basic/ScheduleOptions.tsx @@ -25,7 +25,7 @@ import { typography } from '@TutorShared/config/typography'; import Show from '@TutorShared/controls/Show'; import { withVisibilityControl } from '@TutorShared/hoc/withVisibilityControl'; import { styleUtils } from '@TutorShared/utils/style-utils'; -import { noop } from '@TutorShared/utils/util'; +import { formatBytes, noop } from '@TutorShared/utils/util'; import { invalidDateRule, invalidTimeRule } from '@TutorShared/utils/validation'; const isTutorPro = !!tutorConfig.tutor_pro_url; @@ -230,7 +230,10 @@ const ScheduleOptions = () => { buttonText={__('Upload Thumbnail', 'tutor')} infoText={ /* translators: %s is the maximum allowed upload file size (e.g., "2MB") */ - sprintf(__('JPEG, PNG, GIF, and WebP formats, up to %s', 'tutor'), tutorConfig.max_upload_size) + sprintf( + __('JPEG, PNG, GIF, and WebP formats, up to %s', 'tutor'), + formatBytes(Number(tutorConfig?.max_upload_size || 0)), + ) } /> )} diff --git a/assets/react/v3/entries/course-builder/components/modals/LessonModal.tsx b/assets/react/v3/entries/course-builder/components/modals/LessonModal.tsx index e8b7a1574a..2d6d34c8f8 100644 --- a/assets/react/v3/entries/course-builder/components/modals/LessonModal.tsx +++ b/assets/react/v3/entries/course-builder/components/modals/LessonModal.tsx @@ -44,7 +44,7 @@ import useVisibilityControl from '@TutorShared/hooks/useVisibilityControl'; import { type WPMedia } from '@TutorShared/hooks/useWpMedia'; import { styleUtils } from '@TutorShared/utils/style-utils'; import { type H5PContent, type ID } from '@TutorShared/utils/types'; -import { findSlotFields, isAddonEnabled, normalizeLineEndings } from '@TutorShared/utils/util'; +import { findSlotFields, formatBytes, isAddonEnabled, normalizeLineEndings } from '@TutorShared/utils/util'; import { maxLimitRule } from '@TutorShared/utils/validation'; interface LessonModalProps extends ModalProps { @@ -383,7 +383,10 @@ const LessonModal = ({ buttonText={__('Upload Image', 'tutor')} infoText={ /* translators: %s is the maximum allowed upload file size (e.g., "2MB") */ - sprintf(__('JPEG, PNG, GIF, and WebP formats, up to %s', 'tutor'), tutorConfig.max_upload_size) + sprintf( + __('JPEG, PNG, GIF, and WebP formats, up to %s', 'tutor'), + formatBytes(Number(tutorConfig?.max_upload_size || 0)), + ) } visibilityKey={VisibilityControlKeys.COURSE_BUILDER.CURRICULUM.LESSON.FEATURED_IMAGE} /> @@ -399,7 +402,10 @@ const LessonModal = ({ buttonText={__('Upload Video', 'tutor')} infoText={ // translators: %s is the maximum allowed file size - sprintf(__('MP4, and WebM formats, up to %s', 'tutor'), tutorConfig.max_upload_size) + sprintf( + __('MP4, and WebM formats, up to %s', 'tutor'), + formatBytes(Number(tutorConfig?.max_upload_size || 0)), + ) } onGetDuration={(duration) => { form.setValue('duration.hour', duration.hours); diff --git a/assets/react/v3/entries/import-export/components/Import.tsx b/assets/react/v3/entries/import-export/components/Import.tsx index 79b6560a75..55c8b76f1d 100644 --- a/assets/react/v3/entries/import-export/components/Import.tsx +++ b/assets/react/v3/entries/import-export/components/Import.tsx @@ -145,7 +145,11 @@ const Import = () => {
- {sprintf(__('Supported format: %s', 'tutor'), isTutorPro ? '.JSON, .ZIP' : '.JSON')} + {sprintf( + // translators: %s is the file extension + __('Supported format: %s', 'tutor'), + isTutorPro ? '.JSON, .ZIP' : '.JSON', + )}
diff --git a/assets/react/v3/entries/import-export/components/modals/import-export-states/ImportExportCompletedState.tsx b/assets/react/v3/entries/import-export/components/modals/import-export-states/ImportExportCompletedState.tsx index 5954579811..b3d25636ff 100644 --- a/assets/react/v3/entries/import-export/components/modals/import-export-states/ImportExportCompletedState.tsx +++ b/assets/react/v3/entries/import-export/components/modals/import-export-states/ImportExportCompletedState.tsx @@ -125,8 +125,11 @@ const ImportExportCompletedState = ({ hasCompletedSuccessfully && hasCompletedWithErrors ? // prettier-ignore __('The export process has finished. However, certain items could not be exported. Check the summary below:', 'tutor') - : // prettier-ignore - sprintf(__('Download the %s file and use it to import your data into another Tutor LMS website.', 'tutor'), isTutorPro ? 'ZIP' : 'JSON'), + : sprintf( + // translators: %s is the file extension + __('Download the %s file and use it to import your data into another Tutor LMS website.', 'tutor'), + isTutorPro ? 'ZIP' : 'JSON', + ), error: message || __('Something went wrong during export. Please try again!', 'tutor'), }, reportList: { diff --git a/assets/react/v3/shared/atoms/ImageInput.tsx b/assets/react/v3/shared/atoms/ImageInput.tsx index 950e7bcebc..e690ad10f2 100644 --- a/assets/react/v3/shared/atoms/ImageInput.tsx +++ b/assets/react/v3/shared/atoms/ImageInput.tsx @@ -38,7 +38,7 @@ const sizeMap: Record = { }; const ImageInput = ({ - buttonText = __('Upload Media', 'tutor'), + buttonText = __('Upload Media', __TUTOR_TEXT_DOMAIN__), infoText, size = 'regular', value, @@ -137,7 +137,7 @@ const ImageInput = ({ }} data-cy="replace-media" > - {replaceButtonText || __('Replace Image', 'tutor')} + {replaceButtonText || __('Replace Image', __TUTOR_TEXT_DOMAIN__)} diff --git a/assets/react/v3/shared/atoms/Select.tsx b/assets/react/v3/shared/atoms/Select.tsx index 5102262c86..ccffc18c91 100644 --- a/assets/react/v3/shared/atoms/Select.tsx +++ b/assets/react/v3/shared/atoms/Select.tsx @@ -198,7 +198,7 @@ const Select = ({ setIsOpen(false); }} > - {__('Clear', 'tutor')} + {__('Clear', __TUTOR_TEXT_DOMAIN__)} )} diff --git a/assets/react/v3/shared/atoms/WPEditor.tsx b/assets/react/v3/shared/atoms/WPEditor.tsx index e81ea62178..fbc914999a 100644 --- a/assets/react/v3/shared/atoms/WPEditor.tsx +++ b/assets/react/v3/shared/atoms/WPEditor.tsx @@ -113,50 +113,50 @@ function editorConfig( if (!isMinimal) { editor.addButton('tutor_button', { - text: __('Tutor ShortCode', 'tutor'), + text: __('Tutor ShortCode', __TUTOR_TEXT_DOMAIN__), icon: false, type: 'menubutton', menu: [ { - text: __('Student Registration Form', 'tutor'), + text: __('Student Registration Form', __TUTOR_TEXT_DOMAIN__), onclick: () => { editor.insertContent('[tutor_student_registration_form]'); }, }, { - text: __('Instructor Registration Form', 'tutor'), + text: __('Instructor Registration Form', __TUTOR_TEXT_DOMAIN__), onclick: () => { editor.insertContent('[tutor_instructor_registration_form]'); }, }, { - text: __('Courses', 'tutor'), + text: __('Courses', __TUTOR_TEXT_DOMAIN__), onclick: () => { editor.windowManager.open({ - title: __('Courses Shortcode', 'tutor'), + title: __('Courses Shortcode', __TUTOR_TEXT_DOMAIN__), body: [ { type: 'textbox', name: 'id', - label: __('Course id, separate by (,) comma', 'tutor'), + label: __('Course id, separate by (,) comma', __TUTOR_TEXT_DOMAIN__), value: '', }, { type: 'textbox', name: 'exclude_ids', - label: __('Exclude Course IDS', 'tutor'), + label: __('Exclude Course IDS', __TUTOR_TEXT_DOMAIN__), value: '', }, { type: 'textbox', name: 'category', - label: __('Category IDS', 'tutor'), + label: __('Category IDS', __TUTOR_TEXT_DOMAIN__), value: '', }, { type: 'listbox', name: 'orderby', - label: __('Order By', 'tutor'), + label: __('Order By', __TUTOR_TEXT_DOMAIN__), onselect: () => {}, values: [ { text: 'ID', value: 'ID' }, @@ -170,7 +170,7 @@ function editorConfig( { type: 'listbox', name: 'order', - label: __('Order', 'tutor'), + label: __('Order', __TUTOR_TEXT_DOMAIN__), onselect: () => {}, values: [ { text: 'DESC', value: 'DESC' }, @@ -180,7 +180,7 @@ function editorConfig( { type: 'textbox', name: 'count', - label: __('Count', 'tutor'), + label: __('Count', __TUTOR_TEXT_DOMAIN__), value: '6', }, ], diff --git a/assets/react/v3/shared/components/ErrorBoundaryDev.tsx b/assets/react/v3/shared/components/ErrorBoundaryDev.tsx index 57d20dbdfa..9a0b6b7b12 100644 --- a/assets/react/v3/shared/components/ErrorBoundaryDev.tsx +++ b/assets/react/v3/shared/components/ErrorBoundaryDev.tsx @@ -318,6 +318,7 @@ const styles = { `, sourceLine: (isErrorLine: boolean) => css` white-space: pre-wrap; + font-family: 'Fire Code', monospace; ${isErrorLine && css` diff --git a/assets/react/v3/shared/components/ErrorBoundaryProd.tsx b/assets/react/v3/shared/components/ErrorBoundaryProd.tsx index 500ee964da..64cce5c9c5 100644 --- a/assets/react/v3/shared/components/ErrorBoundaryProd.tsx +++ b/assets/react/v3/shared/components/ErrorBoundaryProd.tsx @@ -45,16 +45,16 @@ class ErrorBoundaryProd extends Component
- {__('Error', -
{__('Oops! Something went wrong', 'tutor')}
+ {__('Error', +
{__('Oops! Something went wrong', __TUTOR_TEXT_DOMAIN__)}
-

{__('Try the following steps to resolve the issue:', 'tutor')}

+

{__('Try the following steps to resolve the issue:', __TUTOR_TEXT_DOMAIN__)}

    -
  • {__('Refresh the page.', 'tutor')}
  • -
  • {__('Clear your browser cache.', 'tutor')}
  • +
  • {__('Refresh the page.', __TUTOR_TEXT_DOMAIN__)}
  • +
  • {__('Clear your browser cache.', __TUTOR_TEXT_DOMAIN__)}
  • -
  • {__('Ensure the Free and Pro plugins are on the same version.', 'tutor')}
  • +
  • {__('Ensure the Free and Pro plugins are on the same version.', __TUTOR_TEXT_DOMAIN__)}
@@ -67,14 +67,14 @@ class ErrorBoundaryProd extends Component} onClick={() => window.location.reload()} > - {__('Reload', 'tutor')} + {__('Reload', __TUTOR_TEXT_DOMAIN__)}
- {__('Still having trouble?', 'tutor')} - {__('Contact', 'tutor')} - {__('Support', 'tutor')} - {__('for assistance.', 'tutor')} + {__('Still having trouble?', __TUTOR_TEXT_DOMAIN__)} + {__('Contact', __TUTOR_TEXT_DOMAIN__)} + {__('Support', __TUTOR_TEXT_DOMAIN__)} + {__('for assistance.', __TUTOR_TEXT_DOMAIN__)}
diff --git a/assets/react/v3/shared/components/certificate/Certificate.tsx b/assets/react/v3/shared/components/certificate/Certificate.tsx index 2751f0e5d6..63f74f1624 100644 --- a/assets/react/v3/shared/components/certificate/Certificate.tsx +++ b/assets/react/v3/shared/components/certificate/Certificate.tsx @@ -149,10 +149,12 @@ const Certificate = ({ const certificateTabs: CertificateTabItem[] = [ ...(defaultTemplates.length - ? ([{ label: __('Templates', 'tutor'), value: 'templates' }] as CertificateTabItem[]) + ? ([{ label: __('Templates', __TUTOR_TEXT_DOMAIN__), value: 'templates' }] as CertificateTabItem[]) : []), { - label: CURRENT_VIEWPORT.isAboveSmallMobile ? __('Custom Certificates', 'tutor') : __('Certificates', 'tutor'), + label: CURRENT_VIEWPORT.isAboveSmallMobile + ? __('Custom Certificates', __TUTOR_TEXT_DOMAIN__) + : __('Certificates', __TUTOR_TEXT_DOMAIN__), value: 'custom_certificates', }, ]; @@ -169,7 +171,7 @@ const Certificate = ({ />
- + - +
diff --git a/assets/react/v3/shared/components/certificate/CertificateCard.tsx b/assets/react/v3/shared/components/certificate/CertificateCard.tsx index 45810b10a1..23f661bf97 100644 --- a/assets/react/v3/shared/components/certificate/CertificateCard.tsx +++ b/assets/react/v3/shared/components/certificate/CertificateCard.tsx @@ -47,7 +47,7 @@ const CertificateCard = ({ fallback={
- {__('None', 'tutor')} + {__('None', __TUTOR_TEXT_DOMAIN__)}
} > @@ -59,12 +59,12 @@ const CertificateCard = ({
diff --git a/assets/react/v3/shared/components/certificate/CertificateEmptyState.tsx b/assets/react/v3/shared/components/certificate/CertificateEmptyState.tsx index 21a44bc560..0831fe0020 100644 --- a/assets/react/v3/shared/components/certificate/CertificateEmptyState.tsx +++ b/assets/react/v3/shared/components/certificate/CertificateEmptyState.tsx @@ -25,33 +25,36 @@ const CertificateEmptyState = () => { css={styles.placeholderImage} src={certificate} srcSet={`${certificate} 1x, ${certificate2x} 2x`} - alt={__('Pro Placeholder', 'tutor')} + alt={__('Pro Placeholder', __TUTOR_TEXT_DOMAIN__)} />
-
{__('Award Students with Custom Certificates', 'tutor')}
+
{__('Award Students with Custom Certificates', __TUTOR_TEXT_DOMAIN__)}
- { - // prettier-ignore - __( 'Celebrate success with personalized certificates. Recognize student achievements with unique designs that inspire and motivate students.', 'tutor') - } + {__( + 'Celebrate success with personalized certificates. Recognize student achievements with unique designs that inspire and motivate students.', + __TUTOR_TEXT_DOMAIN__, + )}
- { - // prettier-ignore - __('Design personalized certificates that highlight their accomplishments and boost their confidence.', 'tutor') - } + {__( + 'Design personalized certificates that highlight their accomplishments and boost their confidence.', + __TUTOR_TEXT_DOMAIN__, + )}
- {__('Inspire them with a touch of credibility and recognition tailored just for them.', 'tutor')} + {__( + 'Inspire them with a touch of credibility and recognition tailored just for them.', + __TUTOR_TEXT_DOMAIN__, + )}
@@ -60,13 +63,14 @@ const CertificateEmptyState = () => {
diff --git a/assets/react/v3/shared/components/fields/FormCategoriesInput.tsx b/assets/react/v3/shared/components/fields/FormCategoriesInput.tsx index 5667b05d0e..d05df317bb 100644 --- a/assets/react/v3/shared/components/fields/FormCategoriesInput.tsx +++ b/assets/react/v3/shared/components/fields/FormCategoriesInput.tsx @@ -134,7 +134,7 @@ const FormMultiLevelInput = ({
{ @@ -149,7 +149,7 @@ const FormMultiLevelInput = ({ }> 0} - fallback={{__('No categories found.', 'tutor')}} + fallback={{__('No categories found.', __TUTOR_TEXT_DOMAIN__)}} > {treeOptions.map((option, index) => ( setIsOpen(true)} > - {__('Add', 'tutor')} + {__('Add', __TUTOR_TEXT_DOMAIN__)} @@ -207,10 +207,14 @@ const FormMultiLevelInput = ({ name="name" control={form.control} rules={{ - required: __('Category name is required', 'tutor'), + required: __('Category name is required', __TUTOR_TEXT_DOMAIN__), }} render={(controllerProps) => ( - + )} /> @@ -220,7 +224,7 @@ const FormMultiLevelInput = ({ render={(controllerProps) => ( )} @@ -228,7 +232,7 @@ const FormMultiLevelInput = ({
diff --git a/assets/react/v3/shared/components/fields/FormCoursePrerequisites.tsx b/assets/react/v3/shared/components/fields/FormCoursePrerequisites.tsx index c53254beb1..130b331c15 100644 --- a/assets/react/v3/shared/components/fields/FormCoursePrerequisites.tsx +++ b/assets/react/v3/shared/components/fields/FormCoursePrerequisites.tsx @@ -171,9 +171,9 @@ const FormCoursePrerequisites = ({ size="small" emptyStateImage={notFound} emptyStateImage2x={notFound2x} - imageAltText={__('Illustration of a no course selected', 'tutor')} - title={__('No course selected', 'tutor')} - description={__('Select a course to add as a prerequisite.', 'tutor')} + imageAltText={__('Illustration of a no course selected', __TUTOR_TEXT_DOMAIN__)} + title={__('No course selected', __TUTOR_TEXT_DOMAIN__)} + description={__('Select a course to add as a prerequisite.', __TUTOR_TEXT_DOMAIN__)} />
} @@ -223,7 +223,7 @@ const FormCoursePrerequisites = ({ when={filteredOption.length > 0} fallback={
  • -

    {__('No courses found', 'tutor')}

    +

    {__('No courses found', __TUTOR_TEXT_DOMAIN__)}

  • } > diff --git a/assets/react/v3/shared/components/fields/FormDateInput.tsx b/assets/react/v3/shared/components/fields/FormDateInput.tsx index 1e8b6c9d93..149c674e22 100644 --- a/assets/react/v3/shared/components/fields/FormDateInput.tsx +++ b/assets/react/v3/shared/components/fields/FormDateInput.tsx @@ -136,7 +136,7 @@ const FormDateInput = ({ {isClearable && field.value && ( diff --git a/assets/react/v3/shared/components/fields/FormFieldWrapper.tsx b/assets/react/v3/shared/components/fields/FormFieldWrapper.tsx index 6ea827c60d..420f3bedd0 100644 --- a/assets/react/v3/shared/components/fields/FormFieldWrapper.tsx +++ b/assets/react/v3/shared/components/fields/FormFieldWrapper.tsx @@ -153,7 +153,7 @@ const FormFieldWrapper = ({ content={ characterCount.maxLimit - characterCount.inputCharacter >= 0 ? characterCount.maxLimit - characterCount.inputCharacter - : __('Limit exceeded', 'tutor') + : __('Limit exceeded', __TUTOR_TEXT_DOMAIN__) } > {inputContent} diff --git a/assets/react/v3/shared/components/fields/FormFileUploader.tsx b/assets/react/v3/shared/components/fields/FormFileUploader.tsx index eff0ae863a..fd2939ecc0 100644 --- a/assets/react/v3/shared/components/fields/FormFileUploader.tsx +++ b/assets/react/v3/shared/components/fields/FormFileUploader.tsx @@ -85,7 +85,7 @@ const FormFileUploader = ({ fieldState, label, helpText, - buttonText = __('Upload Media', 'tutor'), + buttonText = __('Upload Media', __TUTOR_TEXT_DOMAIN__), selectMultiple = false, onChange, maxFileSize, @@ -163,7 +163,7 @@ const FormFileUploader = ({
    - {`${__('Size', 'tutor')}: ${file.size}`} + {`${__('Size', __TUTOR_TEXT_DOMAIN__)}: ${file.size}`}
    diff --git a/assets/react/v3/shared/components/fields/FormImageInput.tsx b/assets/react/v3/shared/components/fields/FormImageInput.tsx index 5a1efa9fe9..24f8d9e0af 100644 --- a/assets/react/v3/shared/components/fields/FormImageInput.tsx +++ b/assets/react/v3/shared/components/fields/FormImageInput.tsx @@ -41,7 +41,7 @@ const FormImageInput = ({ label, size, helpText, - buttonText = __('Upload Media', 'tutor'), + buttonText = __('Upload Media', __TUTOR_TEXT_DOMAIN__), infoText, onChange, generateWithAi = false, @@ -107,7 +107,7 @@ const FormImageInput = ({ component: AIImageModal, isMagicAi: true, props: { - title: __('AI Studio', 'tutor'), + title: __('AI Studio', __TUTOR_TEXT_DOMAIN__), icon: , field, fieldState, diff --git a/assets/react/v3/shared/components/fields/FormInput.tsx b/assets/react/v3/shared/components/fields/FormInput.tsx index 7bde8c238b..381e23e4eb 100644 --- a/assets/react/v3/shared/components/fields/FormInput.tsx +++ b/assets/react/v3/shared/components/fields/FormInput.tsx @@ -126,15 +126,15 @@ const FormInput = ({ component: AITextModal, isMagicAi: true, props: { - title: __('AI Studio', 'tutor'), + title: __('AI Studio', __TUTOR_TEXT_DOMAIN__), icon: , characters: 120, field, fieldState, format: 'title', is_html: false, - fieldLabel: __('Create a Compelling Title', 'tutor'), - fieldPlaceholder: __('Describe the main focus of your course in a few words', 'tutor'), + fieldLabel: __('Create a Compelling Title', __TUTOR_TEXT_DOMAIN__), + fieldPlaceholder: __('Describe the main focus of your course in a few words', __TUTOR_TEXT_DOMAIN__), }, }); onClickAiButton?.(); @@ -210,7 +210,7 @@ const FormInput = ({ size="small" onClick={() => setFieldType((prev) => (prev === 'password' ? 'text' : 'password'))} icon={} - aria-label={__('Show/Hide Password', 'tutor')} + aria-label={__('Show/Hide Password', __TUTOR_TEXT_DOMAIN__)} buttonCss={styles.eyeButton({ type: fieldType })} /> @@ -222,7 +222,7 @@ const FormInput = ({ onClick={() => field.onChange('')} buttonCss={styleUtils.inputClearButton} icon={} - aria-label={__('Clear', 'tutor')} + aria-label={__('Clear', __TUTOR_TEXT_DOMAIN__)} /> diff --git a/assets/react/v3/shared/components/fields/FormMultiLevelSelect.tsx b/assets/react/v3/shared/components/fields/FormMultiLevelSelect.tsx index ab5478ca77..de443fc104 100644 --- a/assets/react/v3/shared/components/fields/FormMultiLevelSelect.tsx +++ b/assets/react/v3/shared/components/fields/FormMultiLevelSelect.tsx @@ -98,7 +98,7 @@ const FormMultiLevelSelect = ({ tabIndex={-1} type="button" disabled={disabled || options.length === 0} - aria-label={__('Toggle options', 'tutor')} + aria-label={__('Toggle options', __TUTOR_TEXT_DOMAIN__)} css={styles.toggleIcon(isOpen)} onClick={() => { setIsOpen((prev) => !prev); @@ -123,7 +123,7 @@ const FormMultiLevelSelect = ({ { setSearchValue(event.target.value); @@ -132,7 +132,7 @@ const FormMultiLevelSelect = ({ 0} - fallback={
    {__('No categories found.', 'tutor')}
    } + fallback={
    {__('No categories found.', __TUTOR_TEXT_DOMAIN__)}
    } >
    {options.map((option) => ( @@ -157,7 +157,7 @@ const FormMultiLevelSelect = ({ setIsOpen(false); }} > - {__('Clear selection', 'tutor')} + {__('Clear selection', __TUTOR_TEXT_DOMAIN__)}
    )} diff --git a/assets/react/v3/shared/components/fields/FormMultiSelectInput.tsx b/assets/react/v3/shared/components/fields/FormMultiSelectInput.tsx index 8339074770..cbbf1053ed 100644 --- a/assets/react/v3/shared/components/fields/FormMultiSelectInput.tsx +++ b/assets/react/v3/shared/components/fields/FormMultiSelectInput.tsx @@ -113,7 +113,7 @@ const FormMultiSelectInput = ({
      0} - fallback={
      {__('No option available.', 'tutor')}
      } + fallback={
      {__('No option available.', __TUTOR_TEXT_DOMAIN__)}
      } > {(option) => ( diff --git a/assets/react/v3/shared/components/fields/FormSelectInput.tsx b/assets/react/v3/shared/components/fields/FormSelectInput.tsx index 16f40aa02a..0dea7c1f99 100644 --- a/assets/react/v3/shared/components/fields/FormSelectInput.tsx +++ b/assets/react/v3/shared/components/fields/FormSelectInput.tsx @@ -278,7 +278,7 @@ const FormSelectInput = ({ {!!listLabel &&
    • {listLabel}
    • } 0} - fallback={
    • {__('No options available', 'tutor')}
    • } + fallback={
    • {__('No options available', __TUTOR_TEXT_DOMAIN__)}
    • } > {selections.map((option, index) => (
    • ({ setIsOpen(false); }} > - {__('Clear', 'tutor')} + {__('Clear', __TUTOR_TEXT_DOMAIN__)} )} diff --git a/assets/react/v3/shared/components/fields/FormSelectUser.tsx b/assets/react/v3/shared/components/fields/FormSelectUser.tsx index 53d92513e7..b0b5ca3781 100644 --- a/assets/react/v3/shared/components/fields/FormSelectUser.tsx +++ b/assets/react/v3/shared/components/fields/FormSelectUser.tsx @@ -49,7 +49,7 @@ type FormSelectUserProps = { const userPlaceholderData: UserOption = { id: 0, - name: __('Click to select user', 'tutor'), + name: __('Click to select user', __TUTOR_TEXT_DOMAIN__), email: 'example@example.com', avatar_url: 'https://gravatar.com/avatar', }; @@ -68,7 +68,7 @@ const FormSelectUser = ({ loading, isSearchable = false, helpText, - emptyStateText = __('No user selected', 'tutor'), + emptyStateText = __('No user selected', __TUTOR_TEXT_DOMAIN__), isInstructorMode = false, }: FormSelectUserProps) => { const inputValue = field.value ?? (isMultiSelect ? [] : userPlaceholderData); @@ -313,7 +313,7 @@ const FormSelectUser = ({ when={filteredOption.length > 0} fallback={
    • -

      {__('No user found', 'tutor')}

      +

      {__('No user found', __TUTOR_TEXT_DOMAIN__)}

    • } > diff --git a/assets/react/v3/shared/components/fields/FormTagsInput.tsx b/assets/react/v3/shared/components/fields/FormTagsInput.tsx index 7923505e8c..b6a15dff4d 100644 --- a/assets/react/v3/shared/components/fields/FormTagsInput.tsx +++ b/assets/react/v3/shared/components/fields/FormTagsInput.tsx @@ -141,14 +141,14 @@ const FormTagsInput = ({
    • )} 0} - fallback={
      {__('No tag created yet.', 'tutor')}
      } + fallback={
      {__('No tag created yet.', __TUTOR_TEXT_DOMAIN__)}
      } > {tags.map((tag) => (
    • diff --git a/assets/react/v3/shared/components/fields/FormTimeInput.tsx b/assets/react/v3/shared/components/fields/FormTimeInput.tsx index fe466052c6..f5d28c61c6 100644 --- a/assets/react/v3/shared/components/fields/FormTimeInput.tsx +++ b/assets/react/v3/shared/components/fields/FormTimeInput.tsx @@ -123,7 +123,7 @@ const FormTimeInput = ({ {isClearable && field.value && ( @@ -467,19 +467,19 @@ const FormVideoInput = ({ if (videoSource === 'embedded') return true; if (videoSource === 'shortcode') { - return videoValidation.shortcode(videoUrl) ? true : __('Invalid Shortcode', 'tutor'); + return videoValidation.shortcode(videoUrl) ? true : __('Invalid Shortcode', __TUTOR_TEXT_DOMAIN__); } if (!videoValidation.url(videoUrl)) { - return __('Invalid URL', 'tutor'); + return __('Invalid URL', __TUTOR_TEXT_DOMAIN__); } if (videoSource === 'youtube' && !videoValidation.youtube(videoUrl)) { - return __('Invalid YouTube URL', 'tutor'); + return __('Invalid YouTube URL', __TUTOR_TEXT_DOMAIN__); } if (videoSource === 'vimeo' && !videoValidation.vimeo(videoUrl)) { - return __('Invalid Vimeo URL', 'tutor'); + return __('Invalid Vimeo URL', __TUTOR_TEXT_DOMAIN__); } return true; @@ -532,7 +532,7 @@ const FormVideoInput = ({ setIsOpen((previousState) => !previousState); }} > - {__('Add from URL', 'tutor')} + {__('Add from URL', __TUTOR_TEXT_DOMAIN__)} } > @@ -545,7 +545,7 @@ const FormVideoInput = ({ setIsOpen((previousState) => !previousState); }} > - {__('Add from URL', 'tutor')} + {__('Add from URL', __TUTOR_TEXT_DOMAIN__)} @@ -629,12 +629,12 @@ const FormVideoInput = ({ disabled={['vimeo', 'youtube'].includes(fieldValue?.source || '')} uploadHandler={() => handleUpload('poster')} clearHandler={() => handleClear('poster')} - buttonText={__('Upload Thumbnail', 'tutor')} - infoText={__('Upload a thumbnail image for your video', 'tutor')} + buttonText={__('Upload Thumbnail', __TUTOR_TEXT_DOMAIN__)} + infoText={__('Upload a thumbnail image for your video', __TUTOR_TEXT_DOMAIN__)} emptyImageCss={styles.thumbImage} previewImageCss={styles.thumbImage} overlayCss={styles.thumbImage} - replaceButtonText={__('Replace Thumbnail', 'tutor')} + replaceButtonText={__('Replace Thumbnail', __TUTOR_TEXT_DOMAIN__)} /> 0 || duration.minutes > 0 || duration.seconds > 0}> @@ -676,7 +676,7 @@ const FormVideoInput = ({ {...controllerProps} options={videoSourcesSelectOptions} disabled={videoSourceOptions.length <= 1} - placeholder={__('Select source', 'tutor')} + placeholder={__('Select source', __TUTOR_TEXT_DOMAIN__)} hideCaret={videoSourceOptions.length <= 1} /> ); @@ -697,7 +697,10 @@ const FormVideoInput = ({ border-style: dashed; `} rows={2} - placeholder={placeholderMap[videoSource as keyof typeof placeholderMap] || __('Paste Here', 'tutor')} + placeholder={ + placeholderMap[videoSource as keyof typeof placeholderMap] || + __('Paste Here', __TUTOR_TEXT_DOMAIN__) + } /> ); }} @@ -711,7 +714,7 @@ const FormVideoInput = ({ setIsOpen(false); }} > - {__('Cancel', 'tutor')} + {__('Cancel', __TUTOR_TEXT_DOMAIN__)} diff --git a/assets/react/v3/shared/components/fields/FormWPEditor.tsx b/assets/react/v3/shared/components/fields/FormWPEditor.tsx index 5779b128de..a3dad560bf 100644 --- a/assets/react/v3/shared/components/fields/FormWPEditor.tsx +++ b/assets/react/v3/shared/components/fields/FormWPEditor.tsx @@ -96,16 +96,16 @@ const CustomEditorOverlay = ({ const { action } = await showModal({ component: ConfirmationModal, props: { - title: __('Back to WordPress Editor', 'tutor'), + title: __('Back to WordPress Editor', __TUTOR_TEXT_DOMAIN__), description: ( { // prettier-ignore - __( 'Warning: Switching to the WordPress default editor may cause issues with your current layout, design, and content.', 'tutor') + __( 'Warning: Switching to the WordPress default editor may cause issues with your current layout, design, and content.', __TUTOR_TEXT_DOMAIN__) } ), - confirmButtonText: __('Confirm', 'tutor'), + confirmButtonText: __('Confirm', __TUTOR_TEXT_DOMAIN__), confirmButtonVariant: 'primary', }, depthIndex: zIndex.highest, @@ -120,7 +120,7 @@ const CustomEditorOverlay = ({ } }} > - {__('Back to WordPress Editor', 'tutor')} + {__('Back to WordPress Editor', __TUTOR_TEXT_DOMAIN__)} @@ -216,7 +216,7 @@ const FormWPEditor = ({ component: AITextModal, isMagicAi: true, props: { - title: __('AI Studio', 'tutor'), + title: __('AI Studio', __TUTOR_TEXT_DOMAIN__), icon: , characters: 1000, field, @@ -239,7 +239,7 @@ const FormWPEditor = ({
      - {__('Edit with', 'tutor')} + {__('Edit with', __TUTOR_TEXT_DOMAIN__)}
      {(editor) => ( diff --git a/assets/react/v3/shared/components/fields/quiz/FormAnswerExplanation.tsx b/assets/react/v3/shared/components/fields/quiz/FormAnswerExplanation.tsx index 8cb3c66ff1..64c2c26633 100644 --- a/assets/react/v3/shared/components/fields/quiz/FormAnswerExplanation.tsx +++ b/assets/react/v3/shared/components/fields/quiz/FormAnswerExplanation.tsx @@ -83,7 +83,7 @@ const FormAnswerExplanation = ({ setIsEdit(false); }} > - {__('Cancel', 'tutor')} + {__('Cancel', __TUTOR_TEXT_DOMAIN__)}
      diff --git a/assets/react/v3/shared/components/fields/quiz/FormQuestionDescription.tsx b/assets/react/v3/shared/components/fields/quiz/FormQuestionDescription.tsx index 46e87cadd0..4e9474ca79 100644 --- a/assets/react/v3/shared/components/fields/quiz/FormQuestionDescription.tsx +++ b/assets/react/v3/shared/components/fields/quiz/FormQuestionDescription.tsx @@ -130,10 +130,10 @@ const FormQuestionDescription = ({
      @@ -145,7 +145,9 @@ const FormQuestionDescription = ({ data-overlay tabIndex={0} role="button" - aria-label={inputValue ? __('Edit description', 'tutor') : __('Add description', 'tutor')} + aria-label={ + inputValue ? __('Edit description', __TUTOR_TEXT_DOMAIN__) : __('Add description', __TUTOR_TEXT_DOMAIN__) + } />
      diff --git a/assets/react/v3/shared/components/fields/quiz/FormQuestionTitle.tsx b/assets/react/v3/shared/components/fields/quiz/FormQuestionTitle.tsx index 43e1b815b4..a78ee31b96 100644 --- a/assets/react/v3/shared/components/fields/quiz/FormQuestionTitle.tsx +++ b/assets/react/v3/shared/components/fields/quiz/FormQuestionTitle.tsx @@ -148,7 +148,7 @@ const FormQuestionTitle = ({
      handleToggleEdit(true)} - aria-label={__('Edit question title', 'tutor')} + aria-label={__('Edit question title', __TUTOR_TEXT_DOMAIN__)} data-question-title-edit-button > @@ -239,7 +239,7 @@ const FormQuestionTitle = ({ size="small" onClick={handleSave} disabled={field.value === previousValue} - aria-label={__('Save question title', 'tutor')} + aria-label={__('Save question title', __TUTOR_TEXT_DOMAIN__)} > @@ -250,7 +250,7 @@ const FormQuestionTitle = ({ variant="text" size="small" onClick={handleCancel} - aria-label={__('Cancel question title', 'tutor')} + aria-label={__('Cancel question title', __TUTOR_TEXT_DOMAIN__)} > diff --git a/assets/react/v3/shared/components/fields/quiz/questions/FormFillinTheBlanks.tsx b/assets/react/v3/shared/components/fields/quiz/questions/FormFillinTheBlanks.tsx index 3a25bc6e95..812f24ca7b 100644 --- a/assets/react/v3/shared/components/fields/quiz/questions/FormFillinTheBlanks.tsx +++ b/assets/react/v3/shared/components/fields/quiz/questions/FormFillinTheBlanks.tsx @@ -74,11 +74,11 @@ const FormFillInTheBlanks = ({ field, questionId, validationError, setValidation
      -
      {__('Fill in the blanks', 'tutor')}
      +
      {__('Fill in the blanks', __TUTOR_TEXT_DOMAIN__)}
      - +
      {fillInTheBlanksCorrectAnswer && fillInTheBlanksCorrectAnswer.length > 0 ? ( @@ -120,7 +120,7 @@ const FormFillInTheBlanks = ({ field, questionId, validationError, setValidation )} ) : ( - __('Correct Answer(s)...', 'tutor') + __('Correct Answer(s)...', __TUTOR_TEXT_DOMAIN__) )}
      @@ -132,7 +132,7 @@ const FormFillInTheBlanks = ({ field, questionId, validationError, setValidation {...field} ref={inputRef} type="text" - placeholder={__('Question title...', 'tutor')} + placeholder={__('Question title...', __TUTOR_TEXT_DOMAIN__)} value={inputValue.answer_title} onClick={(event) => { event.stopPropagation(); @@ -171,7 +171,7 @@ const FormFillInTheBlanks = ({ field, questionId, validationError, setValidation

      { // prettier-ignore - __('Please make sure to use the variable {dash} in your question title to show the blanks in your question. You can use multiple {dash} variables in one question.', 'tutor') + __('Please make sure to use the variable {dash} in your question title to show the blanks in your question. You can use multiple {dash} variables in one question.', __TUTOR_TEXT_DOMAIN__) }

      @@ -180,7 +180,7 @@ const FormFillInTheBlanks = ({ field, questionId, validationError, setValidation { event.stopPropagation(); @@ -221,7 +221,12 @@ const FormFillInTheBlanks = ({ field, questionId, validationError, setValidation
      -

      {__('Match the number of answers to the number of blanks {dash} in your question.', 'tutor')}

      +

      + {__( + 'Match the number of answers to the number of blanks {dash} in your question.', + __TUTOR_TEXT_DOMAIN__, + )} +

      @@ -229,7 +234,7 @@ const FormFillInTheBlanks = ({ field, questionId, validationError, setValidation

      { // prettier-ignore - __( 'Separate multiple answers by a vertical bar |. 1 answer per {dash} variable is defined in the question. Example: Apple | Banana | Orange', 'tutor') + __( 'Separate multiple answers by a vertical bar |. 1 answer per {dash} variable is defined in the question. Example: Apple | Banana | Orange', __TUTOR_TEXT_DOMAIN__) }

      @@ -245,7 +250,7 @@ const FormFillInTheBlanks = ({ field, questionId, validationError, setValidation field.onChange(previousValue); }} > - {__('Cancel', 'tutor')} + {__('Cancel', __TUTOR_TEXT_DOMAIN__)}
      diff --git a/assets/react/v3/shared/components/fields/quiz/questions/FormImageAnswering.tsx b/assets/react/v3/shared/components/fields/quiz/questions/FormImageAnswering.tsx index 07300b5f9c..c7144d5229 100644 --- a/assets/react/v3/shared/components/fields/quiz/questions/FormImageAnswering.tsx +++ b/assets/react/v3/shared/components/fields/quiz/questions/FormImageAnswering.tsx @@ -160,7 +160,7 @@ const FormImageAnswering = ({
      - + - + - +
      } @@ -242,8 +242,8 @@ const FormImageAnswering = ({ url: inputValue.image_url || '', title: inputValue.image_url || '', }} - buttonText={__('Upload Image', 'tutor')} - infoText={__('Standard Size: 700x430 pixels', 'tutor')} + buttonText={__('Upload Image', __TUTOR_TEXT_DOMAIN__)} + infoText={__('Standard Size: 700x430 pixels', __TUTOR_TEXT_DOMAIN__)} uploadHandler={openMediaLibrary} clearHandler={clearHandler} emptyImageCss={styles.emptyImageInput} @@ -254,7 +254,7 @@ const FormImageAnswering = ({ {...field} ref={inputRef} type="text" - placeholder={__('Input answer here', 'tutor')} + placeholder={__('Input answer here', __TUTOR_TEXT_DOMAIN__)} value={inputValue.answer_title} onClick={(event) => { event.stopPropagation(); @@ -297,9 +297,12 @@ const FormImageAnswering = ({

      - {__('Students need to type their answers exactly as you write them here. Use ', 'tutor')} - {__('small caps', 'tutor')} - {__(' when writing the answer.', 'tutor')} + {__( + 'Students need to type their answers exactly as you write them here. Use ', + __TUTOR_TEXT_DOMAIN__, + )} + {__('small caps', __TUTOR_TEXT_DOMAIN__)} + {__(' when writing the answer.', __TUTOR_TEXT_DOMAIN__)}

      @@ -321,7 +324,7 @@ const FormImageAnswering = ({ } }} > - {__('Cancel', 'tutor')} + {__('Cancel', __TUTOR_TEXT_DOMAIN__)} diff --git a/assets/react/v3/shared/components/fields/quiz/questions/FormMatching.tsx b/assets/react/v3/shared/components/fields/quiz/questions/FormMatching.tsx index a4d990a3c3..c5b02500b8 100644 --- a/assets/react/v3/shared/components/fields/quiz/questions/FormMatching.tsx +++ b/assets/react/v3/shared/components/fields/quiz/questions/FormMatching.tsx @@ -157,7 +157,7 @@ const FormMatching = ({
      - + - + - +
      } > @@ -251,7 +251,7 @@ const FormMatching = ({ url: inputValue.image_url || '', title: inputValue.image_url || '', }} - infoText={__('Standard Size: 700x430 pixels', 'tutor')} + infoText={__('Standard Size: 700x430 pixels', __TUTOR_TEXT_DOMAIN__)} uploadHandler={openMediaLibrary} clearHandler={clearHandler} emptyImageCss={styles.emptyImageInput} @@ -262,7 +262,11 @@ const FormMatching = ({ {...field} type="text" ref={inputRef} - placeholder={!isImageMatching ? __('Question', 'tutor') : __('Image matched text..', 'tutor')} + placeholder={ + !isImageMatching + ? __('Question', __TUTOR_TEXT_DOMAIN__) + : __('Image matched text..', __TUTOR_TEXT_DOMAIN__) + } value={inputValue.answer_title} onClick={(event) => { event.stopPropagation(); @@ -304,7 +308,7 @@ const FormMatching = ({ { event.stopPropagation(); @@ -366,7 +370,7 @@ const FormMatching = ({ } }} > - {__('Cancel', 'tutor')} + {__('Cancel', __TUTOR_TEXT_DOMAIN__)} diff --git a/assets/react/v3/shared/components/fields/quiz/questions/FormMultipleChoiceAndOrdering.tsx b/assets/react/v3/shared/components/fields/quiz/questions/FormMultipleChoiceAndOrdering.tsx index 14a509d54e..ab2d599715 100644 --- a/assets/react/v3/shared/components/fields/quiz/questions/FormMultipleChoiceAndOrdering.tsx +++ b/assets/react/v3/shared/components/fields/quiz/questions/FormMultipleChoiceAndOrdering.tsx @@ -206,19 +206,20 @@ const FormMultipleChoiceAndOrdering = ({ clearHandler(); }} > - {__('Remove Image', 'tutor')} + {__('Remove Image', __TUTOR_TEXT_DOMAIN__)} } > @@ -230,7 +231,7 @@ const FormMultipleChoiceAndOrdering = ({
      - + - + - +
      } @@ -304,10 +305,10 @@ const FormMultipleChoiceAndOrdering = ({ value={{ id: Number(inputValue.image_id), url: inputValue.image_url || '', - title: __('Image', 'tutor'), + title: __('Image', __TUTOR_TEXT_DOMAIN__), }} - buttonText={__('Upload Image', 'tutor')} - infoText={__('Size: 700x430 pixels', 'tutor')} + buttonText={__('Upload Image', __TUTOR_TEXT_DOMAIN__)} + infoText={__('Size: 700x430 pixels', __TUTOR_TEXT_DOMAIN__)} uploadHandler={openMediaLibrary} clearHandler={clearHandler} emptyImageCss={styles.emptyImageInput} @@ -318,7 +319,7 @@ const FormMultipleChoiceAndOrdering = ({