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

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| 午夜精品偷拍| 欧美成人在线网站| 欧美一区二区三区四区在线观看| 欧美二区在线看| 国产精品一区二区久久久久| 亚洲区中文字幕| 久久精品五月婷婷| 亚洲精品欧洲精品| 欧美中文在线免费| 国产精品多人| 一区二区电影免费观看| 久久伊人亚洲| 亚洲欧美精品suv| 欧美日韩ab片| 在线免费观看成人网| 午夜精品久久久久久久99樱桃| 午夜精品视频网站| 亚洲大胆视频| 亚洲午夜国产成人av电影男同| 欧美日韩免费区域视频在线观看| 西西人体一区二区| 日韩视频在线免费| 欧美国产乱视频| 欧美伊人久久大香线蕉综合69| 宅男噜噜噜66一区二区| 一区国产精品| 亚洲字幕一区二区| 一区二区三区黄色| 久久久蜜臀国产一区二区| 亚洲综合欧美日韩| 亚洲资源av| 妖精视频成人观看www| 亚洲日本精品国产第一区| 老司机免费视频一区二区| 亚洲欧美久久| 一本不卡影院| 玖玖玖国产精品| 亚洲高清视频在线| 亚洲国产欧美另类丝袜| 欧美大学生性色视频| 亚洲精品视频在线看| 亚洲免费成人av电影| 在线观看亚洲| 亚洲人成7777| 91久久夜色精品国产网站| 欧美一二三区精品| 午夜精品99久久免费| 欧美日韩一区二区在线观看| 亚洲电影毛片| 国产精品久99| 一本色道88久久加勒比精品| 国产一区二区你懂的| 久久看片网站| 欧美精品久久久久久久久久| 亚洲免费视频成人| 亚洲午夜一区二区三区| 亚洲少妇自拍| 久久精品成人| 制服丝袜亚洲播放| 欧美三级免费| 欧美.www| 亚洲人成网站在线播| 免费观看成人www动漫视频| 亚洲欧美电影院| 国产精品国产a级| 亚洲一区二区在线播放| 亚洲高清在线观看一区| 久久综合久久88| 欧美韩日精品| 国产偷久久久精品专区| 亚洲国产欧美日韩| 在线亚洲欧美| 国产精品嫩草99a| 欧美中文字幕不卡| 欧美黄色一区二区| 日韩视频免费| 国产精品免费一区二区三区在线观看| 亚洲视频在线观看视频| 久久精品水蜜桃av综合天堂| 精品va天堂亚洲国产| 欧美黄色一区| 亚洲欧美精品一区| 免费成人小视频| 国产拍揄自揄精品视频麻豆| 亚洲人成亚洲人成在线观看| 亚洲小说欧美另类社区| 国产亚洲精品福利| 欧美国产日本| 午夜久久久久| 亚洲国产精品成人久久综合一区| 亚洲一区在线播放| 黄色成人av网站| 欧美一区视频在线| 亚洲国产精品一区二区尤物区 | 欧美国产免费| 一区二区三区视频在线看| 久久久精品国产99久久精品芒果| 国产精品久久久久77777| 欧美在线视频播放| 日韩视频免费在线观看| 久久色在线观看| 亚洲午夜三级在线| 亚洲电影免费| 国产视频精品va久久久久久| 欧美大片18| 久久精品午夜| 欧美韩日精品| 久久精品国产77777蜜臀| 在线中文字幕日韩| 伊人夜夜躁av伊人久久| 国产精品日日做人人爱| 亚洲自拍偷拍视频| 亚洲精品一区二区在线| 久久在精品线影院精品国产| 亚洲欧美日韩中文播放| 99精品国产福利在线观看免费| 欧美激情aⅴ一区二区三区 | 欧美jizzhd精品欧美喷水| 亚洲欧美激情视频| 日韩天堂在线视频| 亚洲欧洲一区二区三区在线观看| 国产午夜精品全部视频在线播放| 欧美性大战xxxxx久久久| 亚洲影视九九影院在线观看| 亚洲精品久久久久久一区二区| 欧美freesex8一10精品| 久久影视三级福利片| 久久精品欧美日韩| 欧美一区二区三区在线视频| 亚洲午夜高清视频| 一本一本久久| 国产精品99久久久久久www| 99成人在线| 制服丝袜亚洲播放| 中文欧美字幕免费| 一本色道久久99精品综合| 亚洲日本电影| 亚洲精品一二区| 一本久久综合亚洲鲁鲁五月天| 99精品国产高清一区二区| 99精品国产在热久久下载| 亚洲另类在线视频| 在线亚洲美日韩| 午夜精品久久| 欧美综合国产| 一区二区三区免费看| 亚洲小说欧美另类社区| 亚洲在线网站| 久久国产精彩视频| 老司机午夜免费精品视频| 欧美成人一区二区三区| 亚洲国产精品专区久久 | 亚洲欧美自拍偷拍| 欧美综合二区| 欧美1区2区3区| 亚洲精选中文字幕| 亚洲伊人色欲综合网| 欧美一区二区高清在线观看| 久久九九99| 欧美精品一区二区三区在线看午夜 | 亚洲精品久久嫩草网站秘色| 99成人免费视频| 欧美成人在线免费视频| 亚洲国产精品一区二区第四页av| 亚洲美女福利视频网站| 亚洲一区二区欧美日韩| 久久成人免费网| 欧美日韩福利在线观看| 国产精品三区www17con| 亚洲高清免费| 午夜日本精品| 亚洲国产成人av| 亚洲女女女同性video| 蜜桃av一区二区三区| 久久久久久日产精品| 欧美全黄视频| 依依成人综合视频| 亚洲影院色在线观看免费| 老司机午夜精品视频| 99热精品在线观看| 麻豆av一区二区三区久久| 国产精品福利在线观看| 亚洲国产精品精华液网站| 亚洲女人天堂av| 亚洲国产毛片完整版| 欧美在线高清| 国产精品久久77777| 日韩亚洲欧美中文三级| 麻豆av福利av久久av| 亚洲欧美日韩另类| 欧美亚洲日本一区|