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

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


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


導航

<2009年7月>
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678

統計

常用鏈接

留言簿(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>
            久久久久欧美精品| 日韩亚洲欧美精品| 老巨人导航500精品| 午夜电影亚洲| 欧美专区在线观看| 久久影视精品| 欧美日韩亚洲国产精品| 国产精品高精视频免费| 国产日韩欧美综合| 国语自产精品视频在线看8查询8| 国产精品女人网站| 国产在线乱码一区二区三区| 在线观看成人网| 99视频精品在线| 欧美一级专区免费大片| 免费一区二区三区| av不卡免费看| 久久久综合网| 欧美图区在线视频| 1000部精品久久久久久久久| 在线亚洲免费视频| 久久综合五月天婷婷伊人| 亚洲国产人成综合网站| 亚洲精品在线观看免费| 性8sex亚洲区入口| 欧美日本精品一区二区三区| 国产午夜精品一区二区三区欧美| 亚洲夫妻自拍| 午夜精品久久久久久久99樱桃| 午夜精品久久久久99热蜜桃导演| 男人插女人欧美| 亚洲欧美另类中文字幕| 欧美成人午夜77777| 亚洲一区免费网站| 欧美日韩国产区| 在线观看三级视频欧美| 性做久久久久久免费观看欧美| 亚洲国产一区视频| 欧美在线免费视屏| 亚洲国内高清视频| 久久国产精彩视频| 国产精品电影在线观看| 日韩一级精品| 欧美激情欧美狂野欧美精品| 校园春色国产精品| 国产伦精品一区二区三区免费迷| 这里是久久伊人| 亚洲国产欧美日韩精品| 免费不卡在线观看| 伊甸园精品99久久久久久| 久久精品一区二区三区中文字幕 | 久久一区二区三区超碰国产精品| 日韩一区二区久久| 欧美人成网站| 日韩亚洲成人av在线| 老牛影视一区二区三区| 午夜一区二区三区不卡视频| 欧美体内she精视频在线观看| 亚洲精品一区二区三区蜜桃久| 欧美大片在线观看一区| 另类国产ts人妖高潮视频| 激情文学综合丁香| 免费成人av在线看| 免费成人高清视频| 日韩亚洲欧美中文三级| 亚洲精品久久久久久久久久久久| 欧美精品偷拍| 在线视频中文亚洲| 亚洲女女女同性video| 国产免费亚洲高清| 久久夜色精品国产| 一区二区国产日产| 欧美日韩国产综合视频在线观看中文| 99国产精品99久久久久久粉嫩| 亚洲高清毛片| 欧美日韩精品不卡| 欧美在线免费视频| 久久久久国产一区二区| 影音先锋日韩有码| 亚洲国产精品va| 欧美午夜欧美| 久久国产精品网站| 久久久夜夜夜| 中国成人黄色视屏| 欧美一级播放| 樱桃成人精品视频在线播放| 亚洲精品日韩精品| 国产视频久久久久| 美女诱惑黄网站一区| 欧美日本亚洲韩国国产| 久久国产精品99国产精| 免费国产自线拍一欧美视频| 中文久久乱码一区二区| 欧美一区二区三区视频在线观看| 亚洲精品1区2区| 欧美亚洲一区三区| 久久久久国产一区二区三区四区 | 欧美一区视频| 亚洲三级免费观看| 国产精品a级| 美女久久一区| 亚洲一级黄色片| 精品1区2区| 国产美女一区二区| 欧美系列一区| 欧美大片在线观看一区| 亚洲欧美韩国| 一区二区成人精品 | 玖玖在线精品| 亚洲制服少妇| 一区二区av| 久久成人在线| 欧美日韩在线播放一区| 欧美精品v国产精品v日韩精品| 欧美黄网免费在线观看| 国产精品视频yy9099| 久久激情视频久久| 国产精品99久久久久久人| 久久精品国产欧美激情| 欧美在线国产精品| 久久一二三区| 欧美国产三区| 久久久久欧美| 国产综合视频| 欧美视频你懂的| 亚洲另类自拍| 欧美国产日韩视频| 欧美激情一区二区三区在线| 欧美激情偷拍| 亚洲精品免费在线播放| 久久亚洲美女| 久久久久久电影| 国产欧美日韩免费| 91久久亚洲| 午夜精品在线| 欧美一二三区精品| 国产精品天天看| 久久九九久精品国产免费直播| 欧美大片在线观看| 蜜桃av噜噜一区| 狠狠色2019综合网| 亚洲男女自偷自拍图片另类| 免费看亚洲片| 久久er精品视频| 狠狠色噜噜狠狠色综合久| 国产一区二区日韩精品| 久久国产一区二区三区| 欧美性猛交xxxx乱大交蜜桃| 午夜精品久久久久久久久久久久| 欧美三级欧美一级| 午夜免费日韩视频| 亚洲一区二区三区精品在线观看| 欧美经典一区二区| 日韩一本二本av| 免费一级欧美在线大片| 欧美日韩国产va另类| 欧美与黑人午夜性猛交久久久| 久久精品国产69国产精品亚洲 | 国产亚洲精品久久久| 性欧美18~19sex高清播放| 午夜影视日本亚洲欧洲精品| 国产精品高清在线| 久久久久久97三级| 欧美成人精品1314www| 一区二区免费在线观看| 亚洲欧美资源在线| 亚洲永久免费av| 亚洲精品国产精品久久清纯直播| 日韩一级在线观看| 亚洲福利在线视频| 亚洲欧美精品在线观看| 亚洲欧美成人网| 亚洲人在线视频| 中文一区在线| 亚洲精品免费一区二区三区| 一本一本a久久| 国内精品免费在线观看| 亚洲高清一区二| 国产日韩一区在线| 亚洲精品国久久99热| 国产区精品在线观看| 日韩午夜电影av| 亚洲大片精品永久免费| 在线亚洲美日韩| 亚洲精品美女91| 欧美伊人久久久久久久久影院| 亚洲精品免费在线| 久久久久久久久岛国免费| 午夜影院日韩| 国产精品成人免费| 99国产精品久久久久久久成人热| 精品69视频一区二区三区| 亚洲精品日韩综合观看成人91| 在线欧美日韩国产| 欧美在线视频在线播放完整版免费观看 | 亚洲欧美在线一区| 国产精品国产三级欧美二区| 亚洲欧美一区二区视频| 亚洲欧美国产日韩天堂区| 亚洲黄色影片|