青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

Morya

wxGetTranslation() wxTRANSLATE() wxT() _() _T()

wxGetTranslation()    wxTRANSLATE()    wxT()    _()    _T()

我的結論,wxT()  == _T()  只是為了讓代碼在Unicode和ANSI模式都可以方便的編譯。
_T() 和 _wxTRANSLATE() 宏 是為了翻譯需要。平時使用 _T() 就可以,但是某些特殊的初始化無法使用 _T() 就需要用到 _wxTRANSLATE() 。


::wxGetTranslation()

const wxChar * wxGetTranslation(const wxChar* str, const wxChar* domain = NULL)

const wxChar * wxGetTranslation(const wxChar* str, const wxChar* strPlural, size_t n, const wxChar* domain = NULL)

This function returns the translation of string str in the current locale. If the string is not found in any of the loaded message catalogs (see internationalization overview), the original string is returned. In debug build, an error message is logged -- this should help to find the strings which were not yet translated. If domain is specified then only that domain/catalog is searched for a matching string. As this function is used very often, an alternative (and also common in Unix world) syntax is provided: the _() macro is defined to do the same thing as wxGetTranslation.

The second form is used when retrieving translation of string that has different singular and plural form in English or different plural forms in some other language. It takes two extra arguments: as above, str parameter must contain the singular form of the string to be converted and is used as the key for the search in the catalog. The strPlural parameter is the plural form (in English). The parameter n is used to determine the plural form. If no message catalog is found str is returned if 'n == 1', otherwise strPlural.

See GNU gettext manual for additional information on plural forms handling. For a shorter alternative see the wxPLURAL() macro.

Both versions call wxLocale::GetString.

Note that this function is not suitable for literal strings in Unicode builds, since the literal strings must be enclosed into _T() or wxT macro which makes them unrecognised by xgettext, and so they are not extracted to the message catalog. Instead, use the _() and wxPLURAL macro for all literal strings.


 

wxT()

wxChar wxT(char ch)

const wxChar * wxT(const char *s)

wxT() is a macro which can be used with character and string literals (in other words, 'x' or "foo") to automatically convert them to Unicode in Unicode build configuration. Please see the Unicode overview for more information.

This macro is simply returns the value passed to it without changes in ASCII build. In fact, its definition is:

#ifdef UNICODE
#define wxT(x) L ## x
#else // !Unicode
#define wxT(x) x
#endif

wxTRANSLATE()

const wxChar * wxTRANSLATE(const char *s)

This macro doesn't do anything in the program code -- it simply expands to the value of its argument (except in Unicode build where it is equivalent to wxT which makes it unnecessary to use both wxTRANSLATE and wxT with the same string which would be really unreadable).

However it does have a purpose and it is to mark the literal strings for the extraction into the message catalog created by xgettext program. Usually this is achieved using _() but that macro not only marks the string for extraction but also expands into a wxGetTranslation function call which means that it cannot be used in some situations, notably for static array initialization.

Here is an example which should make it more clear: suppose that you have a static array of strings containing the weekday names and which have to be translated (note that it is a bad example, really, as wxDateTime already can be used to get the localized week day names already). If you write

static const wxChar * const weekdays[] = { _("Mon"), ..., _("Sun") };
...
// use weekdays[n] as usual
the code wouldn't compile because the function calls are forbidden in the array initializer. So instead you should do

static const wxChar * const weekdays[] = { wxTRANSLATE("Mon"), ..., wxTRANSLATE("Sun") };
...
// use wxGetTranslation(weekdays[n])
here.

Note that although the code would compile if you simply omit wxTRANSLATE() in the above, it wouldn't work as expected because there would be no translations for the weekday names in the program message catalog and wxGetTranslation wouldn't find them.


_()

const wxChar * _(const char *s)

This macro expands into a call to wxGetTranslation function, so it marks the message for the extraction by xgettext just as wxTRANSLATE does, but also returns the translation of the string for the current locale during execution.

Don't confuse this macro with _T()!


_T()

wxChar _T(char ch)

const wxChar * _T(const wxChar ch)

This macro is exactly the same as wxT and is defined in wxWidgets simply because it may be more intuitive for Windows programmers as the standard Win32 headers also define it (as well as yet another name for the same macro which is _TEXT()).

Don't confuse this macro with _()!



posted on 2008-12-24 14:24 Morya 閱讀(1065) 評論(1)  編輯 收藏 引用

導航

<2025年9月>
31123456
78910111213
14151617181920
21222324252627
2829301234
567891011

統計

常用鏈接

留言簿(1)

隨筆檔案(21)

文章檔案(1)

最新評論

評論排行榜

青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            亚洲欧美日韩国产精品| 国产日韩精品在线播放| 一区二区激情| 亚洲视频一起| 亚洲一区二区三区四区五区黄| 99国产精品久久久久久久久久| 日韩午夜激情| 亚洲欧美日韩精品久久| 久久久久综合| 欧美二区视频| 国产精品高潮久久| 国产曰批免费观看久久久| 在线电影一区| 亚洲视频网站在线观看| 久久久久久亚洲精品中文字幕| 麻豆精品视频在线| 亚洲精品欧美一区二区三区| 亚洲制服av| 午夜欧美精品久久久久久久| 亚洲日韩成人| 亚洲激情一区| 午夜精品美女久久久久av福利| 久久久中精品2020中文| 欧美精品一区二区精品网| 国产精品视频xxxx| 亚洲国产精品嫩草影院| 亚洲欧美精品suv| 老司机午夜精品| 一区二区三区精品在线| 久久先锋资源| 国产视频欧美视频| 亚洲视频视频在线| 欧美激情第1页| 亚洲欧美日韩在线不卡| 欧美精品日韩一区| 亚洲国产精品va| 午夜一区二区三视频在线观看| 欧美第一黄网免费网站| 欧美一激情一区二区三区| 欧美日韩大陆在线| 亚洲黄色小视频| 久久久久久网| 亚洲一区中文字幕在线观看| 欧美片在线观看| 最新国产乱人伦偷精品免费网站 | 亚洲欧美国产毛片在线| 欧美成年人视频网站欧美| 亚洲免费中文| 国产精品久久综合| 在线中文字幕不卡| 亚洲国产毛片完整版| 久久蜜桃资源一区二区老牛| 国产亚洲精久久久久久| 亚洲欧美综合网| 一区二区三区日韩| 国产精品a久久久久久| 一区二区三区高清视频在线观看| 欧美黄色成人网| 欧美xart系列高清| 亚洲精品美女在线观看播放| 亚洲二区在线| 欧美精品手机在线| 日韩亚洲欧美一区| 亚洲美女黄网| 欧美三级韩国三级日本三斤| 亚洲特色特黄| 99re成人精品视频| 国产精品视频一二| 久久久97精品| 麻豆freexxxx性91精品| 亚洲精品之草原avav久久| 91久久线看在观草草青青| 欧美国产一区二区在线观看 | 国产精品无码永久免费888| 国产精品视频最多的网站| 国产亚洲精品久久久久婷婷瑜伽| 亚洲欧洲99久久| 亚洲免费人成在线视频观看| 国产欧美亚洲日本| 免播放器亚洲| 欧美日韩精品高清| 欧美一区二区三区免费观看视频| 欧美一区二区网站| 亚洲激情欧美| 亚洲视频在线观看三级| 国产亚洲一区在线| 亚洲国产电影| 国产精品久久久久久久久免费 | 欧美一区二区三区播放老司机| 午夜精品久久久久久久| 136国产福利精品导航网址应用 | 久久视频在线视频| 艳女tv在线观看国产一区| 亚洲一区二区三区久久| 一区二区视频在线观看| 99riav1国产精品视频| 国产视频在线一区二区| 欧美激情精品久久久久久变态| 欧美日韩精品免费 | 亚洲在线一区| 久久亚洲一区二区| 午夜精品久久| 欧美黄色一区| 久久久久国产免费免费| 欧美日韩播放| 你懂的国产精品永久在线| 欧美性理论片在线观看片免费| 久久综合激情| 国产农村妇女毛片精品久久莱园子 | 亚洲欧美国产制服动漫| 久久久在线视频| 欧美尤物一区| 国产精品扒开腿做爽爽爽视频 | 国产乱肥老妇国产一区二| 亚洲电影中文字幕| 永久免费视频成人| 亚洲欧美在线看| 亚洲一区在线看| 欧美激情第五页| 亚洲成色精品| 久久噜噜亚洲综合| 国产精品福利在线观看| 日韩视频一区二区在线观看 | 国产精品专区一| 国产精品国产精品国产专区不蜜| 美女黄网久久| 精品动漫一区| 欧美亚洲综合久久| 久久国产视频网站| 国产精品系列在线| 亚洲午夜在线观看视频在线| 亚洲天堂第二页| 欧美三区在线观看| 一本色道久久综合一区| 亚洲深夜激情| 国产精品久久久亚洲一区| 一本大道av伊人久久综合| 一区二区免费在线视频| 欧美了一区在线观看| 亚洲精品影院在线观看| 一区二区三区欧美亚洲| 欧美日韩综合久久| 亚洲无线一线二线三线区别av| 亚洲男人的天堂在线| 国产精品社区| 久久精品国产免费看久久精品| 久久综合精品一区| 亚洲国产va精品久久久不卡综合| 免费试看一区| 亚洲精品欧美一区二区三区| 亚洲免费在线视频| 国产亚洲精品久| 美女国内精品自产拍在线播放| 亚洲高清视频中文字幕| 国产精品99久久久久久久久久久久 | 久久综合一区二区| 永久免费精品影视网站| 欧美大胆成人| 亚洲性av在线| 免播放器亚洲| 中文国产一区| 伊人久久大香线蕉av超碰演员| 米奇777超碰欧美日韩亚洲| 亚洲精品人人| 久久久久综合网| 在线综合亚洲欧美在线视频| 国产日韩av在线播放| 欧美 日韩 国产精品免费观看| 9l国产精品久久久久麻豆| 久久美女性网| 亚洲视频中文| 在线观看一区二区视频| 欧美日韩国产在线观看| 欧美一区二区三区在线视频| 亚洲高清av在线| 欧美在线啊v一区| 日韩视频永久免费| 国产一区二区三区在线观看免费| 欧美韩日一区| 久久九九国产精品怡红院| 日韩视频不卡中文| 免费的成人av| 欧美一级淫片播放口| 亚洲精品综合精品自拍| 国产日韩精品一区| 欧美三级日本三级少妇99| 久久人人看视频| 亚洲欧美另类综合偷拍| 亚洲精品护士| 欧美电影电视剧在线观看| 亚洲国产精品精华液网站| 噜噜噜躁狠狠躁狠狠精品视频| 99这里只有精品| 精品电影在线观看| 国产欧美精品久久| 国产精品国码视频| 欧美激情精品久久久| 久久综合伊人77777麻豆| 欧美在线观看www| 亚洲欧美伊人|