]>
Commit | Line | Data |
---|---|---|
c801d85f KB |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: internat.cpp | |
c7f3b78b | 3 | // Purpose: Demonstrates internationalisation (i18n) support |
c801d85f KB |
4 | // Author: Vadim Zeitlin/Julian Smart |
5 | // Modified by: | |
6 | // Created: 04/01/98 | |
7 | // RCS-ID: $Id$ | |
6aa89a22 | 8 | // Copyright: (c) Julian Smart |
c7f3b78b | 9 | // Licence: wxWindows license |
c801d85f KB |
10 | ///////////////////////////////////////////////////////////////////////////// |
11 | ||
0c545056 FM |
12 | // NOTE: don't miss the "readme.txt" file which comes with this sample! |
13 | ||
14 | ||
15 | ||
017fcf32 VZ |
16 | // ============================================================================ |
17 | // declarations | |
18 | // ============================================================================ | |
19 | ||
20 | // ---------------------------------------------------------------------------- | |
21 | // headers | |
22 | // ---------------------------------------------------------------------------- | |
c801d85f KB |
23 | |
24 | // For compilers that support precompilation, includes "wx/wx.h". | |
25 | #include "wx/wxprec.h" | |
26 | ||
27 | #ifdef __BORLANDC__ | |
28 | #pragma hdrstop | |
29 | #endif | |
30 | ||
31 | #ifndef WX_PRECOMP | |
3a331275 | 32 | #include "wx/wx.h" |
c801d85f KB |
33 | #endif |
34 | ||
35 | #include "wx/intl.h" | |
c7f3b78b | 36 | #include "wx/file.h" |
c801d85f | 37 | #include "wx/log.h" |
3a331275 | 38 | #include "wx/cmdline.h" |
c801d85f | 39 | |
618f2efa | 40 | #if defined(__WXGTK__) || defined(__WXX11__) || defined(__WXMOTIF__) || defined(__WXMAC__) || defined(__WXMGL__) |
47908e25 RR |
41 | #include "mondrian.xpm" |
42 | #endif | |
43 | ||
017fcf32 VZ |
44 | // ---------------------------------------------------------------------------- |
45 | // private classes | |
46 | // ---------------------------------------------------------------------------- | |
47 | ||
c801d85f KB |
48 | // Define a new application type |
49 | class MyApp: public wxApp | |
50 | { | |
51 | public: | |
3a331275 VZ |
52 | MyApp() { m_lang = wxLANGUAGE_UNKNOWN; } |
53 | ||
54 | virtual void OnInitCmdLine(wxCmdLineParser& parser); | |
55 | virtual bool OnCmdLineParsed(wxCmdLineParser& parser); | |
aec18ff7 | 56 | virtual bool OnInit(); |
c7f3b78b | 57 | |
c801d85f | 58 | protected: |
3a331275 VZ |
59 | wxLanguage m_lang; // language specified by user |
60 | wxLocale m_locale; // locale we'll be using | |
c801d85f KB |
61 | }; |
62 | ||
63 | // Define a new frame type | |
64 | class MyFrame: public wxFrame | |
aec18ff7 | 65 | { |
c7f3b78b | 66 | public: |
017fcf32 | 67 | MyFrame(wxLocale& m_locale); |
c7f3b78b VZ |
68 | |
69 | public: | |
cec5ffc4 | 70 | void OnTestLocaleAvail(wxCommandEvent& event); |
aec18ff7 | 71 | void OnAbout(wxCommandEvent& event); |
cec5ffc4 VZ |
72 | void OnQuit(wxCommandEvent& event); |
73 | ||
aec18ff7 MB |
74 | void OnPlay(wxCommandEvent& event); |
75 | void OnOpen(wxCommandEvent& event); | |
849a28d0 VS |
76 | void OnTest1(wxCommandEvent& event); |
77 | void OnTest2(wxCommandEvent& event); | |
78 | void OnTest3(wxCommandEvent& event); | |
f13880a9 | 79 | |
aec18ff7 MB |
80 | DECLARE_EVENT_TABLE() |
81 | ||
82 | wxLocale& m_locale; | |
c801d85f KB |
83 | }; |
84 | ||
017fcf32 VZ |
85 | // ---------------------------------------------------------------------------- |
86 | // constants | |
87 | // ---------------------------------------------------------------------------- | |
88 | ||
c801d85f | 89 | // ID for the menu commands |
c7f3b78b VZ |
90 | enum |
91 | { | |
cec5ffc4 VZ |
92 | INTERNAT_TEST = wxID_HIGHEST + 1, |
93 | INTERNAT_PLAY, | |
849a28d0 VS |
94 | INTERNAT_TEST_1, |
95 | INTERNAT_TEST_2, | |
6ea0cc70 | 96 | INTERNAT_TEST_3 |
c7f3b78b | 97 | }; |
c801d85f | 98 | |
79b4079f VZ |
99 | // language data |
100 | static const wxLanguage langIds[] = | |
101 | { | |
102 | wxLANGUAGE_DEFAULT, | |
103 | wxLANGUAGE_FRENCH, | |
7a90a4db | 104 | wxLANGUAGE_ITALIAN, |
79b4079f VZ |
105 | wxLANGUAGE_GERMAN, |
106 | wxLANGUAGE_RUSSIAN, | |
107 | wxLANGUAGE_BULGARIAN, | |
108 | wxLANGUAGE_CZECH, | |
109 | wxLANGUAGE_POLISH, | |
110 | wxLANGUAGE_SWEDISH, | |
111 | #if wxUSE_UNICODE || defined(__WXMOTIF__) | |
112 | wxLANGUAGE_JAPANESE, | |
113 | #endif | |
114 | #if wxUSE_UNICODE | |
115 | wxLANGUAGE_GEORGIAN, | |
116 | wxLANGUAGE_ENGLISH, | |
978af864 VZ |
117 | wxLANGUAGE_ENGLISH_US, |
118 | wxLANGUAGE_ARABIC, | |
119 | wxLANGUAGE_ARABIC_EGYPT | |
79b4079f VZ |
120 | #endif |
121 | }; | |
122 | ||
123 | // note that it makes no sense to translate these strings, they are | |
124 | // shown before we set the locale anyhow | |
125 | const wxString langNames[] = | |
126 | { | |
bf2d9237 FM |
127 | "System default", |
128 | "French", | |
129 | "Italian", | |
130 | "German", | |
131 | "Russian", | |
132 | "Bulgarian", | |
133 | "Czech", | |
134 | "Polish", | |
135 | "Swedish", | |
79b4079f | 136 | #if wxUSE_UNICODE || defined(__WXMOTIF__) |
bf2d9237 | 137 | "Japanese", |
79b4079f VZ |
138 | #endif |
139 | #if wxUSE_UNICODE | |
bf2d9237 FM |
140 | "Georgian", |
141 | "English", | |
142 | "English (U.S.)", | |
143 | "Arabic", | |
144 | "Arabic (Egypt)" | |
79b4079f VZ |
145 | #endif |
146 | }; | |
147 | ||
148 | // the arrays must be in sync | |
149 | wxCOMPILE_TIME_ASSERT( WXSIZEOF(langNames) == WXSIZEOF(langIds), | |
150 | LangArraysMismatch ); | |
151 | ||
017fcf32 | 152 | // ---------------------------------------------------------------------------- |
be5a51fb | 153 | // wxWidgets macros |
017fcf32 VZ |
154 | // ---------------------------------------------------------------------------- |
155 | ||
c801d85f | 156 | BEGIN_EVENT_TABLE(MyFrame, wxFrame) |
cec5ffc4 | 157 | EVT_MENU(INTERNAT_TEST, MyFrame::OnTestLocaleAvail) |
aec18ff7 | 158 | EVT_MENU(wxID_ABOUT, MyFrame::OnAbout) |
cec5ffc4 VZ |
159 | EVT_MENU(wxID_EXIT, MyFrame::OnQuit) |
160 | ||
161 | EVT_MENU(INTERNAT_PLAY, MyFrame::OnPlay) | |
6ea0cc70 | 162 | EVT_MENU(wxID_OPEN, MyFrame::OnOpen) |
849a28d0 VS |
163 | EVT_MENU(INTERNAT_TEST_1, MyFrame::OnTest1) |
164 | EVT_MENU(INTERNAT_TEST_2, MyFrame::OnTest2) | |
165 | EVT_MENU(INTERNAT_TEST_3, MyFrame::OnTest3) | |
c801d85f KB |
166 | END_EVENT_TABLE() |
167 | ||
168 | IMPLEMENT_APP(MyApp) | |
169 | ||
017fcf32 VZ |
170 | // ============================================================================ |
171 | // implementation | |
172 | // ============================================================================ | |
173 | ||
174 | // ---------------------------------------------------------------------------- | |
175 | // MyApp | |
176 | // ---------------------------------------------------------------------------- | |
c801d85f | 177 | |
3a331275 VZ |
178 | // command line arguments handling |
179 | void MyApp::OnInitCmdLine(wxCmdLineParser& parser) | |
c801d85f | 180 | { |
3a331275 VZ |
181 | parser.AddParam(_("locale"), |
182 | wxCMD_LINE_VAL_STRING, | |
183 | wxCMD_LINE_PARAM_OPTIONAL); | |
45e6e6f8 | 184 | |
3a331275 VZ |
185 | wxApp::OnInitCmdLine(parser); |
186 | } | |
017fcf32 | 187 | |
3a331275 VZ |
188 | bool MyApp::OnCmdLineParsed(wxCmdLineParser& parser) |
189 | { | |
190 | if ( !wxApp::OnCmdLineParsed(parser) ) | |
191 | return false; | |
192 | ||
193 | if ( parser.GetParamCount() ) | |
aec18ff7 | 194 | { |
3a331275 VZ |
195 | const wxString loc = parser.GetParam(); |
196 | const wxLanguageInfo * const lang = wxLocale::FindLanguageInfo(loc); | |
197 | if ( !lang ) | |
198 | { | |
199 | wxLogError(_("Locale \"%s\" is unknown."), loc); | |
200 | return false; | |
201 | } | |
202 | ||
81d3348a | 203 | m_lang = static_cast<wxLanguage>(lang->Language); |
017fcf32 VZ |
204 | } |
205 | ||
3a331275 VZ |
206 | return true; |
207 | } | |
208 | ||
209 | // `Main program' equivalent, creating windows and returning main app frame | |
210 | bool MyApp::OnInit() | |
211 | { | |
212 | if ( !wxApp::OnInit() ) | |
213 | return false; | |
214 | ||
215 | if ( m_lang == wxLANGUAGE_UNKNOWN ) | |
017fcf32 | 216 | { |
3a331275 VZ |
217 | int lng = wxGetSingleChoiceIndex |
218 | ( | |
219 | _("Please choose language:"), | |
220 | _("Language"), | |
221 | WXSIZEOF(langNames), | |
222 | langNames | |
223 | ); | |
224 | m_lang = lng == -1 ? wxLANGUAGE_DEFAULT : langIds[lng]; | |
017fcf32 VZ |
225 | } |
226 | ||
6f011443 VZ |
227 | // don't use wxLOCALE_LOAD_DEFAULT flag so that Init() doesn't return |
228 | // false just because it failed to load wxstd catalog | |
229 | if ( !m_locale.Init(m_lang, wxLOCALE_CONV_ENCODING) ) | |
346f4231 | 230 | { |
6f011443 | 231 | wxLogWarning(_("This language is not supported by the system.")); |
3a331275 | 232 | |
6f011443 | 233 | // continue nevertheless |
346f4231 | 234 | } |
aec18ff7 | 235 | |
89611d4d VZ |
236 | // normally this wouldn't be necessary as the catalog files would be found |
237 | // in the default locations, but when the program is not installed the | |
238 | // catalogs are in the build directory where we wouldn't find them by | |
239 | // default | |
7256e9b6 | 240 | wxLocale::AddCatalogLookupPathPrefix("."); |
017fcf32 | 241 | |
aec18ff7 | 242 | // Initialize the catalogs we'll be using |
5036c264 | 243 | const wxLanguageInfo* pInfo = wxLocale::GetLanguageInfo(m_lang); |
7256e9b6 | 244 | if (!m_locale.AddCatalog("internat")) |
5036c264 FM |
245 | wxLogError(_("Couldn't find/load the 'internat' catalog for locale '%s'."), |
246 | pInfo ? pInfo->GetLocaleName() : _("unknown")); | |
017fcf32 | 247 | |
7256e9b6 FM |
248 | // Now try to add wxstd.mo so that loading "NOTEXIST.ING" file will produce |
249 | // a localized error message: | |
250 | m_locale.AddCatalog("wxstd.mo"); | |
251 | // NOTE: it's not an error if we couldn't find it! | |
252 | ||
017fcf32 VZ |
253 | // this catalog is installed in standard location on Linux systems and |
254 | // shows that you may make use of the standard message catalogs as well | |
255 | // | |
256 | // if it's not installed on your system, it is just silently ignored | |
8e97b17b | 257 | #ifdef __LINUX__ |
aec18ff7 | 258 | { |
017fcf32 | 259 | wxLogNull noLog; |
bf2d9237 | 260 | m_locale.AddCatalog("fileutils"); |
aec18ff7 | 261 | } |
8e97b17b | 262 | #endif |
aec18ff7 MB |
263 | |
264 | // Create the main frame window | |
017fcf32 | 265 | MyFrame *frame = new MyFrame(m_locale); |
aec18ff7 | 266 | |
aec18ff7 | 267 | // Show the frame |
f13880a9 | 268 | frame->Show(true); |
aec18ff7 MB |
269 | SetTopWindow(frame); |
270 | ||
f13880a9 | 271 | return true; |
c801d85f KB |
272 | } |
273 | ||
017fcf32 VZ |
274 | // ---------------------------------------------------------------------------- |
275 | // MyFrame | |
276 | // ---------------------------------------------------------------------------- | |
277 | ||
278 | // main frame constructor | |
279 | MyFrame::MyFrame(wxLocale& locale) | |
280 | : wxFrame(NULL, | |
f13880a9 WS |
281 | wxID_ANY, |
282 | _("International wxWidgets App")), | |
017fcf32 | 283 | m_locale(locale) |
c7f3b78b | 284 | { |
0c545056 FM |
285 | SetIcon(wxICON(mondrian)); |
286 | ||
287 | // Make a menubar | |
288 | wxMenu *file_menu = new wxMenu; | |
289 | file_menu->Append(INTERNAT_TEST, _("&Test locale availability...\tCtrl-T")); | |
290 | file_menu->AppendSeparator(); | |
291 | ||
292 | // since wxID_ABOUT and wxID_EXIT are stock IDs they will automatically get | |
293 | // translated help strings; nice isn't it? | |
294 | file_menu->Append(wxID_ABOUT, _("&About...")); | |
295 | file_menu->AppendSeparator(); | |
296 | file_menu->Append(wxID_EXIT, _("E&xit")); | |
297 | ||
298 | wxMenu *test_menu = new wxMenu; | |
299 | test_menu->Append(wxID_OPEN, _("&Open bogus file"), _("Shows a wxWidgets localized error message")); | |
300 | test_menu->Append(INTERNAT_PLAY, _("&Play a game"), _("A little game; hint: 17 is a lucky number for many")); | |
301 | test_menu->AppendSeparator(); | |
302 | test_menu->Append(INTERNAT_TEST_1, _("&1 _() (gettext)"), _("Tests the _() macro")); | |
303 | test_menu->Append(INTERNAT_TEST_2, _("&2 _N() (ngettext)"), _("Tests the _N() macro")); | |
304 | test_menu->Append(INTERNAT_TEST_3, _("&3 wxTRANSLATE() (gettext_noop)"), _("Tests the wxTRANSLATE() macro")); | |
305 | ||
306 | wxMenuBar *menu_bar = new wxMenuBar; | |
307 | menu_bar->Append(file_menu, _("&File")); | |
308 | menu_bar->Append(test_menu, _("&Test")); | |
309 | SetMenuBar(menu_bar); | |
310 | ||
311 | // this demonstrates RTL support in wxStatusBar: | |
312 | CreateStatusBar(1); | |
313 | ||
978af864 VZ |
314 | // this demonstrates RTL layout mirroring for Arabic locales |
315 | wxSizer *sizer = new wxBoxSizer(wxHORIZONTAL); | |
316 | sizer->Add(new wxStaticText(this, wxID_ANY, _("First")), | |
317 | wxSizerFlags().Border()); | |
318 | sizer->Add(new wxStaticText(this, wxID_ANY, _("Second")), | |
319 | wxSizerFlags().Border()); | |
320 | SetSizer(sizer); | |
c7f3b78b | 321 | } |
c801d85f | 322 | |
bd7d06f2 | 323 | void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event) ) |
c801d85f | 324 | { |
f13880a9 | 325 | Close(true); |
c801d85f KB |
326 | } |
327 | ||
bd7d06f2 | 328 | void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) |
c801d85f | 329 | { |
aec18ff7 | 330 | wxString localeInfo; |
2b5f62a0 VZ |
331 | wxString locale = m_locale.GetLocale(); |
332 | wxString sysname = m_locale.GetSysName(); | |
333 | wxString canname = m_locale.GetCanonicalName(); | |
334 | ||
5036c264 FM |
335 | localeInfo.Printf(_("Language: %s\nSystem locale name: %s\nCanonical locale name: %s\n"), |
336 | locale.c_str(), sysname.c_str(), canname.c_str() ); | |
aec18ff7 | 337 | |
925e9792 WS |
338 | wxMessageDialog dlg( |
339 | this, | |
340 | wxString(_("I18n sample\n(c) 1998, 1999 Vadim Zeitlin and Julian Smart")) | |
7256e9b6 | 341 | + "\n\n" |
925e9792 WS |
342 | + localeInfo, |
343 | _("About Internat"), | |
344 | wxOK | wxICON_INFORMATION | |
345 | ); | |
346 | dlg.ShowModal(); | |
c801d85f KB |
347 | } |
348 | ||
bd7d06f2 | 349 | void MyFrame::OnPlay(wxCommandEvent& WXUNUSED(event)) |
c7f3b78b | 350 | { |
085c26ac VZ |
351 | wxString str = wxGetTextFromUser |
352 | ( | |
353 | _("Enter your number:"), | |
354 | _("Try to guess my number!"), | |
355 | wxEmptyString, | |
356 | this | |
357 | ); | |
358 | ||
359 | if ( str.empty() ) | |
360 | { | |
361 | // cancelled | |
362 | return; | |
363 | } | |
aec18ff7 | 364 | |
085c26ac VZ |
365 | long num; |
366 | if ( !str.ToLong(&num) || num < 0 ) | |
367 | { | |
aec18ff7 | 368 | str = _("You've probably entered an invalid number."); |
085c26ac VZ |
369 | } |
370 | else if ( num == 9 ) | |
371 | { | |
372 | // this message is not translated (not in catalog) because we used _T() | |
373 | // and not _() around it | |
2b5f62a0 | 374 | str = _T("You've found a bug in this program!"); |
085c26ac VZ |
375 | } |
376 | else if ( num == 17 ) | |
aec18ff7 | 377 | { |
085c26ac VZ |
378 | str.clear(); |
379 | ||
380 | // string must be split in two -- otherwise the translation would't be | |
381 | // found | |
aec18ff7 MB |
382 | str << _("Congratulations! you've won. Here is the magic phrase:") |
383 | << _("cannot create fifo `%s'"); | |
384 | } | |
085c26ac VZ |
385 | else |
386 | { | |
387 | // this is a more implicit way to write _() but note that if you use it | |
388 | // you must ensure that the strings get extracted in the message | |
bf2d9237 FM |
389 | // catalog as by default xgettext won't do it; it only knows of _(), |
390 | // not of wxTRANSLATE(). As internat's readme.txt says you should thus | |
391 | // call xgettext with -kwxTRANSLATE. | |
7256e9b6 FM |
392 | str = wxGetTranslation(wxTRANSLATE("Bad luck! try again...")); |
393 | ||
394 | // note also that if we want 'str' to contain a localized string | |
395 | // we need to use wxGetTranslation explicitely as wxTRANSLATE just | |
396 | // tells xgettext to extract the string but has no effect on the | |
397 | // runtime of the program! | |
085c26ac | 398 | } |
aec18ff7 MB |
399 | |
400 | wxMessageBox(str, _("Result"), wxOK | wxICON_INFORMATION); | |
c7f3b78b VZ |
401 | } |
402 | ||
cec5ffc4 VZ |
403 | void MyFrame::OnTestLocaleAvail(wxCommandEvent& WXUNUSED(event)) |
404 | { | |
405 | static wxString s_locale; | |
406 | wxString locale = wxGetTextFromUser | |
407 | ( | |
408 | _("Enter the locale to test"), | |
409 | wxGetTextFromUserPromptStr, | |
410 | s_locale, | |
411 | this | |
412 | ); | |
413 | if ( locale.empty() ) | |
414 | return; | |
415 | ||
416 | s_locale = locale; | |
417 | const wxLanguageInfo * const info = wxLocale::FindLanguageInfo(s_locale); | |
418 | if ( !info ) | |
419 | { | |
420 | wxLogError(_("Locale \"%s\" is unknown."), s_locale.c_str()); | |
421 | return; | |
422 | } | |
423 | ||
424 | if ( wxLocale::IsAvailable(info->Language) ) | |
425 | wxLogMessage(_("Locale \"%s\" is available."), s_locale.c_str()); | |
426 | else | |
427 | wxLogWarning(_("Locale \"%s\" is not available."), s_locale.c_str()); | |
428 | } | |
429 | ||
430 | void MyFrame::OnOpen(wxCommandEvent& WXUNUSED(event)) | |
c7f3b78b | 431 | { |
849a28d0 | 432 | // open a bogus file -- the error message should be also translated if |
7256e9b6 FM |
433 | // you've got wxstd.mo somewhere in the search path (see MyApp::OnInit) |
434 | wxFile file("NOTEXIST.ING"); | |
071cc2be | 435 | } |
085c26ac | 436 | |
849a28d0 VS |
437 | void MyFrame::OnTest1(wxCommandEvent& WXUNUSED(event)) |
438 | { | |
7256e9b6 FM |
439 | const wxString& title = _("Testing _() (gettext)"); |
440 | ||
441 | // NOTE: using the wxTRANSLATE() macro here we won't show a localized | |
442 | // string in the text entry dialog; we'll simply show the un-translated | |
443 | // string; however if the user press "ok" without altering the text, | |
444 | // since the "default value" string has been extracted by xgettext | |
445 | // the wxGetTranslation call later will manage to return a localized | |
446 | // string | |
849a28d0 | 447 | wxTextEntryDialog d(this, _("Please enter text to translate"), |
7256e9b6 | 448 | title, wxTRANSLATE("default value")); |
bf2d9237 | 449 | |
849a28d0 VS |
450 | if (d.ShowModal() == wxID_OK) |
451 | { | |
f13880a9 WS |
452 | wxString v = d.GetValue(); |
453 | wxString s(title); | |
bf2d9237 FM |
454 | s << "\n" << v << " -> " |
455 | << wxGetTranslation(v.c_str()) << "\n"; | |
f13880a9 | 456 | wxMessageBox(s); |
849a28d0 VS |
457 | } |
458 | } | |
459 | ||
460 | void MyFrame::OnTest2(wxCommandEvent& WXUNUSED(event)) | |
461 | { | |
7256e9b6 | 462 | const wxString& title = _("Testing _N() (ngettext)"); |
849a28d0 | 463 | wxTextEntryDialog d(this, |
f13880a9 | 464 | _("Please enter range for plural forms of \"n files deleted\" phrase"), |
bf2d9237 FM |
465 | title, "0-10"); |
466 | ||
849a28d0 VS |
467 | if (d.ShowModal() == wxID_OK) |
468 | { | |
f13880a9 | 469 | int first, last; |
bf2d9237 | 470 | wxSscanf(d.GetValue(), "%d-%d", &first, &last); |
f13880a9 | 471 | wxString s(title); |
bf2d9237 | 472 | s << "\n"; |
f13880a9 | 473 | for (int n = first; n <= last; ++n) |
849a28d0 | 474 | { |
bf2d9237 | 475 | s << n << " " << |
15d06954 | 476 | wxPLURAL("file deleted", "files deleted", n) << |
bf2d9237 | 477 | "\n"; |
f13880a9 | 478 | } |
849a28d0 VS |
479 | wxMessageBox(s); |
480 | } | |
481 | } | |
482 | ||
483 | void MyFrame::OnTest3(wxCommandEvent& WXUNUSED(event)) | |
484 | { | |
ad4814e7 | 485 | const char* lines[] = |
849a28d0 | 486 | { |
f13880a9 WS |
487 | wxTRANSLATE("line 1"), |
488 | wxTRANSLATE("line 2"), | |
489 | wxTRANSLATE("line 3"), | |
849a28d0 | 490 | }; |
bf2d9237 | 491 | |
4c3590e4 | 492 | wxString s(_("Testing wxTRANSLATE() (gettext_noop)")); |
bf2d9237 | 493 | s << "\n"; |
849a28d0 VS |
494 | for (size_t i = 0; i < WXSIZEOF(lines); ++i) |
495 | { | |
bf2d9237 | 496 | s << lines[i] << " -> " << wxGetTranslation(lines[i]) << "\n"; |
849a28d0 VS |
497 | } |
498 | wxMessageBox(s); | |
499 | } | |
500 | ||
501 |