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

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免费视频| 欧美在线观看日本一区| 久久国产精品毛片| 欧美不卡视频一区发布| 欧美激情亚洲一区| 欧美日韩成人一区二区三区| 欧美日韩一区二区高清| 国产精品乱子久久久久| 国产色视频一区| 一区二区视频欧美| 亚洲欧洲精品成人久久奇米网| 亚洲精品美女| 午夜精品久久久久久久蜜桃app | 国产精品久久久久高潮| 国产精品乱子久久久久| 亚洲国产成人在线| 亚洲一区在线看| 久久另类ts人妖一区二区| 欧美激情精品久久久久久久变态 | 欧美激情在线观看| 欧美性猛交xxxx乱大交蜜桃 | 欧美在线亚洲| 欧美激情精品| 国产小视频国产精品| 亚洲精品一区在线| 久久黄色影院| 亚洲精品中文在线| 久久精品伊人| 国产精品永久免费| 亚洲精选成人| 久久久久高清| 亚洲欧美视频| 欧美日韩亚洲三区| 亚洲电影免费观看高清完整版在线| 亚洲午夜精品久久久久久app| 久热这里只精品99re8久| 在线中文字幕一区| 欧美黄网免费在线观看| 在线观看久久av| 香港久久久电影| 99热精品在线| 欧美精品国产| 国产亚洲精品v| 亚洲国产精品热久久| 亚洲欧美日韩在线不卡| 亚洲韩国青草视频| 亚洲一区二区三区在线视频| 欧美激情亚洲精品| 亚洲第一视频网站| 久久久不卡网国产精品一区| 亚洲图片你懂的| 欧美日韩卡一卡二| 日韩一级二级三级| 亚洲国产精品123| 久久一区二区三区国产精品 | 久久久久久一区| 国产视频一区免费看| 亚洲欧美在线播放| 亚洲一区二区成人在线观看| 国产精品久久久久久久久久免费看 | 欧美日韩精品免费观看视频完整| 亚洲欧洲精品一区| 亚洲国产精品久久久久| 欧美丰满高潮xxxx喷水动漫| 亚洲精品久久久久久久久久久久久 | 亚洲精品乱码久久久久久蜜桃91| 欧美va天堂| 欧美成人一区二区三区在线观看| 亚洲福利视频网站| 亚洲电影免费在线| 欧美极品一区二区三区| 99热这里只有精品8| 亚洲伦理自拍| 国产精品欧美日韩一区二区| 欧美中文字幕不卡| 久久精品免视看| 亚洲国产精品日韩| 亚洲美女免费精品视频在线观看| 国产精品国产成人国产三级| 久久久av毛片精品| 麻豆精品视频在线| 正在播放日韩| 欧美一区二区三区久久精品茉莉花 | 美女黄色成人网| 亚洲精品孕妇| 亚洲午夜久久久久久尤物| 国产日韩一区二区| 亚洲电影免费| 国产精品尤物福利片在线观看| 久久尤物视频| 欧美日韩一区在线| 老司机久久99久久精品播放免费 | 亚洲女同在线| 国产自产高清不卡| 亚洲国产精品小视频| 欧美日韩一区综合| 久久综合一区| 国产精品av久久久久久麻豆网| 久久久久久亚洲精品杨幂换脸 | 久久精品99| 欧美电影打屁股sp| 欧美在现视频| 欧美日韩免费| 欧美成人在线免费视频| 国产精品美女久久久| 亚洲国产精品成人一区二区 | 欧美日韩视频在线一区二区 | 狠狠色丁香婷婷综合久久片| 亚洲欧洲日韩女同| 狠狠色丁香婷婷综合影院| 一区二区三区精品| 亚洲日韩第九十九页| 久久精品电影| 欧美一区二区三区四区在线观看| 欧美精品观看| 欧美黄色一区| 一区二区三区在线高清| 这里只有精品视频在线| 日韩视频不卡中文| 久久综合亚州| 久久久.com| 国产午夜精品久久久| 亚洲男同1069视频| 亚洲女女做受ⅹxx高潮| 欧美日韩国产在线观看| 欧美黄色网络| 亚洲国产精品福利| 久久婷婷国产综合尤物精品 | 99精品久久久| 一区二区三区高清| 欧美精品色综合| 亚洲欧洲午夜| 99国产精品国产精品毛片| 欧美成人午夜77777| 亚洲高清一区二区三区| 亚洲国产精品一区二区www| 美女尤物久久精品| 欧美国产日韩在线| 亚洲国产天堂久久综合| 免费的成人av| 亚洲精品日本| 亚洲一区二区三区四区五区黄| 欧美色精品天天在线观看视频| 亚洲精品欧美极品| 亚洲私人影院在线观看| 国产精品视频| 午夜精品亚洲一区二区三区嫩草| 久久av免费一区| 99re66热这里只有精品4| 狂野欧美性猛交xxxx巴西| 久久久久久久久一区二区| 国产亚洲欧美日韩日本| 欧美一区二区黄| 欧美大片在线看| 亚洲免费高清| 欧美午夜精品理论片a级大开眼界| 亚洲少妇自拍| 久久亚洲精品一区| 亚洲精品一区在线观看香蕉| 欧美日韩国产麻豆| 午夜精品美女自拍福到在线 | 久久久精品国产免大香伊| 在线观看不卡| 欧美日本中文字幕| 亚洲欧美日韩天堂| 免费成人激情视频| 一本大道av伊人久久综合| 国产精品精品视频| 久久精品首页| 日韩午夜视频在线观看| 久久精品国亚洲| 日韩视频在线免费| 国产精品一区二区三区久久| 久久久久久久综合日本| 日韩视频免费观看高清在线视频 | 男女激情视频一区| 亚洲一区二区三区视频播放| 久久综合久久久久88| 一区二区三区www| 黄页网站一区| 久久精品国产亚洲高清剧情介绍| 久久精品国产亚洲一区二区| 在线一区二区日韩| 国产真实乱偷精品视频免| 久久天天躁狠狠躁夜夜av| av不卡在线观看| 乱中年女人伦av一区二区| 亚洲私人影院在线观看| 在线日韩欧美| 国产日本欧美一区二区三区| 欧美激情一区二区三区在线视频观看| 亚洲欧美成人综合| 亚洲伦理在线| 亚洲激情第一区| 欧美成年人视频| 久久久久久久一区二区三区| 亚洲素人在线|