I have been doing multilingual LearnDash projects for a while now, and I like to work with Translatepress whenever I need to translate a site, usually English and French.

Here’s a review of LearnDash & Translatepress, and some of the challenges I faced translating some advanced LearnDash functions.

Translatepress Works Fine With LearnDash

If you’re a LearnDash user seeking a reliable solution for translating your online courses, TranslatePress is the answer to your multilingual needs. LearnDash offers a powerful platform for creating and managing courses. However, the potential of reaching a global audience is limited when content is confined to a single language. TranslatePress seamlessly integrates with LearnDash, providing a user-friendly and efficient way to make your courses accessible worldwide. With its easy translation management system, TranslatePress enables users to translate content directly from the front end, eliminating the need for complicated backend navigation.

One of TranslatePress’s standout features is its real-time editing capability. As you make changes to your translations, you can instantly see the results, ensuring accuracy and reducing the time spent on the translation process. The plugin supports multiple languages, allowing you to cater to diverse audiences and expand the reach of your LearnDash courses globally.

TranslatePress also ensures that your translated content remains SEO-friendly, helping your courses rank well in different regions. The compatibility between TranslatePress and LearnDash is seamless, providing users with a hassle-free translation experience that enhances the accessibility and inclusivity of their e-learning content.

Getting started with TranslatePress is a straightforward process. After installing and activating the plugin, users can configure settings to their preferences, including language selection and URL format. The translation process occurs directly on the front end of LearnDash courses, with an intuitive interface that requires no technical expertise. TranslatePress supports dynamic content generated by LearnDash, such as quizzes, forums, and user profiles, maintaining a consistent and localized experience for learners.

To translate your LearnDash site to a second language, you can follow this step-by-step by the Translatepress team which is very accurate and comprehensive.

LearnDash Video Progression with Presto Player

The main issue I recently faced was with video progression. I had a LearnDash site that has course translated in French and English. We could have created different LD courses, one for each language, but that would not have been clean from our perspective. We wanted to have only 1 course… per course!

All of these courses were using video progression. The videos were hosted at Vimeo and displayed on the site using Presto Player (free version).

I could not translate videos using Translatepress. That was expected by reading their documentation. I tried a few things. I first tried to add both Presto videos (1 per language) to the post and to use Kadence tools to show and hide each version. That did not work. I also tried the solution proposed by the Translatepress documentation, which did not work for me either.

The problem was essentially caused by the way Presto Player adds a number to the presto-player element (red circle below). When you have 2 Presto videos on the same page, the second video does not control video progression and upon page load, the topic is automatically marked as complete. This is annoying.

Multilingual LearnDash With Translatepress

The Solution to Multilingual LearnDash Video Progression with Translatepress

I came up with the code below that outputs a shortcode. In order to work, the code must be placed in functions.php.

add_shortcode('lpfdu_ld_pp_user_locale', 'lpfdu_ld_pp_user_locale_shortcode');
function lpfdu_ld_pp_user_locale_shortcode($atts) {
    if ( is_user_logged_in() ) {
        $user = wp_get_current_user();

        $site_locale = get_locale();

        if ( in_array( $site_locale, ['fr_CA', 'fr_FR'] ) ) {
            $fr_id = isset($atts['fr_id']) ? $atts['fr_id'] : null;
            if ($fr_id) {
                return do_shortcode("[presto_player id=$fr_id]");
            } else {
                return 'Missing fr_id attribute';
            }
        } elseif ( in_array( $site_locale, ['en_CA', 'en_US', 'en_UK'] ) ) {
            $en_id = isset($atts['en_id']) ? $atts['en_id'] : null;
            if ($en_id) {
                return do_shortcode("[presto_player id=$en_id]");
            } else {
                return 'Missing en_id attribute';
            }
        } else {
            return 'Unknown locale';
        }
    } else {
        return 'User not logged in.';
    }
}

The lpfdu_ld_pp_user_locale shortcode goes on the topic page in replacement of the usual Presto Player block.

The shortcode looks like this : [lpfdu_ld_pp_user_locale en_id=342 fr_id=321].

Since the website I was working on had to be in French and English, I implemented two parameters, one for each language. The number is the post id of the Presto Player video in the right language.

The function loads the right video from Presto, and the presto-player id is always 1, so no more problems with LearnDash video progression.

Feel free to use the code… at your own risk!

We’re a digital agency focused on LearnDash, WooCommerce and Kadence. We develop e-learning and e-commerce platforms for small businesses and entrepreneurs.

Frederick Dugas

Building quality IT solutions to small & medium organizations. I am passionate about automation and WordPress.