Project

General

Profile

Bug #1492 » setLocale.cpp

Koen Deforche, 10/23/2012 08:53 AM

 
#include <Wt/WApplication>
#include <Wt/WLabel>
#include <Wt/WPushButton>
#include <Wt/WContainerWidget>
#include <Wt/WCheckBox>
#include <iostream>

using namespace Wt;

class Test : public WApplication
{
public:
Test(const WEnvironment& env)
: WApplication(env)
{
messageResourceBundle().use("text");

Wt::WCheckBox *check = new Wt::WCheckBox(WString::tr("hello"), root());

Wt::WPushButton *button = new Wt::WPushButton("Change", root());
button->clicked().connect(this, &Test::change);
}

void change() {
setLocale("fr");
}
};

WApplication *createApplication(const WEnvironment& env){
return new Test(env);
}

int main(int argc, char *argv[]){
return WRun(argc, argv, createApplication);
}

(1-1/3)