Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/125.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 我可以本地化AFX\u IDP\u请求\u保存吗?_C++_Mfc_Localization - Fatal编程技术网

C++ 我可以本地化AFX\u IDP\u请求\u保存吗?

C++ 我可以本地化AFX\u IDP\u请求\u保存吗?,c++,mfc,localization,C++,Mfc,Localization,在我的应用程序中,我有一个“是否保存更改?”消息框。我正在从MFC获取要显示的文本: CString prompt; AfxFormatString1(prompt, AFX_IDP_ASK_TO_SAVE, strFileName); UINT nResult = AfxMessageBox(prompt, MB_YESNOCANCEL, AFX_IDP_ASK_TO_SAVE) 现在我将应用程序本地化为日语。我猜像这样的标准文本已经被翻译成了大多数主要语言。但是我不知道如何设置MFC来使用

在我的应用程序中,我有一个“是否保存更改?”消息框。我正在从MFC获取要显示的文本:

CString prompt;
AfxFormatString1(prompt, AFX_IDP_ASK_TO_SAVE, strFileName);
UINT nResult = AfxMessageBox(prompt, MB_YESNOCANCEL, AFX_IDP_ASK_TO_SAVE)

现在我将应用程序本地化为日语。我猜像这样的标准文本已经被翻译成了大多数主要语言。但是我不知道如何设置MFC来使用这些标准文本的资源标识符的日文版本。可以这样做吗?

结果是我需要更改.rc文件中的几个include文件:

#include "afxres.rc"         // Standard components
#include "afxprint.rc"               // printing/print preview resources
#include "afxribbon.rc"              // MFC ribbon and control bar resources
需要成为:

#include "l.jpn/afxres.rc"         // Standard components
#include "l.jpn/afxprint.rc"               // printing/print preview resources
#include "l.jpn/afxribbon.rc"              // MFC ribbon and control bar resources

在VS2008中,AFX_IDP_要求_保存和其他AFX_。。。字符串保存在MFC本地化dll中:MFC90CHS.dll、MFC90JPN.dll。MFC90KOR.dll等。要在Windows Vista和更高版本上使用它们,您应调用:

SetThreadUILanguage (MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US));

在Windows XP上呼叫:

SetThreadLocale(lcid)
有关常数,请参阅

使用GetSystemDefaultLangID检索正确的区域设置,即在中文操作系统上

重要提示:不要使用GetUserDefaultLangID()或GetSystemDefaultUILanguage(),它们会返回不同的内容,例如,如果您有英文操作系统,请选择中文区域设置

lcid = MAKELCID(GetSystemDefaultLangID(), SORT_DEFAULT);//With Chinese locale, returns 0x804, zh-CN

也许可以查看来源,看看是否有一个可更改的本地化变量?免责声明:提前广告。如果您不想阅读,请跳过此评论!是帮助您翻译应用程序和管理本地化过程的绝佳工具
lcid = MAKELCID(GetSystemDefaultLangID(), SORT_DEFAULT);//With Chinese locale, returns 0x804, zh-CN