What does _ (underscore mean) Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
Rakan
Earned a small fee
Earned a small fee
Posts: 18
Joined: Wed Feb 27, 2008 11:00 pm

What does _ (underscore mean)

Post by Rakan »

Hello all,

I have noticed the following code:

Code: Select all

wxString msg = wxbuildinfo(long_f);
    wxMessageBox(msg, _("Welcome to..."));
and

Code: Select all

wxMessageBox(_("Hello new"),_("Title here"));
My simple question is, what do we have to add an underscore "_" before strings?
this seems like calling a string constructor to me to be honest,

Code: Select all

wxString("Hello new")
But there are several places where you see this. I want to know what it means.

Thanks
Rakan
Auria
Site Admin
Site Admin
Posts: 6695
Joined: Thu Sep 28, 2006 12:23 am
Contact:

Post by Auria »

it's a string that can be translated to another language
Rakan
Earned a small fee
Earned a small fee
Posts: 18
Joined: Wed Feb 27, 2008 11:00 pm

Post by Rakan »

Hello,
thanks for the answer but i did not really get it, translated to another "programming language" or translated to another "human" language?
Rakan
Vergil.D
Knows some wx things
Knows some wx things
Posts: 45
Joined: Mon Jan 28, 2008 1:47 pm

Post by Vergil.D »

Hi,

wxT() macro : converts string and character literals to the appropriate type to allow the application to be compiled in Unicode mode

_T() macro : is the same as wxT()

_() macro : used to enclose strings, which tells wxWidgets to translate the string (of a course human language).

Info and sample: http://wxwidgets.info/wxTranslation
Post Reply