Support creating Unix wxUILocale for languages without region

Unlike MSW and macOS, creating wxUILocale for e.g. "en" doesn't
necessarily succeed under Linux even if "en_US" is available, so try to
find a working language+region combination if just language doesn't
work.

This requires access to the languages database, so add a private
wxGetLanguageInfos() to avoid having to depend on wxLocale just for
this.
This commit is contained in:
Vadim Zeitlin
2021-09-01 01:02:00 +02:00
parent e92da29272
commit 3f8fd90c31
3 changed files with 57 additions and 17 deletions

View File

@@ -12,6 +12,12 @@
#include "wx/localedefs.h"
#include "wx/string.h"
#include "wx/vector.h"
typedef wxVector<wxLanguageInfo> wxLanguageInfos;
// Return the vector of all known languages.
const wxLanguageInfos& wxGetLanguageInfos();
// Function returning hard-coded values for the "C" locale.
wxString wxGetStdCLocaleInfo(wxLocaleInfo index, wxLocaleCategory cat);