@@ -3293,9 +3293,12 @@ namespace IGFD
32933293
32943294 bool IGFD::FileDialog::Display (const std::string& vKey, ImGuiWindowFlags vFlags, ImVec2 vMinSize, ImVec2 vMaxSize)
32953295 {
3296+ bool res = false ;
3297+
32963298 if (prFileDialogInternal.puShowDialog && prFileDialogInternal.puDLGkey == vKey)
32973299 {
3298- bool res = false ;
3300+ if (prFileDialogInternal.puUseCustomLocale )
3301+ setlocale (prFileDialogInternal.puLocaleCategory , prFileDialogInternal.puLocaleBegin .c_str ());
32993302
33003303 auto & fdFile = prFileDialogInternal.puFileManager ;
33013304 auto & fdFilter = prFileDialogInternal.puFilterManager ;
@@ -3405,10 +3408,13 @@ namespace IGFD
34053408 ImGui::End ();
34063409
34073410 // confirm the result and show the confirm to overwrite dialog if needed
3408- return prConfirm_Or_OpenOverWriteFileDialog_IfNeeded (res, vFlags);
3411+ res = prConfirm_Or_OpenOverWriteFileDialog_IfNeeded (res, vFlags);
3412+
3413+ if (prFileDialogInternal.puUseCustomLocale )
3414+ setlocale (prFileDialogInternal.puLocaleCategory , prFileDialogInternal.puLocaleEnd .c_str ());
34093415 }
34103416
3411- return false ;
3417+ return res ;
34123418 }
34133419
34143420 void IGFD::FileDialog::NewFrame ()
@@ -4088,6 +4094,13 @@ namespace IGFD
40884094 prFileDialogInternal.puFilterManager .ClearExtentionInfos ();
40894095 }
40904096
4097+ void IGFD::FileDialog::SetLocales (const int & vLocaleCategory, const std::string& vLocaleBegin, const std::string& vLocaleEnd)
4098+ {
4099+ prFileDialogInternal.puUseCustomLocale = true ;
4100+ prFileDialogInternal.puLocaleBegin = vLocaleBegin;
4101+ prFileDialogInternal.puLocaleEnd = vLocaleEnd;
4102+ }
4103+
40914104 // ////////////////////////////////////////////////////////////////////////////
40924105 // // OVERWRITE DIALOG ////////////////////////////////////////////////////////
40934106 // ////////////////////////////////////////////////////////////////////////////
@@ -4677,6 +4690,13 @@ IMGUIFILEDIALOG_API void IGFD_ClearExtentionInfos(ImGuiFileDialog* vContext)
46774690 vContext->ClearExtentionInfos ();
46784691 }
46794692}
4693+ IMGUIFILEDIALOG_API void SetLocales (ImGuiFileDialog* vContext, const int vCategory, const char * vBeginLocale, const char * vEndLocale)
4694+ {
4695+ if (vContext)
4696+ {
4697+ vContext->SetLocales (vCategory, (vBeginLocale ? vBeginLocale : " " ), (vEndLocale ? vEndLocale : " " ));
4698+ }
4699+ }
46804700
46814701#ifdef USE_EXPLORATION_BY_KEYS
46824702IMGUIFILEDIALOG_API void IGFD_SetFlashingAttenuationInSeconds (ImGuiFileDialog* vContext, float vAttenValue)
0 commit comments