Configure TempDefautLocaleSetter

If `locale_t` support is not available, set temporarily the locale using the locale name of this instance.
This commit is contained in:
Ulrich Telle 2022-06-19 13:05:45 +02:00 committed by GitHub
parent e0e34fcb1f
commit 443c2f4339
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -352,7 +352,7 @@ wxUILocaleImplUnix::InitLocaleNameAndCodeset() const
// If extended locale support is not available, we need to temporarily
// switch the global locale to the one we use.
#ifndef HAVE_LOCALE_T
TempDefautLocaleSetter setDefautLocale(LC_CTYPE);
TempDefautLocaleSetter setDefautLocale(LC_CTYPE, m_locId.GetName());
#endif
#ifdef _NL_LOCALE_NAME
@ -400,6 +400,8 @@ wxUILocaleImplUnix::GetLangInfo(nl_item item) const
// We assume that we have nl_langinfo_l() if we have locale_t.
if ( m_locale )
return nl_langinfo_l(item, m_locale);
#else
TempDefautLocaleSetter setDefautLocale(LC_CTYPE, m_locId.GetName());
#endif // HAVE_LOCALE_T
return nl_langinfo(item);