From e3ea93a624c92d7a7a68dbe5f6178b700dcf0431 Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Thu, 19 Dec 2019 16:20:41 -0500 Subject: [PATCH] Define and use function Verbatim... ... in cases of "TranslatableString" that are not really translated. This makes it easier to scan the code for such unusual constructions of TranslatableString, distinct from mere mentions of the TranslatableString type. --- include/audacity/Types.h | 32 ++++++++++++++++++--------- src/AboutDialog.cpp | 2 +- src/BatchProcessDialog.cpp | 2 +- src/HelpText.cpp | 2 +- src/Internat.cpp | 2 +- src/Languages.cpp | 4 ++-- src/MixerBoard.cpp | 4 ++-- src/PluginManager.cpp | 4 ++-- src/TimerRecordDialog.cpp | 18 +++++++-------- src/commands/CommandManager.cpp | 8 +++---- src/effects/Effect.cpp | 4 ++-- src/effects/Equalization.cpp | 2 +- src/effects/VST/VSTEffect.cpp | 2 +- src/effects/ladspa/LadspaEffect.cpp | 2 +- src/effects/nyquist/Nyquist.cpp | 14 ++++++------ src/effects/vamp/VampEffect.cpp | 20 ++++++++--------- src/export/Export.cpp | 2 +- src/import/Import.cpp | 2 +- src/menus/PluginMenus.cpp | 4 ++-- src/prefs/DevicePrefs.cpp | 5 +++-- src/prefs/KeyConfigPrefs.cpp | 4 ++-- src/prefs/MidiIOPrefs.cpp | 5 +++-- src/prefs/PrefsDialog.cpp | 2 +- src/toolbars/ControlToolBar.cpp | 2 +- src/toolbars/ToolBar.cpp | 2 +- src/tracks/ui/CommonTrackControls.cpp | 16 +++++++------- src/xml/XMLFileReader.cpp | 4 ++-- 27 files changed, 92 insertions(+), 78 deletions(-) diff --git a/include/audacity/Types.h b/include/audacity/Types.h index 700761c92..32b9adebb 100644 --- a/include/audacity/Types.h +++ b/include/audacity/Types.h @@ -308,23 +308,20 @@ class TranslatableString : private wxString { template< size_t N > struct PluralTemp; public: + // A special string value that will have no screen reader pronunciation + static const TranslatableString Inaudible; + // A multi-purpose function, depending on the enum argument; the string // argument is unused in some cases // If there is no function, defaults are empty context string, no plurals, // and no substitutions using Formatter = std::function< wxString(const wxString &, Request) >; - // This special formatter causes msgids to be used verbatim, not looked up - // in any catalog, so Translation() and Debug() return the same - static const Formatter NullContextFormatter; - TranslatableString() {} // Supply {} for the second argument to cause lookup of the msgid with // empty context string (default context) rather than the null context - explicit TranslatableString( - wxString str, Formatter formatter = NullContextFormatter - ) + explicit TranslatableString( wxString str, Formatter formatter ) : mFormatter{ std::move(formatter) } { this->wxString::swap( str ); @@ -472,6 +469,18 @@ public: { return TranslatableString{ *this }.Strip( options ); } private: + static const Formatter NullContextFormatter; + + // Construct a TranslatableString that does no translation but passes + // str verbatim + explicit TranslatableString( wxString str ) + : mFormatter{ NullContextFormatter } + { + this->wxString::swap( str ); + } + + friend TranslatableString Verbatim( wxString str ); + enum class Request { Context, // return a disambiguating context string Format, // Given the msgid, format the string for end users @@ -544,9 +553,6 @@ inline TranslatableString operator +( using TranslatableStrings = std::vector; -// A special string value that will have no screen reader pronunciation -extern const TranslatableString InaudibleString; - // For using std::unordered_map on TranslatableString // Note: hashing on msgids only, which is not all of the information namespace std @@ -561,6 +567,12 @@ namespace std }; } +// Require calls to the one-argument constructor to go through this +// distinct global function name. This makes it easier to locate and +// review the uses of this function, separately from the uses of the type. +inline TranslatableString Verbatim( wxString str ) +{ return TranslatableString( std::move( str ) ); } + // ---------------------------------------------------------------------------- // A native 64-bit integer...used when referring to any number of samples // ---------------------------------------------------------------------------- diff --git a/src/AboutDialog.cpp b/src/AboutDialog.cpp index be4f57c92..c5ee94114 100644 --- a/src/AboutDialog.cpp +++ b/src/AboutDialog.cpp @@ -1034,7 +1034,7 @@ void AboutDialog::AddCredit( const wxString &name, TranslatableString format, Role role ) { auto str = format.empty() - ? TranslatableString{ name } + ? Verbatim( name ) : TranslatableString{ format }.Format( name ); creditItems.emplace_back(std::move(str), role); } diff --git a/src/BatchProcessDialog.cpp b/src/BatchProcessDialog.cpp index c4dba0759..00f674d08 100644 --- a/src/BatchProcessDialog.cpp +++ b/src/BatchProcessDialog.cpp @@ -397,7 +397,7 @@ void ApplyMacroDialog::OnApplyToFiles(wxCommandEvent & WXUNUSED(event)) files.Sort(); - wxDialogWrapper activityWin(this, wxID_ANY, TranslatableString{ GetTitle() }); + wxDialogWrapper activityWin(this, wxID_ANY, Verbatim( GetTitle() ) ); activityWin.SetName(); ShuttleGui S(&activityWin, eIsCreating); diff --git a/src/HelpText.cpp b/src/HelpText.cpp index f41fcc3bd..9318b2e85 100644 --- a/src/HelpText.cpp +++ b/src/HelpText.cpp @@ -200,7 +200,7 @@ TranslatableString TitleText( const wxString & Key ) return XO("No Local Help"); } // Uh oh, no translation... - return TranslatableString{ Key }; + return Verbatim( Key ); } static wxString HelpTextBuiltIn( const wxString & Key ) diff --git a/src/Internat.cpp b/src/Internat.cpp index 2f8ce4aac..a09d57bdc 100644 --- a/src/Internat.cpp +++ b/src/Internat.cpp @@ -402,4 +402,4 @@ TranslatableString &TranslatableString::Join( return *this; } -const TranslatableString InaudibleString{ wxT("\a") }; +const TranslatableString TranslatableString::Inaudible{ wxT("\a") }; diff --git a/src/Languages.cpp b/src/Languages.cpp index d4159c94e..a216356ff 100644 --- a/src/Languages.cpp +++ b/src/Languages.cpp @@ -202,7 +202,7 @@ void GetLanguages( auto str = wxString::FromUTF8(utf8Name); auto code = str.BeforeFirst(' '); auto name = str.AfterFirst(' '); - localLanguageName[code] = TranslatableString{ name }; + localLanguageName[code] = Verbatim( name ); } return localLanguageName; }(); @@ -230,7 +230,7 @@ void GetLanguages( wxString fullCode = info->CanonicalName; wxString code = fullCode.Left(2); - TranslatableString name{ info->Description }; + auto name = Verbatim( info->Description ); // Logic: Languages codes are sometimes hierarchical, with a // general language code and then a subheading. For example, diff --git a/src/MixerBoard.cpp b/src/MixerBoard.cpp index 4cb9abff5..8638b9c26 100644 --- a/src/MixerBoard.cpp +++ b/src/MixerBoard.cpp @@ -175,7 +175,7 @@ MixerTrackCluster::MixerTrackCluster(wxWindow* parent, mProject = project; wxASSERT( pTrack ); - SetName( TranslatableString{ mTrack->GetName() } ); + SetName( Verbatim( mTrack->GetName() ) ); //this->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE)); this->SetBackgroundColour( theTheme.Colour( clrMedium ) ); @@ -463,7 +463,7 @@ void MixerTrackCluster::UpdateForStateChange() { const wxString newName = mTrack->GetName(); if (newName != GetName()) { - SetName( TranslatableString{ newName } ); + SetName( Verbatim( newName ) ); mStaticText_TrackName->SetLabel(newName); mStaticText_TrackName->SetName(newName); #if wxUSE_TOOLTIPS diff --git a/src/PluginManager.cpp b/src/PluginManager.cpp index 8dc2fb370..58a7905f9 100644 --- a/src/PluginManager.cpp +++ b/src/PluginManager.cpp @@ -988,8 +988,8 @@ void PluginRegistrationDialog::OnOK(wxCommandEvent & WXUNUSED(evt)) // we will leave the project window in an unusable state on OSX. // See bug #1192. { - ProgressDialog progress( - TranslatableString{ GetTitle() }, msg, pdlgHideStopButton); + ProgressDialog progress{ + Verbatim( GetTitle() ), msg, pdlgHideStopButton }; progress.CenterOnParent(); int i = 0; diff --git a/src/TimerRecordDialog.cpp b/src/TimerRecordDialog.cpp index 6ea4da858..545717231 100644 --- a/src/TimerRecordDialog.cpp +++ b/src/TimerRecordDialog.cpp @@ -546,8 +546,8 @@ int TimerRecordDialog::RunWaitDialog() ProjectAudioManager::Get( *pProject ).OnRecord(false); bool bIsRecording = true; - auto sPostAction = TranslatableString{ - m_pTimerAfterCompleteChoiceCtrl->GetStringSelection() }; + auto sPostAction = Verbatim( + m_pTimerAfterCompleteChoiceCtrl->GetStringSelection() ); // Two column layout. TimerProgressDialog::MessageTable columns{ @@ -562,7 +562,7 @@ int TimerRecordDialog::RunWaitDialog() }, { GetDisplayDate(m_DateTime_Start) , - TranslatableString{ m_TimeSpan_Duration.Format() }, + Verbatim( m_TimeSpan_Duration.Format() ), GetDisplayDate(m_DateTime_End) , {} , (m_bAutoSaveEnabled ? XO("Yes") : XO("No")) , @@ -790,7 +790,7 @@ TranslatableString TimerRecordDialog::GetDisplayDate( wxDateTime & dt ) // Use default formatting wxPrintf(wxT("%s\n"), dt.Format()); - return TranslatableString{ dt.FormatDate() + wxT(" ") + dt.FormatTime() }; + return Verbatim( dt.FormatDate() + wxT(" ") + dt.FormatTime() ); } TimerRecordPathCtrl * TimerRecordDialog::NewPathControl(wxWindow *wParent, const int iID, @@ -1058,8 +1058,8 @@ void TimerRecordDialog::UpdateEnd() ProgressResult TimerRecordDialog::WaitForStart() { // MY: The Waiting For Start dialog now shows what actions will occur after recording has completed - auto sPostAction = TranslatableString{ - m_pTimerAfterCompleteChoiceCtrl->GetStringSelection() }; + auto sPostAction = Verbatim( + m_pTimerAfterCompleteChoiceCtrl->GetStringSelection() ); // Two column layout. TimerProgressDialog::MessageTable columns{ @@ -1074,7 +1074,7 @@ ProgressResult TimerRecordDialog::WaitForStart() }, { GetDisplayDate(m_DateTime_Start), - TranslatableString{ m_TimeSpan_Duration.Format() }, + Verbatim( m_TimeSpan_Duration.Format() ), GetDisplayDate(m_DateTime_End) , {} , (m_bAutoSaveEnabled ? XO("Yes") : XO("No")) , @@ -1106,8 +1106,8 @@ ProgressResult TimerRecordDialog::WaitForStart() ProgressResult TimerRecordDialog::PreActionDelay(int iActionIndex, TimerRecordCompletedActions eCompletedActions) { - auto sAction = TranslatableString{ m_pTimerAfterCompleteChoiceCtrl - ->GetString(iActionIndex) }; + auto sAction = Verbatim( m_pTimerAfterCompleteChoiceCtrl + ->GetString(iActionIndex) ); /* i18n-hint: %s is one of "Do nothing", "Exit Audacity", "Restart system", or "Shutdown system", and diff --git a/src/commands/CommandManager.cpp b/src/commands/CommandManager.cpp index e2961ea0e..47ba45395 100644 --- a/src/commands/CommandManager.cpp +++ b/src/commands/CommandManager.cpp @@ -985,7 +985,7 @@ TranslatableString CommandManager::DescribeCommandsAndShortcuts( // Note: not putting this and other short format strings in the // translation catalogs - auto piece = TranslatableString{wxT("%s%s")} + auto piece = Verbatim( wxT("%s%s") ) .Format( mark, pair.Msgid().Stripped() ); auto name = pair.Internal(); @@ -1004,14 +1004,14 @@ TranslatableString CommandManager::DescribeCommandsAndShortcuts( #endif // The mark makes correctly placed parentheses for RTL, even // in the case that the piece is untranslated. - piece = TranslatableString{format}.Format( piece, mark, keyString ); + piece = Verbatim( format ).Format( piece, mark, keyString ); } } if (result.empty()) result = piece; else - result = TranslatableString{ separatorFormat }.Format( result, piece ); + result = Verbatim( separatorFormat ).Format( result, piece ); } return result; } @@ -1347,7 +1347,7 @@ TranslatableString CommandManager::GetPrefixedLabelFromName(const CommandID &nam return {}; if (!entry->labelPrefix.empty()) - return TranslatableString{wxT("%s - %s")} + return Verbatim( wxT("%s - %s") ) .Format(entry->labelPrefix, entry->label); else return entry->label; diff --git a/src/effects/Effect.cpp b/src/effects/Effect.cpp index 7eba3f7a1..5d5b32fdb 100644 --- a/src/effects/Effect.cpp +++ b/src/effects/Effect.cpp @@ -2567,8 +2567,8 @@ public: : wxPanelWrapper(parent) { // This fools NVDA into not saying "Panel" when the dialog gets focus - SetName(InaudibleString); - SetLabel(InaudibleString); + SetName(TranslatableString::Inaudible); + SetLabel(TranslatableString::Inaudible); mAcceptsFocus = true; } diff --git a/src/effects/Equalization.cpp b/src/effects/Equalization.cpp index 2268e4b1c..5aa2caa64 100644 --- a/src/effects/Equalization.cpp +++ b/src/effects/Equalization.cpp @@ -988,7 +988,7 @@ void EffectEqualization::PopulateOrExchange(ShuttleGui & S) { wxString label; label.Printf(wxT("%ld"), mM); - mMText = S.Name( TranslatableString{ label } ) + mMText = S.Name( Verbatim( label ) ) // fix for bug 577 (NVDA/Narrator screen readers do not // read static text in dialogs) .AddVariableText(label); diff --git a/src/effects/VST/VSTEffect.cpp b/src/effects/VST/VSTEffect.cpp index 8e55be7ea..9a9bfd6d3 100644 --- a/src/effects/VST/VSTEffect.cpp +++ b/src/effects/VST/VSTEffect.cpp @@ -618,7 +618,7 @@ unsigned VSTEffectsModule::DiscoverPluginsAtPath( break; case kKeyDescription: - proc.mDescription = TranslatableString{ val }; + proc.mDescription = Verbatim( val ); keycount++; break; diff --git a/src/effects/ladspa/LadspaEffect.cpp b/src/effects/ladspa/LadspaEffect.cpp index 662939c56..e24fc5536 100644 --- a/src/effects/ladspa/LadspaEffect.cpp +++ b/src/effects/ladspa/LadspaEffect.cpp @@ -670,7 +670,7 @@ wxString LadspaEffect::GetVersion() TranslatableString LadspaEffect::GetDescription() { - return TranslatableString{ LAT1CTOWX(mData->Copyright) }; + return Verbatim( LAT1CTOWX(mData->Copyright) ); } // ============================================================================ diff --git a/src/effects/nyquist/Nyquist.cpp b/src/effects/nyquist/Nyquist.cpp index 33593c367..df7ed1f9a 100644 --- a/src/effects/nyquist/Nyquist.cpp +++ b/src/effects/nyquist/Nyquist.cpp @@ -188,7 +188,7 @@ NyquistEffect::NyquistEffect(const wxString &fName) mFileName = fName; // Use the file name verbatim as effect name. // This is only a default name, overridden if we find a $name line: - mName = TranslatableString{ mFileName.GetName() }; + mName = Verbatim( mFileName.GetName() ); mFileModified = mFileName.GetModificationTime(); ParseFile(); @@ -2630,8 +2630,8 @@ void NyquistEffect::BuildEffectWindow(ShuttleGui & S) } else { - auto prompt = wxString::Format(_("%s:"), ctrl.name); - S.AddPrompt(prompt); + auto prompt = XO("%s:").Format( ctrl.name ); + S.AddPrompt( prompt.Translation() ); if (ctrl.type == NYQ_CTRL_STRING) { @@ -2639,7 +2639,7 @@ void NyquistEffect::BuildEffectWindow(ShuttleGui & S) auto item = S.Id(ID_Text + i) .Validator(&ctrl.valStr) - .Name( TranslatableString{ prompt } ) + .Name( prompt ) .AddTextBox( {}, wxT(""), 12); } else if (ctrl.type == NYQ_CTRL_CHOICE) @@ -2666,7 +2666,7 @@ void NyquistEffect::BuildEffectWindow(ShuttleGui & S) mProjectRate, options); S - .Name( TranslatableString{ prompt } ) + .Name( prompt ) .Position(wxALIGN_LEFT | wxALL) .AddWindow(time); } @@ -2691,7 +2691,7 @@ void NyquistEffect::BuildEffectWindow(ShuttleGui & S) resolveFilePath(ctrl.valStr, defaultExtension); wxTextCtrl *item = S.Id(ID_Text+i) - .Name( TranslatableString{ prompt } ) + .Name( prompt ) .AddTextBox( {}, wxT(""), 40); item->SetValidator(wxGenericValidator(&ctrl.valStr)); @@ -2731,7 +2731,7 @@ void NyquistEffect::BuildEffectWindow(ShuttleGui & S) (int) ctrl.low, (int) ctrl.high); } wxTextCtrl *item = S - .Name( TranslatableString{ prompt } ) + .Name( prompt ) .AddTextBox( {}, wxT(""), (ctrl.type == NYQ_CTRL_INT_TEXT || ctrl.type == NYQ_CTRL_FLOAT_TEXT) ? 25 : 12); diff --git a/src/effects/vamp/VampEffect.cpp b/src/effects/vamp/VampEffect.cpp index 1a4fdca2f..c9dc152c5 100644 --- a/src/effects/vamp/VampEffect.cpp +++ b/src/effects/vamp/VampEffect.cpp @@ -109,8 +109,8 @@ wxString VampEffect::GetVersion() TranslatableString VampEffect::GetDescription() { - return TranslatableString{ - wxString::FromUTF8(mPlugin->getCopyright().c_str()) }; + return Verbatim( + wxString::FromUTF8(mPlugin->getCopyright().c_str()) ); } // ============================================================================ @@ -608,8 +608,8 @@ void VampEffect::PopulateOrExchange(ShuttleGui & S) mParameters[p].maxValue == 1.0) { S.Id(ID_Toggles + p); - mToggles[p] = S.ToolTip( TranslatableString{ tip } ) - .Name( TranslatableString{ labelText } ) + mToggles[p] = S.ToolTip( Verbatim( tip ) ) + .Name( Verbatim( labelText ) ) .Position(wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL) .AddCheckBox( {}, value > 0.5 ); @@ -637,8 +637,8 @@ void VampEffect::PopulateOrExchange(ShuttleGui & S) } S.Id(ID_Choices + p); - mChoices[p] = S.ToolTip( TranslatableString{ tip } ) - .Name( TranslatableString{ labelText } ) + mChoices[p] = S.ToolTip( Verbatim( tip ) ) + .Name( Verbatim( labelText ) ) .Position(wxEXPAND | wxALIGN_CENTER_VERTICAL | wxALL) .MinSize( { -1, -1 } ) .AddChoice( {}, choices, selected ); @@ -654,8 +654,8 @@ void VampEffect::PopulateOrExchange(ShuttleGui & S) float range = mParameters[p].maxValue - mParameters[p].minValue; S.Id(ID_Texts + p); - mFields[p] = S.ToolTip( TranslatableString{ tip } ) - .Name( TranslatableString{ labelText } ) + mFields[p] = S.ToolTip( Verbatim( tip ) ) + .Name( Verbatim( labelText ) ) .Position(wxALIGN_CENTER_VERTICAL | wxALL) .Validator>( 6, &mValues[p], @@ -671,8 +671,8 @@ void VampEffect::PopulateOrExchange(ShuttleGui & S) S.AddPrompt(str); S.Id(ID_Sliders + p); - mSliders[p] = S.ToolTip( TranslatableString{ tip } ) - .Name( TranslatableString{ labelText } ) + mSliders[p] = S.ToolTip( Verbatim( tip ) ) + .Name( Verbatim( labelText ) ) .Style(wxSL_HORIZONTAL) .MinSize( { 150, -1 } ) .AddSlider( {}, 0, 1000, 0); diff --git a/src/export/Export.cpp b/src/export/Export.cpp index 23507ffa9..13a68b8ef 100644 --- a/src/export/Export.cpp +++ b/src/export/Export.cpp @@ -280,7 +280,7 @@ void ExportPlugin::InitProgress(std::unique_ptr &pDialog, const wxFileNameWrapper &title, const TranslatableString &message) { return InitProgress( - pDialog, TranslatableString{ title.GetName() }, message ); + pDialog, Verbatim( title.GetName() ), message ); } //---------------------------------------------------------------------------- diff --git a/src/import/Import.cpp b/src/import/Import.cpp index a8023541f..80c0ae475 100644 --- a/src/import/Import.cpp +++ b/src/import/Import.cpp @@ -809,6 +809,6 @@ void ImportFileHandle::CreateProgress() auto title = XO("Importing %s").Format( GetFileDescription() ); mProgress = std::make_unique< ProgressDialog >( - title, TranslatableString{ ff.GetFullName() } ); + title, Verbatim( ff.GetFullName() ) ); } diff --git a/src/menus/PluginMenus.cpp b/src/menus/PluginMenus.cpp index 29204c18d..6891d7fa9 100644 --- a/src/menus/PluginMenus.cpp +++ b/src/menus/PluginMenus.cpp @@ -653,7 +653,7 @@ void AddEffectMenuItemGroup( wxString item = plug->GetPath(); if( plug->GetPluginType() == PluginTypeEffect ) temp2.push_back( Command( item, - TranslatableString{ item }, + Verbatim( item ), FN(OnEffect), flags[i], CommandManager::Options{} @@ -721,7 +721,7 @@ MenuTable::BaseItemPtrs PopulateMacrosMenu( CommandFlag flags ) for (i = 0; i < (int)names.size(); i++) { auto MacroID = ApplyMacroDialog::MacroIdOfName( names[i] ); result.push_back( MenuTable::Command( MacroID, - TranslatableString{ names[i] }, // file name verbatim + Verbatim( names[i] ), // file name verbatim FN(OnApplyMacroDirectly), flags, CommandManager::Options{}.AllowInMacros() diff --git a/src/prefs/DevicePrefs.cpp b/src/prefs/DevicePrefs.cpp index cec479490..ac757ea3e 100644 --- a/src/prefs/DevicePrefs.cpp +++ b/src/prefs/DevicePrefs.cpp @@ -115,8 +115,9 @@ void DevicePrefs::GetNamesAndLabels() const PaDeviceInfo *info = Pa_GetDeviceInfo(i); if ((info!=NULL)&&(info->maxOutputChannels > 0 || info->maxInputChannels > 0)) { wxString name = wxSafeConvertMB2WX(Pa_GetHostApiInfo(info->hostApi)->name); - if (!make_iterator_range(mHostNames).contains(TranslatableString{name})) { - mHostNames.push_back( TranslatableString{ name } ); + if (!make_iterator_range(mHostNames) + .contains( Verbatim( name ) )) { + mHostNames.push_back( Verbatim( name ) ); mHostLabels.push_back(name); } } diff --git a/src/prefs/KeyConfigPrefs.cpp b/src/prefs/KeyConfigPrefs.cpp index 6c9b7137e..5ea9a2391 100644 --- a/src/prefs/KeyConfigPrefs.cpp +++ b/src/prefs/KeyConfigPrefs.cpp @@ -572,11 +572,11 @@ void KeyConfigPrefs::OnSet(wxCommandEvent & WXUNUSED(event)) // Prevent same hotkey combination being used twice. if (!oldname.empty()) { - auto oldlabel = TranslatableString{wxT("%s - %s")} + auto oldlabel = Verbatim( wxT("%s - %s") ) .Format( mManager->GetCategoryFromName(oldname), mManager->GetPrefixedLabelFromName(oldname) ); - auto newlabel = TranslatableString{wxT("%s - %s")} + auto newlabel = Verbatim( wxT("%s - %s") ) .Format( mManager->GetCategoryFromName(newname), mManager->GetPrefixedLabelFromName(newname) ); diff --git a/src/prefs/MidiIOPrefs.cpp b/src/prefs/MidiIOPrefs.cpp index 1e3d10f24..44ecbbddf 100644 --- a/src/prefs/MidiIOPrefs.cpp +++ b/src/prefs/MidiIOPrefs.cpp @@ -119,8 +119,9 @@ void MidiIOPrefs::GetNamesAndLabels() { const PmDeviceInfo *info = Pm_GetDeviceInfo(i); if (info->output || info->input) { //should always happen wxString name = wxSafeConvertMB2WX(info->interf); - if (!make_iterator_range(mHostNames).contains(TranslatableString{name})) { - mHostNames.push_back( TranslatableString{ name } ); + if (!make_iterator_range(mHostNames) + .contains( Verbatim( name ) )) { + mHostNames.push_back( Verbatim( name ) ); mHostLabels.push_back(name); } } diff --git a/src/prefs/PrefsDialog.cpp b/src/prefs/PrefsDialog.cpp index 4f6b55f82..2c9c7f6f4 100644 --- a/src/prefs/PrefsDialog.cpp +++ b/src/prefs/PrefsDialog.cpp @@ -696,7 +696,7 @@ int PrefsDialog::ShowModal() } else { auto Temp = mTitlePrefix; - Temp.Join( TranslatableString{ mUniquePage->GetLabel() }, wxT(" ") ); + Temp.Join( Verbatim( mUniquePage->GetLabel() ), wxT(" ") ); SetTitle(Temp); SetName(Temp); } diff --git a/src/toolbars/ControlToolBar.cpp b/src/toolbars/ControlToolBar.cpp index 433489719..c541b997f 100644 --- a/src/toolbars/ControlToolBar.cpp +++ b/src/toolbars/ControlToolBar.cpp @@ -269,7 +269,7 @@ void ControlToolBar::RegenerateTooltips() break; } std::vector commands( - 1u, { name, TranslatableString{ pCtrl->GetLabel() } } ); + 1u, { name, Verbatim( pCtrl->GetLabel() ) } ); // Some have a second switch (iWinID) diff --git a/src/toolbars/ToolBar.cpp b/src/toolbars/ToolBar.cpp index 4cc91d716..dfbb737f7 100644 --- a/src/toolbars/ToolBar.cpp +++ b/src/toolbars/ToolBar.cpp @@ -386,7 +386,7 @@ void ToolBar::SetLabel(const wxString & label) { // Probably shouldn't reach this overload, but perhaps virtual function // dispatch will take us here from a pointer to the wxPanel base class - mLabel = TranslatableString{ label }; + mLabel = Verbatim( label ); } void ToolBar::SetLabel(const TranslatableString & label) diff --git a/src/tracks/ui/CommonTrackControls.cpp b/src/tracks/ui/CommonTrackControls.cpp index 799b61dcf..442dcfab5 100644 --- a/src/tracks/ui/CommonTrackControls.cpp +++ b/src/tracks/ui/CommonTrackControls.cpp @@ -128,40 +128,40 @@ BEGIN_POPUP_MENU(TrackMenuTable) // functions. OnMoveUpID, XO("Move Track &Up").Join( - TranslatableString{ + Verbatim( CommandManager::Get( *GetActiveProject() ). // using GET to compose menu item name for wxWidgets - GetKeyFromName(wxT("TrackMoveUp")).GET() }, + GetKeyFromName(wxT("TrackMoveUp")).GET() ), wxT("\t") ), OnMoveTrack) POPUP_MENU_ITEM( OnMoveDownID, XO("Move Track &Down").Join( - TranslatableString{ + Verbatim( CommandManager::Get( *GetActiveProject() ). // using GET to compose menu item name for wxWidgets - GetKeyFromName(wxT("TrackMoveDown")).GET() }, + GetKeyFromName(wxT("TrackMoveDown")).GET() ), wxT("\t") ), OnMoveTrack) POPUP_MENU_ITEM( OnMoveTopID, XO("Move Track to &Top").Join( - TranslatableString{ + Verbatim( CommandManager::Get( *GetActiveProject() ). // using GET to compose menu item name for wxWidgets - GetKeyFromName(wxT("TrackMoveTop")).GET() }, + GetKeyFromName(wxT("TrackMoveTop")).GET() ), wxT("\t") ), OnMoveTrack) POPUP_MENU_ITEM( OnMoveBottomID, XO("Move Track to &Bottom").Join( - TranslatableString{ + Verbatim( CommandManager::Get( *GetActiveProject() ). // using GET to compose menu item name for wxWidgets - GetKeyFromName(wxT("TrackMoveBottom")).GET() }, + GetKeyFromName(wxT("TrackMoveBottom")).GET() ), wxT("\t") ), OnMoveTrack) diff --git a/src/xml/XMLFileReader.cpp b/src/xml/XMLFileReader.cpp index 46b2c6da9..51f02dbcf 100644 --- a/src/xml/XMLFileReader.cpp +++ b/src/xml/XMLFileReader.cpp @@ -59,9 +59,9 @@ bool XMLFileReader::Parse(XMLTagHandler *baseHandler, // We could make a table of XOs if we wanted so that it could // If we do, uncomment the second constructor argument so it's not // a verbatim string - mLibraryErrorStr = TranslatableString{ + mLibraryErrorStr = Verbatim( XML_ErrorString(XML_GetErrorCode(mParser)) // , {} - }; + ); mErrorStr = XO("Error: %s at line %lu").Format( mLibraryErrorStr,