diff --git a/assets/core/scss/components/_calendar.scss b/assets/core/scss/components/_calendar.scss index 582d018da2..768187826d 100644 --- a/assets/core/scss/components/_calendar.scss +++ b/assets/core/scss/components/_calendar.scss @@ -94,8 +94,8 @@ } .tutor-range-calendar-popover { - width: 700px; - max-width: 700px; + min-width: 700px; + max-width: 750px; @include tutor-breakpoint-down(md) { width: 300px; diff --git a/assets/core/ts/index.ts b/assets/core/ts/index.ts index fdb3b7219a..1e30ef041a 100644 --- a/assets/core/ts/index.ts +++ b/assets/core/ts/index.ts @@ -1,5 +1,6 @@ import collapse from '@alpinejs/collapse'; import focus from '@alpinejs/focus'; +import { setLocaleData } from '@wordpress/i18n'; import Alpine from 'alpinejs'; import { TutorComponentRegistry } from '@Core/ts/ComponentRegistry'; @@ -75,11 +76,16 @@ const initializePlugin = async () => { }); TutorComponentRegistry.registerLazy({ - calendar: () => - import( + calendar: () => { + if (tutorConfig.calendar_locales) { + setLocaleData(tutorConfig.calendar_locales, 'tutor'); + } + + return import( /* webpackChunkName: "tutor-calendar" */ '@Core/ts/components/calendar' - ).then(({ calendarMeta }) => calendarMeta), + ).then(({ calendarMeta }) => calendarMeta); + }, form: () => import( diff --git a/classes/Assets.php b/classes/Assets.php index ef7a97a588..63cf28ca78 100644 --- a/classes/Assets.php +++ b/classes/Assets.php @@ -374,6 +374,9 @@ public function modify_localize_data( $localize_data ) { } } } else { + if ( 'en_US' !== $localize_data['local'] ) { + $localize_data['calendar_locales'] = tutils()->get_script_locale_data( 'tutor-calendar', $localize_data['local'] ); + } // Assign quiz option. if ( ! empty( $post->post_type ) && 'tutor_quiz' === $post->post_type ) { diff --git a/classes/User.php b/classes/User.php index caed749f16..141fe08c6e 100644 --- a/classes/User.php +++ b/classes/User.php @@ -800,6 +800,7 @@ public function ajax_switch_profile() { } $switch_mode = ''; + $switch_label = ''; $current_mode = Input::post( 'current_mode' ); if ( ! in_array( $current_mode, array( self::VIEW_AS_INSTRUCTOR, self::VIEW_AS_STUDENT ), true ) ) { @@ -807,15 +808,17 @@ public function ajax_switch_profile() { } if ( self::VIEW_AS_INSTRUCTOR === $current_mode ) { - $switch_mode = self::VIEW_AS_STUDENT; + $switch_mode = self::VIEW_AS_STUDENT; + $switch_label = __( 'Student', 'tutor' ); } elseif ( self::VIEW_AS_STUDENT === $current_mode ) { - $switch_mode = self::VIEW_AS_INSTRUCTOR; + $switch_mode = self::VIEW_AS_INSTRUCTOR; + $switch_label = __( 'Instructor', 'tutor' ); } update_user_meta( $user_id, self::VIEW_MODE_USER_META, $switch_mode ); // translators:%s for switching mode. - $this->response_success( sprintf( __( 'Profile switched to %s!', 'tutor' ), $switch_mode ) ); + $this->response_success( sprintf( __( 'Profile switched to %s!', 'tutor' ), $switch_label ) ); } /** diff --git a/templates/dashboard/account/billing/order-history.php b/templates/dashboard/account/billing/order-history.php index 0b87d6ee12..ef0035eae5 100644 --- a/templates/dashboard/account/billing/order-history.php +++ b/templates/dashboard/account/billing/order-history.php @@ -89,7 +89,7 @@ title( 'No Orders Found!' ) + ->title( __( 'No Orders Found!', 'tutor' ) ) ->icon( tutor_utils()->get_themed_svg( 'images/illustrations/order-empty.svg' ) ) ->render(); else : diff --git a/templates/dashboard/discussions/comment-list.php b/templates/dashboard/discussions/comment-list.php index 1fd1506977..e0d3e0f047 100644 --- a/templates/dashboard/discussions/comment-list.php +++ b/templates/dashboard/discussions/comment-list.php @@ -105,7 +105,7 @@ title( 'No Comments Found!' ) + ->title( __( 'No Comments Found!', 'tutor' ) ) ->icon( tutor_utils()->get_themed_svg( 'images/illustrations/comments-empty.svg' ) ) ->render(); ?> diff --git a/templates/dashboard/discussions/qna-list.php b/templates/dashboard/discussions/qna-list.php index bc62a7b8fe..1bd9023956 100644 --- a/templates/dashboard/discussions/qna-list.php +++ b/templates/dashboard/discussions/qna-list.php @@ -77,7 +77,7 @@ title( 'No Questions Found!' ) + ->title( __( 'No Questions Found!', 'tutor' ) ) ->icon( tutor_utils()->get_themed_svg( 'images/illustrations/qna-empty.svg' ) ) ->render(); ?> diff --git a/templates/dashboard/instructor/logged-in.php b/templates/dashboard/instructor/logged-in.php index 499a643d4b..cacf1eac49 100644 --- a/templates/dashboard/instructor/logged-in.php +++ b/templates/dashboard/instructor/logged-in.php @@ -18,7 +18,7 @@ if ( 'try_again' === $instructor_status ) { Alert::make() - ->text( 'You have been rejected from being an instructor.' ) + ->text( __( 'You have been rejected from being an instructor.', 'tutor' ) ) ->variant( Alert::WARNING ) ->icon( Icon::WARNING ) ->render(); @@ -34,11 +34,11 @@ text( $instructor_status_text ) diff --git a/templates/dashboard/my-courses.php b/templates/dashboard/my-courses.php index d60020c68a..fdc4f2d65f 100644 --- a/templates/dashboard/my-courses.php +++ b/templates/dashboard/my-courses.php @@ -155,7 +155,7 @@ class="tutor-btn tutor-btn-primary tutor-btn-small tutor-gap-2" title( 'No Courses Found' ) + ->title( __( 'No Courses Found', 'tutor' ) ) ->icon( tutor_utils()->get_themed_svg( 'images/illustrations/learning-empty.svg' ) ) ->render(); ?> diff --git a/templates/learning-area/lesson/comments.php b/templates/learning-area/lesson/comments.php index db1dd9d9bd..b5fb21436a 100644 --- a/templates/learning-area/lesson/comments.php +++ b/templates/learning-area/lesson/comments.php @@ -105,8 +105,8 @@ class="tutor-flex tutor-items-center tutor-justify-between tutor-px-6 tutor-py-5 id( 'delete-comment-modal' ) - ->title( 'Delete This Item?' ) - ->message( 'This action cannot be undone.' ) + ->title( __( 'Delete This Item?', 'tutor' ) ) + ->message( __( 'This action cannot be undone.', 'tutor' ) ) ->icon( Icon::DELETE_2, 80 ) ->mutation_state( 'deleteCommentMutation' ) ->confirm_handler( 'deleteCommentMutation?.mutate({ comment_id: payload?.commentId })' ) diff --git a/templates/learning-area/subpages/qna.php b/templates/learning-area/subpages/qna.php index 0d50cc90e2..cbadff076b 100644 --- a/templates/learning-area/subpages/qna.php +++ b/templates/learning-area/subpages/qna.php @@ -117,7 +117,7 @@ title( 'No Questions Found!' ) + ->title( __( 'No Questions Found!', 'tutor' ) ) ->icon( tutor_utils()->get_themed_svg( 'images/illustrations/qna-empty.svg' ) ) ->render(); ?>