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

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   管理


導航

<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>
            亚洲精华国产欧美| 国产精品一二三| 99国产精品久久久久久久| 欧美成人精精品一区二区频| 性欧美超级视频| 欧美一区二区日韩一区二区| 久久久欧美精品sm网站| 久久影院午夜论| 欧美国产日本| 99精品国产高清一区二区| 亚洲天天影视| 久久国产一区二区三区| 久热精品视频在线| 欧美精品七区| 国产一区二区中文字幕免费看| 国产一区二区成人| 亚洲精品之草原avav久久| 亚洲性线免费观看视频成熟| 亚洲欧美国产一区二区三区| 美脚丝袜一区二区三区在线观看| 国产麻豆成人精品| 激情欧美日韩| 亚洲视频一区在线观看| 久久精品中文字幕一区| 亚洲国产成人在线播放| 亚洲中字黄色| 欧美sm视频| 国产主播一区| 亚洲免费在线看| 亚洲高清三级视频| 欧美在线观看视频在线| 欧美乱妇高清无乱码| 国产亚洲欧美一区| 亚洲一区二区三区精品视频 | 亚洲精品四区| 久久国产精品99久久久久久老狼| 亚洲高清影视| 久久久99精品免费观看不卡| 国产精品久久久一区麻豆最新章节| 亚洲国产精彩中文乱码av在线播放| 亚洲影音先锋| 日韩视频久久| 欧美精品1区2区| 亚洲盗摄视频| 女同一区二区| 久久久久久香蕉网| 韩国av一区二区三区四区| 亚洲欧美激情一区| 一本不卡影院| 欧美视频在线一区二区三区| 亚洲免费av片| 亚洲精品国产精品久久清纯直播| 久久免费国产精品| 精品51国产黑色丝袜高跟鞋| 久久精品网址| 欧美一区二区三区久久精品| 国产精品久久久久久av下载红粉| 一本一本大道香蕉久在线精品| 欧美激情在线播放| 午夜精品久久久久久久99樱桃| 亚洲二区三区四区| 久久躁狠狠躁夜夜爽| 有码中文亚洲精品| 蜜臀av一级做a爰片久久| 久色婷婷小香蕉久久| 欧美一区二区视频在线观看| 韩国一区电影| 亚洲国产高清在线观看视频| 欧美国产综合视频| 亚洲香蕉网站| 欧美一区高清| 亚洲国产婷婷香蕉久久久久久| 欧美激情一区二区三级高清视频| 欧美黄色影院| 亚洲欧美影音先锋| 欧美在线资源| 亚洲精品乱码| 这里只有精品视频| 国产一区欧美| 亚洲日本一区二区三区| 亚洲剧情一区二区| 国产精品午夜在线观看| 久久亚洲精品欧美| 欧美了一区在线观看| 欧美一区二区高清在线观看| 浪潮色综合久久天堂| 亚洲视频在线看| 久久精品盗摄| 一本色道婷婷久久欧美| 亚洲女ⅴideoshd黑人| 激情久久久久久久| 亚洲三级色网| 韩国女主播一区二区三区| 亚洲激情小视频| 国产日韩欧美成人| 亚洲黄色小视频| 国产日产亚洲精品系列| 亚洲国产精品电影| 国产欧美一区二区精品忘忧草| 欧美国产日韩一区二区| 国产精品久久久亚洲一区 | 久久视频在线看| 欧美黄色精品| 久久久久国产精品麻豆ai换脸| 蜜臀av一级做a爰片久久| 亚洲综合欧美| 欧美精品久久久久久久| 久久在线视频| 国产精品多人| 亚洲人成小说网站色在线| 国产在线国偷精品产拍免费yy| 亚洲精品国产视频| 在线观看欧美精品| 性视频1819p久久| 亚洲欧美日韩在线综合| 欧美激情欧美狂野欧美精品| 麻豆成人小视频| 国产亚洲精品久久久| 在线一区二区三区四区| 99视频一区二区三区| 欧美高清在线视频观看不卡| 老司机精品视频网站| 国产亚洲午夜| 欧美一区二区三区婷婷月色| 香蕉成人伊视频在线观看| 欧美日本韩国| 亚洲美女性视频| 亚洲美女在线看| 欧美.www| 亚洲国产毛片完整版 | 国产模特精品视频久久久久| 99re8这里有精品热视频免费 | 久久综合色综合88| 久久免费99精品久久久久久| 国产婷婷色综合av蜜臀av| 亚洲女人av| 久久国产天堂福利天堂| 国产偷国产偷亚洲高清97cao| 亚洲手机视频| 欧美在线91| 久久婷婷一区| 欧美肥婆bbw| 亚洲精品免费在线| 欧美精品三级在线观看| 亚洲免费电影在线| 亚洲一区二区精品| 国产毛片精品国产一区二区三区| 亚洲尤物在线视频观看| 亚洲欧美一区二区三区久久| 国产欧美精品一区二区三区介绍 | 久久aⅴ国产紧身牛仔裤| 久久先锋影音av| 亚洲国产经典视频| 欧美日韩国产首页| 亚洲一区二区欧美| 久久蜜桃av一区精品变态类天堂| 国产一区二区三区成人欧美日韩在线观看 | 蜜臀av性久久久久蜜臀aⅴ四虎| 欧美国产日韩免费| 中国成人黄色视屏| 国产免费成人av| 久久综合99re88久久爱| 亚洲人成在线影院| 欧美在线综合| 亚洲日本中文字幕免费在线不卡| 欧美色播在线播放| 久久精品盗摄| 9久re热视频在线精品| 久久国产一区二区| 9l国产精品久久久久麻豆| 国产欧美视频在线观看| 欧美aⅴ一区二区三区视频| 一本色道久久综合亚洲精品按摩| 久久av一区| 一区二区精品在线| 精品福利免费观看| 欧美丝袜一区二区| 久久午夜精品一区二区| 宅男噜噜噜66一区二区 | 一区二区三区视频在线| 久久精品免费| 亚洲少妇在线| 亚洲二区视频| 国产三区二区一区久久| 欧美精品七区| 久久久噜噜噜久久久| 一区二区高清| 亚洲国产精品一区二区www| 久久国产88| 亚洲在线免费视频| 亚洲日本视频| 国外精品视频| 国产日韩精品一区观看| 欧美日韩精品二区第二页| 久久久久免费观看| 欧美怡红院视频| 亚洲在线1234| 亚洲视频精选在线| 日韩一区二区精品葵司在线| 欧美黄色网络|