BCB制作多国语言版的提示消息显示的问题

海蓝光科技 2005-04-28 07:16:18
程序中的消息比如按键出错啊, 要弹出个messagebox,大家是怎么处理的啊?
...全文
226 14 打赏 收藏 转发到动态 举报
写回复
用AI写文章
14 条回复
切换为时间正序
请发表友善的回复…
发表回复
leonatcs 2005-04-30
  • 打赏
  • 举报
回复
mark
ILoveProgramer 2005-04-30
  • 打赏
  • 举报
回复
学习
lianghao2 2005-04-30
  • 打赏
  • 举报
回复
ok
m12345 2005-04-30
  • 打赏
  • 举报
回复
学习
cczlp 2005-04-29
  • 打赏
  • 举报
回复
用VC创建rc文件,另存为res, 加入到BCB工程中。与季老大的类似,不过方便一点。
constantine 2005-04-29
  • 打赏
  • 举报
回复
要不就用多国语言控件,不过实际上试做成ini文件得
季老大得方法我没有用过,又学了一招
NetSpider9804040 2005-04-29
  • 打赏
  • 举报
回复
强!
happyct 2005-04-29
  • 打赏
  • 举报
回复
先判断操作系统的语音,然后给出不同的提示即可

来自MSDN
LANGID Identifier = GetSystemDefaultLangID(); 用这个函数来获取

含义列表:
Identifier Language
0x0000 Language Neutral
0x007f The language for the invariant locale (LOCALE_INVARIANT). See MAKELCID.
0x0400 Process or User Default Language
0x0800 System Default Language
0x0436 Afrikaans
0x041c Albanian
0x0401 Arabic (Saudi Arabia)
0x0801 Arabic (Iraq)
0x0c01 Arabic (Egypt)
0x1001 Arabic (Libya)
0x1401 Arabic (Algeria)
0x1801 Arabic (Morocco)
0x1c01 Arabic (Tunisia)
0x2001 Arabic (Oman)
0x2401 Arabic (Yemen)
0x2801 Arabic (Syria)
0x2c01 Arabic (Jordan)
0x3001 Arabic (Lebanon)
0x3401 Arabic (Kuwait)
0x3801 Arabic (U.A.E.)
0x3c01 Arabic (Bahrain)
0x4001 Arabic (Qatar)
0x042b Windows 2000/XP: Armenian. This is Unicode only.
0x042c Azeri (Latin)
0x082c Azeri (Cyrillic)
0x042d Basque
0x0423 Belarusian
0x0402 Bulgarian
0x0455 Burmese
0x0403 Catalan
0x0404 Chinese (Taiwan)
0x0804 Chinese (PRC)
0x0c04 Chinese (Hong Kong SAR, PRC)
0x1004 Chinese (Singapore)
0x1404 Windows 98/Me, Windows 2000/XP: Chinese (Macao SAR)
0x041a Croatian
0x0405 Czech
0x0406 Danish
0x0465 Windows XP: Divehi. This is Unicode only.
0x0413 Dutch (Netherlands)
0x0813 Dutch (Belgium)
0x0409 English (United States)
0x0809 English (United Kingdom)
0x0c09 English (Australian)
0x1009 English (Canadian)
0x1409 English (New Zealand)
0x1809 English (Ireland)
0x1c09 English (South Africa)
0x2009 English (Jamaica)
0x2409 English (Caribbean)
0x2809 English (Belize)
0x2c09 English (Trinidad)
0x3009 Windows 98/Me, Windows 2000/XP: English (Zimbabwe)
0x3409 Windows 98/Me, Windows 2000/XP: English (Philippines)
0x0425 Estonian
0x0438 Faeroese
0x0429 Farsi
0x040b Finnish
0x040c French (Standard)
0x080c French (Belgian)
0x0c0c French (Canadian)
0x100c French (Switzerland)
0x140c French (Luxembourg)
0x180c Windows 98/Me, Windows 2000/XP: French (Monaco)
0x0456 Windows XP: Galician
0x0437 Windows 2000/XP: Georgian. This is Unicode only.
0x0407 German (Standard)
0x0807 German (Switzerland)
0x0c07 German (Austria)
0x1007 German (Luxembourg)
0x1407 German (Liechtenstein)
0x0408 Greek
0x0447 Windows XP: Gujarati. This is Unicode only.
0x040d Hebrew
0x0439 Windows 2000/XP: Hindi. This is Unicode only.
0x040e Hungarian
0x040f Icelandic
0x0421 Indonesian
0x0410 Italian (Standard)
0x0810 Italian (Switzerland)
0x0411 Japanese
0x044b Windows XP: Kannada. This is Unicode only.
0x0457 Windows 2000/XP: Konkani. This is Unicode only.
0x0412 Korean
0x0812 Windows 95, Windows NT 4.0 only: Korean (Johab)
0x0440 Windows XP: Kyrgyz.
0x0426 Latvian
0x0427 Lithuanian
0x0827 Windows 98 only: Lithuanian (Classic)
0x042f FYRO Macedonian
0x043e Malay (Malaysian)
0x083e Malay (Brunei Darussalam)
0x044e Windows 2000/XP: Marathi. This is Unicode only.
0x0450 Windows XP: Mongolian
0x0414 Norwegian (Bokmal)
0x0814 Norwegian (Nynorsk)
0x0415 Polish
0x0416 Portuguese (Brazil)
0x0816 Portuguese (Portugal)
0x0446 Windows XP: Punjabi. This is Unicode only.
0x0418 Romanian
0x0419 Russian
0x044f Windows 2000/XP: Sanskrit. This is Unicode only.
0x0c1a Serbian (Cyrillic)
0x081a Serbian (Latin)
0x041b Slovak
0x0424 Slovenian
0x040a Spanish (Spain, Traditional Sort)
0x080a Spanish (Mexican)
0x0c0a Spanish (Spain, Modern Sort)
0x100a Spanish (Guatemala)
0x140a Spanish (Costa Rica)
0x180a Spanish (Panama)
0x1c0a Spanish (Dominican Republic)
0x200a Spanish (Venezuela)
0x240a Spanish (Colombia)
0x280a Spanish (Peru)
0x2c0a Spanish (Argentina)
0x300a Spanish (Ecuador)
0x340a Spanish (Chile)
0x380a Spanish (Uruguay)
0x3c0a Spanish (Paraguay)
0x400a Spanish (Bolivia)
0x440a Spanish (El Salvador)
0x480a Spanish (Honduras)
0x4c0a Spanish (Nicaragua)
0x500a Spanish (Puerto Rico)
0x0430 Sutu
0x0441 Swahili (Kenya)
0x041d Swedish
0x081d Swedish (Finland)
0x045a Windows XP: Syriac. This is Unicode only.
0x0449 Windows 2000/XP: Tamil. This is Unicode only.
0x0444 Tatar (Tatarstan)
0x044a Windows XP: Telugu. This is Unicode only.
0x041e Thai
0x041f Turkish
0x0422 Ukrainian
0x0420 Windows 98/Me, Windows 2000/XP: Urdu (Pakistan)
0x0820 Urdu (India)
0x0443 Uzbek (Latin)
0x0843 Uzbek (Cyrillic)
0x042a Windows 98/Me, Windows NT 4.0 and later: Vietnamese

示例:

void __fastcall TForm1::CheckButtonClick(TObject *Sender)
{
LANGID ID;
char Language[100];
ID=GetSystemDefaultLangID();
VerLanguageName(ID,Language,100);
ShowMessage(Language);
}
Lonelywolf1899 2005-04-29
  • 打赏
  • 举报
回复
强啊
icwin 2005-04-29
  • 打赏
  • 举报
回复
up
jishiping 2005-04-28
  • 打赏
  • 举报
回复
做一个rc文件,里面同时包含多个语言的字符串就可以了。比如 t.rc

#pragma code_page(1252)
LANGUAGE LANG_ENGLISH,SUBLANG_ENGLISH_US
STRINGTABLE
{
101, "Test"
}

#pragma code_page(936)
LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED
STRINGTABLE
{
101, "测试"
}


将 t.rc 加入到Project中,那么代码 ShowMessage(LoadStr(101));
在英文Windows上显示的是 "Test",而在中文Windows上显示的就是 "测试"
Sephil 2005-04-28
  • 打赏
  • 举报
回复
如果你是用BCB自带的那个Trans什么的估计不行
要是你自己代码控制的那要怎么样还不是你说了算?
海蓝光科技 2005-04-28
  • 打赏
  • 举报
回复
哦, 我是说消息提示框了,
比如出错了, 就要弹一个消息框提示用户了, 这个消息框上面的信息,如过在中文版就用中文提示,如果在英文版就用英文提示啊
耙子 2005-04-28
  • 打赏
  • 举报
回复
按键出错也不至于就谈出一个MessageBox吧?
你想说的是不是异常捕获?

13,825

社区成员

发帖
与我相关
我的任务
社区描述
C++ Builder相关内容讨论区
社区管理员
  • 基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧