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

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 閱讀(1076) 評論(1)  編輯 收藏 引用


只有注冊用戶登錄后才能發表評論。
網站導航: 博客園   IT新聞   BlogJava   博問   Chat2DB   管理


導航

<2008年12月>
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910

統計

常用鏈接

留言簿(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>
            亚洲女ⅴideoshd黑人| 亚洲一区二区三区影院| 久久久久久久综合日本| 国产视频久久久久| 欧美在线你懂的| 欧美一区二区三区视频免费播放| 国产精品日韩一区二区三区| 亚洲欧美在线看| 欧美一级在线播放| 亚洲电影在线播放| 亚洲精品视频免费| 国产乱肥老妇国产一区二| 久久久欧美一区二区| 久久亚洲一区二区| 亚洲精品网站在线播放gif| 日韩午夜激情电影| 国产日韩av高清| 欧美国产在线观看| 欧美日韩在线亚洲一区蜜芽| 欧美亚洲在线观看| 麻豆久久久9性大片| 中日韩在线视频| 久久国产一区| 中文在线不卡视频| 久久久久久久综合狠狠综合| 一本高清dvd不卡在线观看| 亚洲影院免费| 亚洲日本欧美| 亚洲欧美一区二区视频| 亚洲精品在线视频| 亚洲免费视频观看| 亚洲开发第一视频在线播放| 午夜国产精品视频| 99国产欧美久久久精品| 久久成人国产| 亚洲欧美国产日韩中文字幕| 免费观看久久久4p| 欧美在线视频全部完| 欧美激情第一页xxx| 久久国产精品99国产精| 欧美日本在线看| 久久综合九色欧美综合狠狠| 欧美涩涩视频| 欧美激情视频免费观看| 国产一区二区三区久久 | 亚洲在线视频免费观看| 久久久久久色| 久久福利一区| 国产嫩草一区二区三区在线观看| 美女露胸一区二区三区| 国产伦理一区| 亚洲永久在线| 亚洲一区二区三区国产| 欧美—级a级欧美特级ar全黄| 久久这里只有精品视频首页| 国产精品亚洲美女av网站| 99国产精品国产精品久久 | 欧美精品在线一区二区三区| 久久夜色精品国产| 国产亚洲精品高潮| 亚洲午夜日本在线观看| 亚洲一区二区三区免费在线观看| 欧美风情在线观看| 欧美激情一二区| 在线日韩日本国产亚洲| 久久亚裔精品欧美| 可以看av的网站久久看| 激情综合激情| 久久综合电影| 亚洲国产成人av好男人在线观看| 一区二区三区在线观看视频| 久久不射2019中文字幕| 久久嫩草精品久久久久| 在线看片第一页欧美| 久久伊人亚洲| 欧美高清日韩| 日韩视频精品在线| 欧美日韩伊人| 亚洲欧美中文日韩在线| 久久精品国产一区二区三区免费看| 国产精品青草综合久久久久99 | 亚洲国产第一| 亚洲视频在线观看免费| 欧美午夜无遮挡| 亚洲欧美中日韩| 免费高清在线一区| 亚洲国产日韩一区| 欧美区一区二| 亚洲自拍偷拍视频| 久久综合色天天久久综合图片| 亚洲高清久久久| 欧美日韩国产综合久久| 亚洲欧美日韩另类| 欧美成人亚洲| 亚洲一区国产一区| 黄色成人在线观看| 欧美大胆a视频| 亚洲小视频在线| 欧美高清在线视频观看不卡| 99热在线精品观看| 国产午夜亚洲精品不卡| 欧美不卡在线视频| 亚洲欧美视频在线观看视频| 欧美成年网站| 午夜精品99久久免费| 在线日韩精品视频| 国产精品久久午夜| 美乳少妇欧美精品| 亚洲免费伊人电影在线观看av| 卡通动漫国产精品| 亚洲一区精品电影| 极品中文字幕一区| 国产精品久久久久免费a∨| 久久字幕精品一区| 亚洲一区激情| 亚洲国内自拍| 蜜臀久久久99精品久久久久久 | 亚洲视频在线视频| 激情欧美一区二区三区在线观看 | 亚洲欧美一区二区精品久久久| 欧美高清视频在线| 久久精品免费看| 亚洲午夜久久久| 亚洲精品在线免费观看视频| 国产亚洲精品美女| 国产精品嫩草影院av蜜臀| 欧美好吊妞视频| 久久一区欧美| 久久精品国产一区二区电影| 在线亚洲伦理| 一本色道久久综合| 91久久精品视频| 欧美国产一区二区在线观看 | 久久久久www| 午夜一区二区三视频在线观看| 亚洲人成在线观看| 亚洲国产一区二区三区高清| 国产一级久久| 国产免费观看久久| 国产精品视频精品视频| 国产精品sss| 国产精品久久久久久久9999| 欧美日韩另类丝袜其他| 欧美日本二区| 欧美四级在线观看| 欧美性事在线| 国产精品高潮在线| 国产精品扒开腿做爽爽爽软件| 欧美日韩一区二区视频在线观看| 欧美乱人伦中文字幕在线| 欧美成熟视频| 欧美日韩一区不卡| 国产精品久久久久久影视| 欧美性猛交视频| 国产伦精品一区二区三| 国产午夜久久| 亚洲风情亚aⅴ在线发布| 亚洲激情视频| 一区二区欧美在线观看| 亚洲视频在线观看视频| 欧美一级网站| 久久午夜精品| 91久久精品www人人做人人爽 | 午夜在线视频一区二区区别| 午夜精品久久久久影视| 欧美一区二区免费| 久久久久久久久岛国免费| 久久中文精品| 亚洲国产精品尤物yw在线观看| 亚洲激情影院| 亚洲综合精品自拍| 久久综合久久美利坚合众国| 女女同性精品视频| 国产精品福利在线观看| 国产一区清纯| 亚洲乱码国产乱码精品精| 亚洲一区在线观看免费观看电影高清| 亚洲欧美久久久| 蜜臀av性久久久久蜜臀aⅴ四虎 | 欧美中文在线观看| 欧美a级大片| 亚洲午夜电影网| 久久久综合网站| 国产精品xvideos88| 在线观看日韩专区| 亚洲一区二区成人在线观看| 久久久蜜桃一区二区人| 日韩视频免费观看高清在线视频| 午夜欧美不卡精品aaaaa| 欧美福利一区| 国产一区二区三区的电影| 一本久久a久久免费精品不卡| 久久九九久精品国产免费直播| 亚洲福利小视频| 欧美在线free| 国产精品扒开腿爽爽爽视频 | 伊人精品在线| 亚洲欧美日韩精品一区二区| 欧美黑人多人双交| 欧美在线视频免费|