• Resolved maycal

    (@maycal)


    This is not a question, this is the DECISION of the issue.

    As you know, you are unable to translate LernPress Difficulty Level (Beginner, Intermediate, Expert) by using Loco translate. It will translate only on back-end (admin panel), but on a front-end will not (will not translate on a course page).

    So, what do we need to translate LernPress Difficulty Level (Beginner, Intermediate, Expert) on a course page?

    1. Go to “wp-content/plugins/learnpress/inc/admin/views/meta-boxes/course/” and take “setting.php” file.

    2. Find:

    
    array(
    						'options' => array(
    							''             => esc_html__( 'All levels', 'learnpress' ),
    							'beginner'     => esc_html__( 'Beginner', 'learnpress' ),
    							'intermediate' => esc_html__( 'Intermediate', 'learnpress' ),
    							'expert'       => esc_html__( 'Expert', 'learnpress' ),
    						),
    					)
    				),

    and replace to whatever you want, for example:

    array(
    						'options' => array(
    							''             => esc_html__( 'All levels', 'learnpress' ),
    							'Начальный'     => esc_html__( 'Начальный', 'learnpress' ),
    							'Продвинутый' => esc_html__( 'Продвинутый', 'learnpress' ),
    							'Экспертный'       => esc_html__( 'Экспертный', 'learnpress' ),
    						),
    					)
    				),

    3. But it’s not done yet. You need to update your course. Go to admin panel->courses, choose course, then edit course, choose Difficulty Level and save your course.

    4. Now you will see translated words on yours course page.

    How does it works: LearnPress back-end writes the words to database during the course creation or updating process. Then, LearnPress front-end takes the words from database. It’s mean, that words: “beginner, intermediate, expert” stores in database. When we changed setting.php file, and then updated the course, LearnPress wrote to database new, translated words.

    • This topic was modified 3 years, 5 months ago by maycal.
    • This topic was modified 3 years, 5 months ago by maycal.
Viewing 1 replies (of 1 total)
  • Thread Starter maycal

    (@maycal)

    The phrase “All levels” is successfully translated using Loco (both sides), so I did not change it in the code

Viewing 1 replies (of 1 total)
  • The topic ‘How To Translate LernPress Difficulty Level’ is closed to new replies.