Forum Discussion
ChantalCallow-c
5 years agoCommunity Member
Multiple languages in TOC
I am going to have a course that is in 3 (or more) languages. Each language will be a Scene, and the learner will select their language on the first slide.
Is there a way in which I can show them ...
SamHill
5 years agoSuper Hero
Hi Chantal, I don't think this is possible via Storyline configuration. There is no means to show TOC item based on a language selection.
Others might have better suggestions, but you could hide certain menu options using JavaScript based on the language selection.
I provided a solution for another user who wanted to hide certain menu options based on the user type, but could be adapted to a language selection.
You would have a Storyline variable called "lang" which would be set to the language value based on the users choice. That is then mapped to a menu item in the TOC to ensure it is the only one shown.
This isn't fully tested, but should be close to what you will need.
var player = GetPlayer();
var lang = player.GetVar('lang'); // get language from Storyline
var menu = document.querySelector('ul[aria-label="Menu"]'); // main menu
var mapping = {
'en' : 0,
'fr' : 1,
'ch' : 2
}; // languages mapped to the menu items to hide
menu.children.style.display = "none"; // hide all other lang
menu.children[mapping[lang]].style.display = "list-item"; // show this lang