1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-20 09:31:15 +02:00

Conversion of TranslatableString to wxString is private

This commit is contained in:
Paul Licameli
2019-11-30 13:32:18 -05:00
parent 0b6618e491
commit 72df562c4a
30 changed files with 119 additions and 99 deletions

View File

@@ -62,11 +62,16 @@ public:
ComponentInterfaceSymbol() = default;
// Allows implicit construction from a msgid re-used as an internal string
ComponentInterfaceSymbol( const wxString &msgid )
: mInternal{ msgid }, mMsgid{ msgid }
ComponentInterfaceSymbol( const TranslatableString &msgid )
: mInternal{ msgid.MSGID().GET(), }, mMsgid{ msgid }
{}
// Allows implicit construction from a msgid re-used as an internal string
// Allows implicit construction from an internal string re-used as a msgid
ComponentInterfaceSymbol( const wxString &internal )
: mInternal{ internal }, mMsgid{ internal }
{}
// Allows implicit construction from an internal string re-used as a msgid
ComponentInterfaceSymbol( const wxChar *msgid )
: mInternal{ msgid }, mMsgid{ msgid }
{}
@@ -82,8 +87,7 @@ public:
const wxString &Internal() const { return mInternal; }
const TranslatableString &Msgid() const { return mMsgid; }
const wxString &Translation() const
{ return GetCustomTranslation( mMsgid ); }
const wxString &Translation() const { return mMsgid.Translation(); }
bool empty() const { return mInternal.empty(); }

View File

@@ -299,7 +299,8 @@ using CommandIDs = std::vector<CommandID>;
// the user-visible translation. The msgid should be used only in unusual cases
// and the translation more often
//
class TranslatableString : public wxString {
// Implicit conversions to and from wxString are intentionally disabled
class TranslatableString : private wxString {
public:
TranslatableString() {}