diff --git a/.husky/pre-commit b/.husky/pre-commit index 5ee7abd87c..6aa13dae08 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1 +1 @@ -pnpm exec lint-staged +pnpm exec lint-staged --no-revert diff --git a/.lintstagedrc b/.lintstagedrc index a0b7c06eb7..c1b609d560 100644 --- a/.lintstagedrc +++ b/.lintstagedrc @@ -1,5 +1,7 @@ { "*.{ts,tsx}": ["pnpm exec eslint --fix", "bash -c 'pnpm exec tsc --noEmit'"], "*.{ts,tsx,jsonc,md}": ["pnpm exec prettier --write"], - "*.php": ["./vendor/bin/phpstan analyze --memory-limit=-1"] + "*.php": [ + "bash -c 'if [ ! -x ./vendor/bin/phpstan ]; then printf \"\\nError: PHPStan is not installed.\\n\\nInstall it with:\\n composer install\\n\\nThen retry your commit.\\n\\n\" >&2; exit 1; fi; exec ./vendor/bin/phpstan analyze --memory-limit=-1 \"$@\"' --" + ] } 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/readme.txt b/readme.txt index 33de9df212..4739a56fdb 100644 --- a/readme.txt +++ b/readme.txt @@ -5,7 +5,7 @@ Tags: lms, course, elearning, education, learning management system Requires at least: 5.3 Tested up to: 7.0 Requires PHP: 7.4 -Stable tag: 4.0.3 +Stable tag: 4.0.4 License: GPLv3 License URI: https://www.gnu.org/licenses/gpl-3.0.html @@ -338,6 +338,13 @@ Tutor LMS allows you to offer certificates to your students upon course completi == Changelog == += 4.0.4 - 31 July, 2026 + +Fix: Resolved the dark theme compatibility issue in the Course Builder. +Fix: Added translation support for some previously untranslatable strings. +Fix: Fixed the incorrect update notification in Tutor LMS Pro. (Pro) +Fix: Prevented certificates from appearing for courses with no assigned certificate. (Pro) + = 4.0.3 - 24 July, 2026 Fix: Resolved an issue where quiz submissions failed in Legacy Mode. 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(); ?> diff --git a/tutor.php b/tutor.php index 3c4dc04008..73a80b0cf1 100644 --- a/tutor.php +++ b/tutor.php @@ -4,7 +4,7 @@ * Plugin URI: https://tutorlms.com * Description: Build and manage professional online courses with unlimited lessons, a flexible quiz engine, and a complete student learning experience. No coding needed. * Author: Themeum - * Version: 4.0.3 + * Version: 4.0.4 * Author URI: https://themeum.com * Requires PHP: 7.4 * Requires at least: 5.3 @@ -26,7 +26,7 @@ * * @since 1.0.0 */ -define( 'TUTOR_VERSION', '4.0.3' ); +define( 'TUTOR_VERSION', '4.0.4' ); define( 'TUTOR_FILE', __FILE__ ); define( 'TUTOR_ENV', 'PROD' ); // DEV || PROD. diff --git a/views/pages/course-builder.php b/views/pages/course-builder.php index 6107bffaba..81489cf567 100644 --- a/views/pages/course-builder.php +++ b/views/pages/course-builder.php @@ -31,7 +31,7 @@ -> +>