im trying to make dynamic list. im using the following code to change the list if the language is change
var getLangu = window.location.search.split("&");
getLangu.forEach(function(element){
if(element == "P_language=en"){
wid5.loadList("live/112501426007396846/data/46665500-06ce-11e6-bacc-066d75fba2ef?P_version=${157768}&P_mode=${LIVE}");
wid26.loadList("live/112501426007396846/data/1bc9cb80-06d1-11e6-bacc-066d75fba2ef?P_version=${157768}&P_mode=${LIVE}");
id_hebergement.loadList("live/112501426007396846/data/ac3d6f10-0626-11e6-a4be-02b3a23437c9?P_version=${157768}&P_mode=${LIVE}");
wid30.loadList("live/112501426007396846/data/ac3d6f10-0626-11e6-a4be-02b3a23437c9?P_version=${157768}&P_mode=${LIVE}");
wid15.loadList("live/112501426007396846/data/ac3d6f10-0626-11e6-a4be-02b3a23437c9?P_version=${157768}&P_mode=${LIVE}");
id_voyage_avec_un_autre_collaborateur.loadList("live/112501426007396846/data/ac3d6f10-0626-11e6-a4be-02b3a23437c9?P_version=${157768}&P_mode=${LIVE}");
}else if(element == "P_language=fr"){
wid5.loadList("live/112501426007396846/data/7f3e1980-4d65-11e5-8e86-22000b5494ab?P_version=${157768}&P_mode=${LIVE}");
wid26.loadList("live/112501426007396846/data/c1b88800-57c8-11e5-9cc5-22000b8b31dc?P_version=${157768}&P_mode=${LIVE}");
id_hebergement.loadList("live/112501426007396846/data/c1d2edd0-57c8-11e5-9cc5-22000b8b31dc?P_version=${157768}&P_mode=${LIVE}");
wid30.loadList("live/112501426007396846/data/c1d2edd0-57c8-11e5-9cc5-22000b8b31dc?P_version=${157768}&P_mode=${LIVE}");
wid15.loadList("live/112501426007396846/data/c1d2edd0-57c8-11e5-9cc5-22000b8b31dc?P_version=${157768}&P_mode=${LIVE}");
id_voyage_avec_un_autre_collaborateur.loadList("live/112501426007396846/data/c1d2edd0-57c8-11e5-9cc5-22000b8b31dc?P_version=${157768}&P_mode=${LIVE}");
}
});
if i launch it in the console it work fine but not in the WI in a widget script nothing happen the script isn't executing
ty by advance
Regards
function SetLang(){
var getLangu = window.location.search.split("&");
getLangu.forEach(function(element){
if(element == "P_language=en"){
wid5.loadList("live/112501426007396846/data/46665500-06ce-11e6-bacc-066d75fba2ef?P_version=${157768}&P_mode=${LIVE}");
wid26.loadList("live/112501426007396846/data/1bc9cb80-06d1-11e6-bacc-066d75fba2ef?P_version=${157768}&P_mode=${LIVE}");
id_hebergement.loadList("live/112501426007396846/data/ac3d6f10-0626-11e6-a4be-02b3a23437c9?P_version=${157768}&P_mode=${LIVE}");
wid30.loadList("live/112501426007396846/data/ac3d6f10-0626-11e6-a4be-02b3a23437c9?P_version=${157768}&P_mode=${LIVE}");
wid15.loadList("live/112501426007396846/data/ac3d6f10-0626-11e6-a4be-02b3a23437c9?P_version=${157768}&P_mode=${LIVE}");
id_voyage_avec_un_autre_collaborateur.loadList("live/112501426007396846/data/ac3d6f10-0626-11e6-a4be-02b3a23437c9?P_version=${157768}&P_mode=${LIVE}");
}else if(element == "P_language=fr"){
wid5.loadList("live/112501426007396846/data/7f3e1980-4d65-11e5-8e86-22000b5494ab?P_version=${157768}&P_mode=${LIVE}");
wid26.loadList("live/112501426007396846/data/c1b88800-57c8-11e5-9cc5-22000b8b31dc?P_version=${157768}&P_mode=${LIVE}");
id_hebergement.loadList("live/112501426007396846/data/c1d2edd0-57c8-11e5-9cc5-22000b8b31dc?P_version=${157768}&P_mode=${LIVE}");
wid30.loadList("live/112501426007396846/data/c1d2edd0-57c8-11e5-9cc5-22000b8b31dc?P_version=${157768}&P_mode=${LIVE}");
wid15.loadList("live/112501426007396846/data/c1d2edd0-57c8-11e5-9cc5-22000b8b31dc?P_version=${157768}&P_mode=${LIVE}");
id_voyage_avec_un_autre_collaborateur.loadList("live/112501426007396846/data/c1d2edd0-57c8-11e5-9cc5-22000b8b31dc?P_version=${157768}&P_mode=${LIVE}");
}
});
return true
}
SetLang();
changed nothing , no error , the application doesn't read the widget at all i think. there is other widget js in the application that are working fine.
ps : it's a test version of a live version
Regards
Gatibelza Gary
Neopost france
i have a working app in prod.
i need to translate the app.
i already work with the app translator but the app can't translate list so i made a js code for this purpose.
if i launch the js from the console js in the explorer it work but when i put it in a widget it doesn't.
i can't figure out what blocking the code from executing. the label appear but not the console.log or anything else.
Regards
regard