Hi,
Please help :-)
I need to create the button for changing language for the end user.
I found an example, but it didn't work for me:
http://sigmawidgets.com/forum/visual-ajax-gui-builder/how-to-create-localisation/ Where I have made a mistake?
1. I created new project and copied the JavaScript Code from the example into my test-application. It works. There is one label “slabel1”and one button “to de”
htdocs/apps/sigma-visual-builder/VisualJS/projects/LocationTest/App/js/index.js
Class('App', 'linb.Com',{
Instance:{
iniComponents:function(){
// [[code created by jsLinb UI Builder
var host=this, children=[], append=function(child){children.push(child.get(0))};
append((new linb.UI.SLabel)
.host(host,"slabel1")
.setLeft(210)
.setTop(70)
.setCaption("$app.caption.slabel1")
);
append((new linb.UI.SButton)
.host(host,"slabel2")
.setLeft(250)
.setTop(120)
.setCaption("to \"de\"")
.onClick("_sbutton3_onclick")
);
return children;
// ]]code created by jsLinb UI Builder
},
_sbutton3_onclick:function (profile, e, src, value) {
// change locale to 'de'
linb.setLang('de');
}
}
});
2. I created new local file with code from the example
htdocs/apps/sigma-visual-builder/VisualJS/projects/LocationTest/Locale/de.js
(linb.Locale.de||(linb.Locale.de={})).app={
caption:{
slabel1:"DemoDemo"
}
};
3.I copied the same de.js file into folder
htdocs/apps/sigma-visual-builder/runtime/jsLinb/Locale
4.I run this application and press the button “to de” .
As I understand the text on the label “slabel1” should change to "DemoDemo" but doesn't . Why?
Thank you for help!