diff --git a/src/BatchProcessDialog.cpp b/src/BatchProcessDialog.cpp index 630431c4f..21587f6a0 100644 --- a/src/BatchProcessDialog.cpp +++ b/src/BatchProcessDialog.cpp @@ -268,8 +268,8 @@ void ApplyMacroDialog::ApplyMacroToProject( int iMacro, bool bHasGui ) S.StartStatic( {}, false); // deliberately not translated (!) { S.SetBorder(20); - S.AddFixedText(wxString::Format(_("Applying '%s' to current project"), - name)); + S.AddFixedText(XO("Applying '%s' to current project") + .Format( name ) ); } S.EndStatic(); } diff --git a/src/FFmpeg.cpp b/src/FFmpeg.cpp index c15c73e7a..17a35bb53 100644 --- a/src/FFmpeg.cpp +++ b/src/FFmpeg.cpp @@ -579,7 +579,7 @@ void FFmpegNotFoundDialog::PopulateOrExchange(ShuttleGui & S) S.SetBorder(10); S.StartVerticalLay(true); { - S.AddFixedText(_( + S.AddFixedText(XO( "Audacity attempted to use FFmpeg to import an audio file,\n\ but the libraries were not found.\n\n\ To use FFmpeg import, go to Edit > Preferences > Libraries\n\ diff --git a/src/LabelDialog.cpp b/src/LabelDialog.cpp index 33148c440..f012d815f 100644 --- a/src/LabelDialog.cpp +++ b/src/LabelDialog.cpp @@ -250,7 +250,7 @@ void LabelDialog::Populate() void LabelDialog::PopulateOrExchange( ShuttleGui & S ) { - S.AddFixedText(_("Press F2 or double click to edit cell contents.")); + S.AddFixedText(XO("Press F2 or double click to edit cell contents.")); S.StartHorizontalLay(wxEXPAND,1); { S.StartVerticalLay(wxEXPAND,1); diff --git a/src/ShuttleGui.cpp b/src/ShuttleGui.cpp index b0d1bbb81..a3fe66a17 100644 --- a/src/ShuttleGui.cpp +++ b/src/ShuttleGui.cpp @@ -426,17 +426,20 @@ wxChoice * ShuttleGuiBase::AddChoice( const TranslatableString &Prompt, Prompt, choices, make_iterator_range( choices ).index( Selected ) ); } -void ShuttleGuiBase::AddFixedText(const wxString &Str, bool bCenter, int wrapWidth) +void ShuttleGuiBase::AddFixedText( + const TranslatableString &Str, bool bCenter, int wrapWidth) { + const auto translated = Str.Translation(); UseUpId(); if( mShuttleMode != eIsCreating ) return; - auto text = safenew wxStaticText(GetParent(), miId, Str, wxDefaultPosition, wxDefaultSize, + auto text = safenew wxStaticText(GetParent(), + miId, translated, wxDefaultPosition, wxDefaultSize, GetStyle( wxALIGN_LEFT )); mpWind = text; if ( wrapWidth > 0 ) text->Wrap( wrapWidth ); - mpWind->SetName(wxStripMenuCodes(Str)); // fix for bug 577 (NVDA/Narrator screen readers do not read static text in dialogs) + mpWind->SetName(wxStripMenuCodes(translated)); // fix for bug 577 (NVDA/Narrator screen readers do not read static text in dialogs) if( bCenter ) { miProp=1; diff --git a/src/ShuttleGui.h b/src/ShuttleGui.h index be13f25be..682e796c7 100644 --- a/src/ShuttleGui.h +++ b/src/ShuttleGui.h @@ -342,7 +342,8 @@ public: wxMenu * AddMenu( const wxString & Title ); void AddIcon( wxBitmap * pBmp); void AddIconButton( const wxString & Command, const wxString & Params,wxBitmap * pBmp ); - void AddFixedText( const wxString & Str, bool bCenter = false, int wrapWidth = 0 ); + void AddFixedText( + const TranslatableString & Str, bool bCenter = false, int wrapWidth = 0 ); void AddConstTextBox( const TranslatableString &Caption, const TranslatableString & Value ); diff --git a/src/effects/Contrast.cpp b/src/effects/Contrast.cpp index 195520d74..52c7031c7 100644 --- a/src/effects/Contrast.cpp +++ b/src/effects/Contrast.cpp @@ -235,13 +235,13 @@ ContrastDialog::ContrastDialog(wxWindow * parent, wxWindowID id, // Headings S.AddFixedText( {} ); // spacer - S.AddFixedText(_("Start")); - S.AddFixedText(_("End")); + S.AddFixedText(XO("Start")); + S.AddFixedText(XO("End")); S.AddFixedText( {} ); // spacer - S.AddFixedText(_("Volume ")); + S.AddFixedText(XO("Volume ")); //Foreground - S.AddFixedText(_("&Foreground:"), false); + S.AddFixedText(XO("&Foreground:"), false); if (S.GetMode() == eIsCreating) { mForegroundStartT = safenew @@ -275,7 +275,7 @@ ContrastDialog::ContrastDialog(wxWindow * parent, wxWindowID id, .AddTextBox( {}, wxT(""), 17); //Background - S.AddFixedText(_("&Background:")); + S.AddFixedText(XO("&Background:")); if (S.GetMode() == eIsCreating) { mBackgroundStartT = safenew @@ -318,7 +318,7 @@ ContrastDialog::ContrastDialog(wxWindow * parent, wxWindowID id, S.StartMultiColumn(3, wxCENTER); { auto label = XO("Co&ntrast Result:"); - S.AddFixedText(label.Translation()); + S.AddFixedText(label); mPassFailText = S.Id(ID_RESULTS_TEXT) .Name(label) .ConnectRoot(wxEVT_KEY_DOWN, @@ -327,7 +327,7 @@ ContrastDialog::ContrastDialog(wxWindow * parent, wxWindowID id, m_pButton_Reset = S.Id(ID_BUTTON_RESET).AddButton(XO("R&eset")); label = XO("&Difference:"); - S.AddFixedText(label.Translation()); + S.AddFixedText(label); mDiffText = S.Id(ID_RESULTSDB_TEXT) .Name(label) .ConnectRoot(wxEVT_KEY_DOWN, @@ -344,7 +344,7 @@ ContrastDialog::ContrastDialog(wxWindow * parent, wxWindowID id, { S.SetStretchyCol(1); m_pButton_GetURL = S.Id(ID_BUTTON_GETURL).AddButton(XO("&Help")); - S.AddFixedText(wxT(" ")); // spacer + S.AddFixedText({}); // spacer m_pButton_Close = S.Id(ID_BUTTON_CLOSE).AddButton(XO("&Close")); } S.EndMultiColumn(); diff --git a/src/effects/DtmfGen.cpp b/src/effects/DtmfGen.cpp index 053dc59e6..f8c7c4ff8 100644 --- a/src/effects/DtmfGen.cpp +++ b/src/effects/DtmfGen.cpp @@ -352,7 +352,7 @@ void EffectDtmf::PopulateOrExchange(ShuttleGui & S) S.Name(XO("Duration")) .AddWindow(mDtmfDurationT); - S.AddFixedText(_("Tone/silence ratio:"), false); + S.AddFixedText(XO("Tone/silence ratio:"), false); mDtmfDutyCycleS = S.Id(ID_DutyCycle) .Style(wxSL_HORIZONTAL | wxEXPAND) .MinSize( { -1, -1 } ) @@ -365,16 +365,16 @@ void EffectDtmf::PopulateOrExchange(ShuttleGui & S) S.StartMultiColumn(2, wxCENTER); { - S.AddFixedText(_("Duty cycle:"), false); + S.AddFixedText(XO("Duty cycle:"), false); mDtmfDutyT = S.AddVariableText(XO("%.1f %%").Format( dtmfDutyCycle ), false); - S.AddFixedText(_("Tone duration:"), false); + S.AddFixedText(XO("Tone duration:"), false); mDtmfSilenceT = /* i18n-hint milliseconds */ S.AddVariableText(XO("%.0f ms").Format( dtmfTone * 1000.0 ), false); - S.AddFixedText(_("Silence duration:"), false); + S.AddFixedText(XO("Silence duration:"), false); mDtmfToneT = /* i18n-hint milliseconds */ S.AddVariableText(XO("%0.f ms").Format( dtmfSilence * 1000.0 ), false); diff --git a/src/effects/nyquist/Nyquist.cpp b/src/effects/nyquist/Nyquist.cpp index ddd1748e2..a917fd314 100644 --- a/src/effects/nyquist/Nyquist.cpp +++ b/src/effects/nyquist/Nyquist.cpp @@ -2651,7 +2651,7 @@ void NyquistEffect::BuildEffectWindow(ShuttleGui & S) S.StartHorizontalLay(wxALIGN_LEFT, 0); { S.AddSpace(0, 10); - S.AddFixedText( ctrl.label, false ); + S.AddFixedText( Verbatim( ctrl.label ), false ); } S.EndHorizontalLay(); S.StartMultiColumn(4); diff --git a/src/export/ExportFFmpegDialogs.cpp b/src/export/ExportFFmpegDialogs.cpp index f3d614c62..f7d0e2588 100644 --- a/src/export/ExportFFmpegDialogs.cpp +++ b/src/export/ExportFFmpegDialogs.cpp @@ -1553,10 +1553,10 @@ void ExportFFmpegOptions::PopulateOrExchange(ShuttleGui & S) { S.SetStretchyCol(1); S.SetStretchyCol(3); - S.Id(FEFormatLabelID).AddFixedText(_("Format:")); + S.Id(FEFormatLabelID).AddFixedText(XO("Format:")); mFormatName = S.Id(FEFormatNameID).AddVariableText( {} ); /* i18n-hint: "codec" is short for a "coder-decoder" algorithm */ - S.Id(FECodecLabelID).AddFixedText(_("Codec:")); + S.Id(FECodecLabelID).AddFixedText(XO("Codec:")); mCodecName = S.Id(FECodecNameID).AddVariableText( {} ); } S.EndMultiColumn(); diff --git a/src/menus/HelpMenus.cpp b/src/menus/HelpMenus.cpp index ba5098f24..77ef9079e 100644 --- a/src/menus/HelpMenus.cpp +++ b/src/menus/HelpMenus.cpp @@ -91,7 +91,8 @@ public: QuickFixDialog(wxWindow * pParent); void Populate(); void PopulateOrExchange(ShuttleGui & S); - void AddStuck( ShuttleGui & S, bool & bBool, wxString Pref, wxString Prompt, wxString Help ); + void AddStuck( ShuttleGui & S, bool & bBool, wxString Pref, + const TranslatableString &Prompt, wxString Help ); void OnOk(wxCommandEvent &event); void OnCancel(wxCommandEvent &event); @@ -145,7 +146,9 @@ QuickFixDialog::QuickFixDialog(wxWindow * pParent) : Center(); } -void QuickFixDialog::AddStuck( ShuttleGui & S, bool & bBool, wxString Pref, wxString Prompt, wxString Help ) +void QuickFixDialog::AddStuck( + ShuttleGui & S, bool & bBool, wxString Pref, + const TranslatableString &Prompt, wxString Help ) { mItem++; if( !bBool) @@ -176,7 +179,7 @@ void QuickFixDialog::PopulateOrExchange(ShuttleGui & S) if( !bStuckInMode ){ SetLabel(XO("Nothing to do")); - S.AddFixedText(_("No quick, easily fixed problems were found")); + S.AddFixedText(XO("No quick, easily fixed problems were found")); } else { S.StartMultiColumn(3, wxALIGN_CENTER); @@ -185,9 +188,13 @@ void QuickFixDialog::PopulateOrExchange(ShuttleGui & S) // Use # in the URLs to ensure we go to the online version of help. // Local help may well not be installed. - AddStuck( S, mbSyncLocked, "/GUI/SyncLockTracks", _("Clocks on the Tracks"), "Quick_Fix#sync_lock" ); - AddStuck( S, mbInSnapTo, "/SnapTo", _("Can't select precisely"), "Quick_Fix#snap_to" ); - AddStuck( S, mbSoundActivated, "/AudioIO/SoundActivatedRecord", _("Recording stops and starts"), "Quick_Fix#sound_activated_recording" ); + AddStuck( S, mbSyncLocked, "/GUI/SyncLockTracks", + XO("Clocks on the Tracks"), "Quick_Fix#sync_lock" ); + AddStuck( S, mbInSnapTo, "/SnapTo", + XO("Can't select precisely"), "Quick_Fix#snap_to" ); + AddStuck( S, mbSoundActivated, "/AudioIO/SoundActivatedRecord", + XO("Recording stops and starts"), + "Quick_Fix#sound_activated_recording" ); } S.EndMultiColumn(); } diff --git a/src/prefs/DevicePrefs.cpp b/src/prefs/DevicePrefs.cpp index 7e5f56532..72b3e7f5e 100644 --- a/src/prefs/DevicePrefs.cpp +++ b/src/prefs/DevicePrefs.cpp @@ -142,7 +142,7 @@ void DevicePrefs::PopulateOrExchange(ShuttleGui & S) ); S.AddPrompt(_("Using:")); - S.AddFixedText(wxString(wxSafeConvertMB2WX(Pa_GetVersionText()))); + S.AddFixedText( Verbatim(wxSafeConvertMB2WX(Pa_GetVersionText() ) ) ); } S.EndMultiColumn(); } diff --git a/src/prefs/DirectoriesPrefs.cpp b/src/prefs/DirectoriesPrefs.cpp index 72d69ac9b..d37c2ac12 100644 --- a/src/prefs/DirectoriesPrefs.cpp +++ b/src/prefs/DirectoriesPrefs.cpp @@ -111,7 +111,7 @@ void DirectoriesPrefs::PopulateOrExchange(ShuttleGui & S) S.EndMultiColumn(); S.StartHorizontalLay(wxEXPAND); { - S.Prop(0).AddFixedText(_("Free Space:")); + S.Prop(0).AddFixedText(XO("Free Space:")); mFreeSpace = S.Prop(0).AddVariableText( {} ); S.Prop(10).AddSpace( 10 ); S.Id(ChooseButtonID).Prop(0).AddButton(XO("C&hoose...")); diff --git a/src/prefs/KeyConfigPrefs.cpp b/src/prefs/KeyConfigPrefs.cpp index a36eb43f1..5bdf8a33d 100644 --- a/src/prefs/KeyConfigPrefs.cpp +++ b/src/prefs/KeyConfigPrefs.cpp @@ -286,7 +286,7 @@ void KeyConfigPrefs::PopulateOrExchange(ShuttleGui & S) S.EndThreeColumn(); #if defined(__WXMAC__) - S.AddFixedText(_("Note: Pressing Cmd+Q will quit. All other keys are valid.")); + S.AddFixedText(XO("Note: Pressing Cmd+Q will quit. All other keys are valid.")); #endif S.StartThreeColumn(); diff --git a/src/prefs/ModulePrefs.cpp b/src/prefs/ModulePrefs.cpp index b043f413a..d7a957e95 100644 --- a/src/prefs/ModulePrefs.cpp +++ b/src/prefs/ModulePrefs.cpp @@ -114,11 +114,19 @@ void ModulePrefs::PopulateOrExchange(ShuttleGui & S) S.StartStatic( {} ); { - S.AddFixedText(_("These are experimental modules. Enable them only if you've read the Audacity Manual\nand know what you are doing.") ); - S.AddFixedText(wxString(wxT(" ")) + _("'Ask' means Audacity will ask if you want to load the module each time it starts.") ); - S.AddFixedText(wxString(wxT(" ")) + _("'Failed' means Audacity thinks the module is broken and won't run it.") ); - S.AddFixedText(wxString(wxT(" ")) + _("'New' means no choice has been made yet.") ); - S.AddFixedText(_("Changes to these settings only take effect when Audacity starts up.")); + S.AddFixedText(XO( +"These are experimental modules. Enable them only if you've read the Audacity Manual\nand know what you are doing.") ); + S.AddFixedText(XO( +/* i18n-hint preserve the leading spaces */ +" 'Ask' means Audacity will ask if you want to load the module each time it starts.") ); + S.AddFixedText(XO( +/* i18n-hint preserve the leading spaces */ +" 'Failed' means Audacity thinks the module is broken and won't run it.") ); + S.AddFixedText(XO( +/* i18n-hint preserve the leading spaces */ +" 'New' means no choice has been made yet.") ); + S.AddFixedText(XO( +"Changes to these settings only take effect when Audacity starts up.")); { S.StartMultiColumn( 2 ); int i; @@ -137,7 +145,7 @@ void ModulePrefs::PopulateOrExchange(ShuttleGui & S) } if( mModules.size() < 1 ) { - S.AddFixedText( _("No modules were found") ); + S.AddFixedText( XO("No modules were found") ); } } S.EndStatic(); diff --git a/src/prefs/RecordingPrefs.cpp b/src/prefs/RecordingPrefs.cpp index cdaec78b5..07fabb03a 100644 --- a/src/prefs/RecordingPrefs.cpp +++ b/src/prefs/RecordingPrefs.cpp @@ -143,6 +143,7 @@ void RecordingPrefs::PopulateOrExchange(ShuttleGui & S) } S.EndStatic(); + /* i18n-hint: start of two-part phrase, "Name newly recorded tracks with:" */ S.StartStatic(XO("Name newly recorded tracks")); { // Nested multicolumns to indent by 'With:' width, in a way that works if @@ -150,7 +151,8 @@ void RecordingPrefs::PopulateOrExchange(ShuttleGui & S) // This extra step is worth doing to get the check boxes lined up nicely. S.StartMultiColumn( 2 ); { - S.AddFixedText(_("With:")) ; + /* i18n-hint: end of two-part phrase, "Name newly recorded tracks with:" */ + S.AddFixedText(XO("With:")) ; S.StartMultiColumn(3); { S.Id(UseCustomTrackNameID).TieCheckBox(_("Custom Track &Name"), @@ -165,6 +167,7 @@ void RecordingPrefs::PopulateOrExchange(ShuttleGui & S) _("Recorded_Audio")}, 30); } + S.EndMultiColumn(); S.AddFixedText( {} ); diff --git a/src/prefs/ThemePrefs.cpp b/src/prefs/ThemePrefs.cpp index 229e93a15..396e43f3c 100644 --- a/src/prefs/ThemePrefs.cpp +++ b/src/prefs/ThemePrefs.cpp @@ -110,17 +110,20 @@ void ThemePrefs::PopulateOrExchange(ShuttleGui & S) S.StartStatic(XO("Info")); { S.AddFixedText( - _("Themability is an experimental feature.\n\nTo try it out, click \"Save Theme Cache\" then find and modify the images and colors in\nImageCacheVxx.png using an image editor such as the Gimp.\n\nClick \"Load Theme Cache\" to load the changed images and colors back into Audacity.\n\n(Only the Transport Toolbar and the colors on the wavetrack are currently affected, even\nthough the image file shows other icons too.)") + XO( +"Themability is an experimental feature.\n\nTo try it out, click \"Save Theme Cache\" then find and modify the images and colors in\nImageCacheVxx.png using an image editor such as the Gimp.\n\nClick \"Load Theme Cache\" to load the changed images and colors back into Audacity.\n\n(Only the Transport Toolbar and the colors on the wavetrack are currently affected, even\nthough the image file shows other icons too.)") ); #ifdef __WXDEBUG__ S.AddFixedText( - _("This is a debug version of Audacity, with an extra button, 'Output Sourcery'. This will save a\nC version of the image cache that can be compiled in as a default.") + Verbatim( +"This is a debug version of Audacity, with an extra button, 'Output Sourcery'. This will save a\nC version of the image cache that can be compiled in as a default.") ); #endif S.AddFixedText( - _("Saving and loading individual theme files uses a separate file for each image, but is\notherwise the same idea.") + XO( +"Saving and loading individual theme files uses a separate file for each image, but is\notherwise the same idea.") ); } S.EndStatic(); diff --git a/src/widgets/ErrorDialog.cpp b/src/widgets/ErrorDialog.cpp index 874fabad1..a1714ea6c 100644 --- a/src/widgets/ErrorDialog.cpp +++ b/src/widgets/ErrorDialog.cpp @@ -63,7 +63,7 @@ ErrorDialog::ErrorDialog( S.StartVerticalLay(); { S.SetBorder( 20 ); - S.AddFixedText( message.Translation() ); + S.AddFixedText( message ); S.SetBorder( 2 ); S.AddStandardButtons( buttonMask ); } diff --git a/src/widgets/Meter.cpp b/src/widgets/Meter.cpp index c4e3e96ad..ea62f7ebb 100644 --- a/src/widgets/Meter.cpp +++ b/src/widgets/Meter.cpp @@ -2002,7 +2002,8 @@ void MeterPanel::OnPreferences(wxCommandEvent & WXUNUSED(event)) { S.StartStatic(XO("Refresh Rate"), 0); { - S.AddFixedText(_("Higher refresh rates make the meter show more frequent\nchanges. A rate of 30 per second or less should prevent\nthe meter affecting audio quality on slower machines.")); + S.AddFixedText(XO( +"Higher refresh rates make the meter show more frequent\nchanges. A rate of 30 per second or less should prevent\nthe meter affecting audio quality on slower machines.")); S.StartHorizontalLay(); { rate = S.Name(XO("Meter refresh rate per second [1-100]")) diff --git a/src/widgets/Warning.cpp b/src/widgets/Warning.cpp index 89d436bc8..38817a0ba 100644 --- a/src/widgets/Warning.cpp +++ b/src/widgets/Warning.cpp @@ -72,7 +72,7 @@ WarningDialog::WarningDialog(wxWindow *parent, const TranslatableString &message S.SetBorder(10); S.StartVerticalLay(false); { - S.AddFixedText(message.Translation()); + S.AddFixedText(message); mCheckBox = S.AddCheckBox(footer.Translation(), false); } S.EndVerticalLay();