+ long num;
+ if ( !str.ToLong(&num) || num < 0 )
+ {
+ str = _("You've probably entered an invalid number.");
+ }
+ else if ( num == 9 )
+ {
+ // this message is not translated (not in catalog) because we used _T()
+ // and not _() around it
+ str = _T("You've found a bug in this program!");
+ }
+ else if ( num == 17 )
+ {
+ str.clear();
+
+ // string must be split in two -- otherwise the translation would't be
+ // found
+ str << _("Congratulations! you've won. Here is the magic phrase:")
+ << _("cannot create fifo `%s'");
+ }
+ else
+ {
+ // this is a more implicit way to write _() but note that if you use it
+ // you must ensure that the strings get extracted in the message
+ // catalog as by default xgettext won't do it (it only knows of _(),
+ // not wxGetTranslation())
+ str = wxGetTranslation(_T("Bad luck! try again..."));
+ }
+
+ wxMessageBox(str, _("Result"), wxOK | wxICON_INFORMATION);