//check out this current jsfiddle for more details: http://jsfiddle.net/0ht35rpb/45/
I'm attempting to create a loop through a JSON navigation tree in order to match the alternative language counterpart when a user navigates to a specific page.
//Here is the JSON structure:
{
"langs" : [
{
"lang" : "de",
"lines" : {
// German language menu items and links here...
}
},
{
"lang" : "en",
"lines" : {
// English language menu items and links here...
}
}
]
}
My JavaScript functions are designed to handle this scenario based on the current language and URL. For instance, if CURRENTLNG is set to 'en' and CURRENTURL is '/en/services', the function fetchFooterUrls() should return an array with ['/en/services', '/de/dienstleistungen']. However, it encounters issues with retrieving third level navigation counterparts like ["/en/popular-projects/compliance/compliance-eng", "/de/beliebte-projekte/compliance/compliance-pruefung-kmu"].
Your script for navigating through the language pair URLs looks promising, but there may be some errors in implementation that need resolving. It's crucial to ensure the correct handling of children elements within the JSON object for smooth navigation experience.
//If you're a moderator or expert on this subject, your input would be greatly appreciated!