Commit Graph

6 Commits

Author SHA1 Message Date
Vadim Zeitlin
7a7bc5dad2 Move wxLocaleIdent to wx/uilocale.h
No real changes, just move this class declaration as it seems more
logical to have it in the same header with wxUILocale which is the only
place where it's used.

This commit is best viewed with --color-moved git option.
2021-09-04 19:00:49 +02:00
Vadim Zeitlin
592e1678ce Add charset support to wxLocaleIdent and accessors
Charset is important for Unix systems as some locales may not be
available without it, e.g. "xx_XX" may not be supported, but
"xx_XX.utf8" could be.
2021-09-01 18:11:40 +02:00
Vadim Zeitlin
20e3697f00 Change wxLocaleIdent ctor to take char* rather than wxString
This is convenient, as it allows using a simple string such as "en" as
an argument to the functions taking wxLocaleIdent and rely on implicit
conversion, whereas previously explicitly writing either wxString("en")
or wxLocaleIdent("en") would be necessary.
2021-09-01 18:11:40 +02:00
Alexander Koshelev
c8269210a2 Add wxUILocale::CompareStrings() function
This function allows comparing strings using the sort order of the
specified locale, represented by the new wxLocaleIdent class.

It is implemented using CompareStringEx()[1] under MSW and
NSString::compare:options:range:locale:[2] under macOS, generic
implementation for the other platforms is upcoming.

[1]: https://docs.microsoft.com/en-us/windows/win32/api/stringapiset/nf-stringapiset-comparestringex
[2]: https://developer.apple.com/documentation/foundation/nsstring/1414561-compare?language=objc
2021-09-01 18:11:33 +02:00
Vadim Zeitlin
405bb3ecf7 Move wxLanguageInfo declaration to wx/localedefs.h too
No real changes, just allow wxUILocale code to use this struct without
including the full wx/intl.h.

This commit is best viewed with --color-moved git option.
2021-08-20 22:02:46 +02:00
Vadim Zeitlin
b6d4eda4ad Extract wxLOCALE_XXX constants into their own header
No real changes, just make it possible to use these constants without
including the entire wx/intl.h.

Note that the existing headers including wx/intl.h need to keep
including it, unfortunately, as not doing it any longer would break
compilation of any code including them which relies on _() or
wxGetTranslation() being defined after including e.g. wx/dc.h. This was,
of course, never guaranteed, but in practice it worked for a very long
time, so don't break it now.

This commit is best viewed with --color-moved git option.
2021-08-14 19:21:55 +02:00