我正在将 MFC 应用程序本地化为日语,并且资源正常运行。
我目前的问题是,当我使用 AfxMessageBox
时或 MessageBox
,对话框标题和按钮消息以英文显示,我还没有找到任何地方可以更改它。
我没有找到任何有用的搜索 MSDN 或 Google。
所以,
这行得通吗? Windows 是否提供日语、阿拉伯语和俄语的“确定”或“是/否”按钮?
如果没有,我要指定什么来改变这些?
编辑:我和 MessageBoxEx
一起去了, 编写一个包装类,使其像 AfxMessageBox
一样方便使用.看来 MB_OK
在英语和日语中显示为“OK”,但其他按钮选项如 MB_YESNO
被翻译成我认为是正确的日语。这是一个相当小的翻译应用程序,我们可能希望对较大的应用程序使用自动化。
最佳答案
使用 MessageBoxEx并指定 WORD wLanguageId 字段。
wLanguageId [in] Specifies the language for the text displayed in the message box button(s). Specifying a value of zero (0) indicates to display the button text in the default system language. If this parameter is MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), the current language associated with the calling thread is used.
To specify a language other than the current language, use the MAKELANGID macro to create this parameter. For more information, see MAKELANGID.
更多信息MAKELANGID可以在这里找到。
如果这对您不起作用,另一种方法是制作您自己的对话框。
关于visual-c++ - 我在哪里翻译 MFC 消息框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/603402/