In WPLMS version 2.8 we’ve added a new feature called User Tours. This is user guided tours or walkthroughs to guide your users step by step through the entire process.
In this tutorial we’ll learn how to translate user tours.
Step 1 : Download Tours file
Download the tours.json file. Refer Download tours.json (extract the zip and locate tours.json inside the extracted files)
It is the same file located in your setup at yoursite.com/wp-content/plugins/vibe-course-module/includes/js/tours.json
Tip : Use the file in your setup for latest tours.json file
Step 2 : Translate the file
Open the file in any text editor and you’ll find code inside it. No need to worry, you do not need to make any changes in the code.
Locate the Title and Content part in the code and you’ll find strings which you need to translate. Note the “double quotes” at the start and the at the end of the strings.
This is the title and content of every step respectively.
===
Example translation :
Step 3 : Upload the file
Although you can upload the file any where, where ever you can access it via browser url. Since it is a .json file you can not upload it in WordPress media uploader directly.
Instead you can follow this little trick.
- Create a folder in your desktop : tours
- Inside this folder paste the translated tours.json file
- Create another text file inside the tours folder index.txt and rename it to index.html. You can also copy the index.html file from Step 1 : Download tours.json link, inside the .zip download.
- Now zip the tours folder and you’ll get a tours.zip file.
- Now open any post or unit or course in WP Admin area. And use the “Upload Zip” button to upload the tours.zip. (screenshot)
- Embed the iframe code in the content and copy the iframe source link. (screenshot) and rename index.html to tours.json
- To confirm, paste the link in the browser : http://yoursite.com/../…/tours.json and it should open your translated version of the tours file.
Step 4 : Load the new tours.json file
Now the last step, we need to load the new tours.json file. Add this code in your child theme – functions.php or in WPLMS Customzier – wplms-customizer.php
replace : http://YOURSITE/wp-content/uploads/package_uploads/tours/tours.json with the path of your tours.json which we opened in the browser to confirm the file.
add_filter('bp_course_default_tours',function($x){ return 'http://YOURSITE/wp-content/uploads/package_uploads/tours/tours.json'; });
Step 5 : Done.
The new translations would now apply.