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

Morya

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

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

我的結(jié)論,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 閱讀(1075) 評論(1)  編輯 收藏 引用


只有注冊用戶登錄后才能發(fā)表評論。
網(wǎng)站導(dǎo)航: 博客園   IT新聞   BlogJava   博問   Chat2DB   管理


導(dǎo)航

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

統(tǒng)計(jì)

常用鏈接

留言簿(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>
            一区在线视频观看| 亚洲免费精彩视频| 亚洲黄色av| 欧美成人午夜影院| 亚洲人成高清| 亚洲午夜伦理| 国产手机视频精品| 美日韩精品视频| 亚洲免费大片| 久久精品亚洲乱码伦伦中文 | 欧美一级视频免费在线观看| 久久精品成人一区二区三区| 影音先锋久久久| 欧美日韩亚洲一区二区三区四区| 亚洲一区二区不卡免费| 久色婷婷小香蕉久久| 日韩系列在线| 韩国av一区| 欧美日韩一区二区高清| 欧美伊人久久大香线蕉综合69| 欧美二区视频| 欧美在线播放视频| 亚洲精品欧美日韩| 国产视频久久久久| 欧美成va人片在线观看| 亚洲综合精品| 亚洲精品久久久久久下一站| 欧美一级大片在线观看| 最近中文字幕日韩精品| 国产精品一二三四| 欧美激情亚洲另类| 欧美影院久久久| av成人国产| 欧美国产日韩视频| 久久精视频免费在线久久完整在线看| 亚洲欧洲在线观看| 狠狠色2019综合网| 国产精品日韩专区| 欧美精品久久一区| 久久夜色精品亚洲噜噜国产mv| 亚洲深夜av| 亚洲开发第一视频在线播放| 免费成人黄色片| 欧美在线中文字幕| 亚洲一区二区三区免费观看| 亚洲国产精品黑人久久久| 国产欧美视频一区二区| 欧美日韩免费一区| 欧美 日韩 国产一区二区在线视频| 亚洲欧美一区二区激情| 99re66热这里只有精品4| 亚洲黄色大片| 欧美电影在线观看| 裸体一区二区三区| 久久久视频精品| 欧美影院精品一区| 午夜在线观看免费一区| 亚洲一区二区三区在线播放| 亚洲精品视频免费| 亚洲欧洲日韩在线| 亚洲国产清纯| 亚洲国产成人久久综合一区| 激情欧美日韩| 激情六月婷婷久久| 1024精品一区二区三区| 黄网动漫久久久| 一区精品在线播放| 一区免费观看| 1024亚洲| 亚洲靠逼com| 一区二区三区久久网| 一本色道久久综合亚洲精品按摩| 亚洲精品一区二区三区在线观看| 亚洲国产精品传媒在线观看| 亚洲国产精品高清久久久| 亚洲国产精品久久| 亚洲欧洲一区二区三区久久| 亚洲精品日韩在线| 在线综合视频| 亚洲欧美日韩精品久久奇米色影视 | 在线成人欧美| 亚洲国产欧美不卡在线观看| 亚洲人成小说网站色在线| 日韩亚洲欧美一区二区三区| 艳妇臀荡乳欲伦亚洲一区| 亚洲图片在线| 欧美在线综合| 欧美成人午夜激情视频| 亚洲国产精品一区二区第四页av | 亚洲激情国产精品| 一区二区三区福利| 亚洲欧美综合网| 久久全国免费视频| 亚洲国产一区二区三区高清| 亚洲免费av网站| 欧美中文在线观看| 欧美aⅴ99久久黑人专区| 欧美日韩综合视频网址| 国产美女精品在线| 亚洲国产精品国自产拍av秋霞| 一区二区三区四区蜜桃| 欧美自拍丝袜亚洲| 欧美国产日产韩国视频| 亚洲精品一区二区三区樱花 | 亚洲黄色一区二区三区| 一区二区三区免费网站| 欧美一级在线亚洲天堂| 牛夜精品久久久久久久99黑人 | 亚洲美女一区| 欧美伊人久久久久久午夜久久久久 | 午夜免费电影一区在线观看| 久久久国产91| 欧美视频国产精品| 1000部国产精品成人观看| 在线亚洲一区二区| 久色成人在线| 亚洲宅男天堂在线观看无病毒| 久久综合久色欧美综合狠狠| 国产精品久久久久av| 亚洲成色最大综合在线| 先锋影音久久| 亚洲欧洲日本在线| 久久国产精品亚洲77777| 欧美日韩在线免费| 亚洲成人自拍视频| 午夜精品视频一区| 亚洲经典一区| 久久久久久91香蕉国产| 国产精品久久看| 亚洲精品美女久久7777777| 久久精品99国产精品| 一个色综合导航| 欧美大片在线观看| 国模私拍一区二区三区| 亚洲欧美变态国产另类| 欧美顶级大胆免费视频| 欧美中文字幕| 国产精品日韩欧美大师| 一区二区免费看| 亚洲国产精品一区二区www在线 | 久久久亚洲精品一区二区三区| 日韩一区二区电影网| 欧美不卡三区| 亚洲高清视频在线观看| 久久综合色影院| 亚洲欧美在线视频观看| 欧美午夜精品久久久久久浪潮| 亚洲精品久久久久久一区二区| 免费中文字幕日韩欧美| 欧美影院午夜播放| 国产欧美午夜| 久久av资源网| 亚洲欧美日韩直播| 国产毛片一区| 欧美一区二区日韩| 亚洲主播在线播放| 国产精品视频不卡| 午夜久久福利| 午夜精品视频一区| 国产视频一区二区在线观看| 久久激情中文| 欧美影视一区| 在线观看视频一区二区| 麻豆亚洲精品| 美国十次了思思久久精品导航| 在线观看视频免费一区二区三区| 麻豆国产va免费精品高清在线| 久久九九热免费视频| 在线电影国产精品| 欧美高清视频一区二区| 麻豆乱码国产一区二区三区| 亚洲国产天堂久久综合| 亚洲国产精品电影| 欧美日韩国产美| 亚洲欧美在线一区二区| 欧美亚洲日本一区| 伊人成年综合电影网| 欧美国产欧美亚洲国产日韩mv天天看完整 | 久久综合色婷婷| 亚洲日本va午夜在线电影| 亚洲欧洲一二三| 欧美图区在线视频| 久久激情五月丁香伊人| 久久另类ts人妖一区二区| 亚洲麻豆av| 亚洲一区二区三区四区视频| 国产三级精品在线不卡| 免费成人网www| 欧美日韩国产小视频| 新狼窝色av性久久久久久| 欧美中文字幕不卡| 亚洲精品资源美女情侣酒店| 一区二区精品在线| 国内精品久久久久久| 亚洲国产欧美一区| 欧美日韩综合另类| 可以看av的网站久久看| 欧美激情综合亚洲一二区| 欧美一区二区三区免费看| 久久影院午夜论|