• Resolved vengr7262525

    (@vengr7262525)


    Hello! Can’t find where to change the letters show the duration in English, Russian format ! for example now as shown in the screenshot, the duration is displayed H:i:s but I have so ч:м:с.
    https://yadi.sk/i/h4hgz2UPQNOiYQ
    Tell me what file I need to change?
    thank you

    • This topic was modified 2 years, 10 months ago by vengr7262525.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Hello @vengr7262525,

    For now this string untranslateble with Tutor yet.
    Because this string not use standard i18l function by WordPress:
    http://prntscr.com/14me50c

    Hope that the plugin author will fix it soon.

    – So to quick fix this bug you can write custom function in Child Theme then override templates in Child theme.

    This is custom function for you: Copy & paste it into your-child-theme/functions.php

    function my_child_theme_get_tutor_course_duration_context( $course_id = 0 ) {
        if ( ! $course_id ) {
            $course_id = get_the_ID();
        }
        if ( ! $course_id ) {
            return '';
        }
        $duration        = get_post_meta( $course_id, '_course_duration', true );
        $durationHours   = tutor_utils()->avalue_dot( 'hours', $duration );
        $durationMinutes = tutor_utils()->avalue_dot( 'minutes', $duration );
        $durationSeconds = tutor_utils()->avalue_dot( 'seconds', $duration );
    
        if ( $duration ) {
            $output = '';
            if ( $durationHours > 0 ) {
                $output .= sprintf( __( '%1$sh', 'child-theme-textdomain' ) . ' ', $durationHours );
            }
    
            if ( $durationMinutes > 0 ) {
                $output .= sprintf( __( '%1$sm', 'child-theme-textdomain' ) . ' ', $durationMinutes );
            }
    
            if ( $durationSeconds > 0 ) {
                $output .= sprintf( __( '%1$ss', 'child-theme-textdomain' ) . ' ', $durationSeconds );
            }
    
            return $output;
        }
    
        return false;
    }

    Then copy template: course-topics.php from plugin:

    yoursite/wp-content/plugins/tutor/templates/single/course/course-topics.php

    => yoursite/wp-content/themes/your-child-theme/tutor/single/course/course-topics.php

    Then file copied, open it & edit like this:
    http://prntscr.com/14mg0ge

    Then you can use Loco plugin to translate these string.

    • This reply was modified 2 years, 10 months ago by vandung93.
    • This reply was modified 2 years, 10 months ago by vandung93.

    Hello @vengr7262525,

    You can navigate to the following file that renders course duration on the frontend

    \wp-content\plugins\tutor\includes\tutor-template-functions.php

    Thanks for sharing your findings. We shall fix this in our upcoming update.

    Thread Starter vengr7262525

    (@vengr7262525)

    @vandung93 and @munayam Thank you very much!

    You are welcome!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to change the letters of the format of the time ?’ is closed to new replies.