Enhance wxUILocale and wxLocaleIdent

Many improvements and fixes to wxUILocale:

- Add wxUILocale method for retrieving wxLocaleIdent identifier,
  localized names, layout direction.
- Add wxLocaleIdent attributes, getter, and setter for
  platform-dependent tags under Windows: extension, sort order.
- Modify method wxLocaleIdent::FromTag to support not only BCP 47-like
  tags, but also platform-dependent syntax.
- Modify method wxLocaleIdent::GetTag to allow specifying the tag type.
- Update internat sample to better show using wxUILocale.
- Update German and French message catalogs for internat sample (German
  fully translated, French msgIds only).
- Introduced wxUILocaleImplStdC under Windows, because locale "en-US" is
  not equivalent to the C locale.
- Adjust wxLocale class to restore previous wxUILocale in the
  destructor.
- Implement wxLocale::GetInfo method through wxUILocale methods.
- Removed LCID dependency in wxLocale.
- Move the implementation of some static wxUILocale methods from
  intl.cpp to uilocale.cpp.

Co-authored-by: Vadim Zeitlin <vadim@wxwidgets.org>

Closes #2615.
This commit is contained in:
utelle
2022-03-28 01:11:40 +02:00
committed by Vadim Zeitlin
parent 891cbb1e0e
commit 6d6e5cde21
17 changed files with 2015 additions and 673 deletions

View File

@@ -262,7 +262,8 @@ TEST_CASE("wxUILocale::IsSupported", "[uilocale]")
{
CheckSupported(wxUILocale::FromTag("en"), "English");
CheckSupported(wxUILocale(wxLocaleIdent().Language("fr").Region("FR")), "French");
CHECK( !wxUILocale::FromTag("bloordyblop").IsSupported() );
CHECK_FALSE( wxUILocale::FromTag("bloordyblop").IsSupported() );
CHECK_FALSE( wxUILocale::FromTag("xyz").IsSupported() );
}
TEST_CASE("wxUILocale::GetInfo", "[uilocale]")