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.
This commit is contained in:
@@ -118,8 +118,13 @@ public:
|
||||
// Leave language empty
|
||||
wxLocaleIdent() { }
|
||||
|
||||
// Construct name from language
|
||||
wxLocaleIdent(const wxString& language) : m_language(language) { }
|
||||
// Construct from language, i.e. a two-letter ISO 639-1 code (or a
|
||||
// three-letter ISO 639-2 code if there is no ISO 639-1 code for this
|
||||
// language).
|
||||
wxLocaleIdent(const char* language)
|
||||
: m_language(wxString::FromAscii(language))
|
||||
{
|
||||
}
|
||||
|
||||
// Set language
|
||||
wxLocaleIdent& Language(const wxString& language)
|
||||
|
@@ -184,11 +184,14 @@ public:
|
||||
/**
|
||||
Constructor with language.
|
||||
|
||||
Note that this constructor is non-explicit, allowing to pass just a
|
||||
simple string, such as "en", to functions taking wxLocaleIdent.
|
||||
|
||||
@param language
|
||||
ISO 639 language code.
|
||||
See Language() for more detailed info.
|
||||
*/
|
||||
wxLocaleIdent(const wxString& language);
|
||||
wxLocaleIdent(const char* language);
|
||||
|
||||
/**
|
||||
Set language.
|
||||
|
Reference in New Issue
Block a user