diff --git a/src/BatchCommandDialog.cpp b/src/BatchCommandDialog.cpp index b8dd0a3c4..ba3c5ca7a 100644 --- a/src/BatchCommandDialog.cpp +++ b/src/BatchCommandDialog.cpp @@ -207,7 +207,8 @@ void MacroCommandDialog::OnItemSelected(wxListEvent &event) // Later we can put help information there, perhaps. // Macro command details are one place that we do expose Identifier // to (more sophisticated) users - mDetails->SetValue( mInternalCommandName.GET() + "\r\n" + command.category ); + mDetails->SetValue( + mInternalCommandName.GET() + "\r\n" + command.category.Translation() ); mParameters->SetValue(params); } @@ -249,7 +250,8 @@ void MacroCommandDialog::SetCommandAndParams(const CommandID &Command, const wxS // using GET to expose a CommandID to the user! // Macro command details are one place that we do expose Identifier // to (more sophisticated) users - mDetails->SetValue( iter->name.Internal() + "\r\n" + iter->category ); + mDetails->SetValue( + iter->name.Internal() + "\r\n" + iter->category.Translation() ); mChoices->SetItemState(iter - mCatalog.begin(), wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED); diff --git a/src/BatchCommands.cpp b/src/BatchCommands.cpp index 92a0ca3b7..3db649396 100644 --- a/src/BatchCommands.cpp +++ b/src/BatchCommands.cpp @@ -295,7 +295,7 @@ MacroCommandsCatalog::MacroCommandsCatalog( const AudacityProject *project ) for( const auto &command : SpecialCommands ) commands.push_back( { { command.second, command.first }, - _("Special Command") + XO("Special Command") } ); // end CLEANSPEECH remnant @@ -311,7 +311,7 @@ MacroCommandsCatalog::MacroCommandsCatalog( const AudacityProject *project ) commands.push_back( { { command, plug->GetSymbol().Msgid() }, plug->GetPluginType() == PluginTypeEffect ? - _("Effect") : _("Menu Command (With Parameters)") + XO("Effect") : XO("Menu Command (With Parameters)") } ); plug = pm.GetNextPlugin(PluginTypeEffect|PluginTypeAudacityCommand); } @@ -367,7 +367,7 @@ MacroCommandsCatalog::MacroCommandsCatalog( const AudacityProject *project ) mNames[i], // Internal name. label // User readable name }, - _("Menu Command (No Parameters)") + XO("Menu Command (No Parameters)") } ); } diff --git a/src/BatchCommands.h b/src/BatchCommands.h index 7d922c279..40d7352ef 100644 --- a/src/BatchCommands.h +++ b/src/BatchCommands.h @@ -30,7 +30,7 @@ public: // A triple of user-visible name, internal string identifier and type/help string. struct Entry { ComponentInterfaceSymbol name; - wxString category; + TranslatableString category; }; using Entries = std::vector; diff --git a/src/BatchProcessDialog.cpp b/src/BatchProcessDialog.cpp index d94085b81..a54f7d348 100644 --- a/src/BatchProcessDialog.cpp +++ b/src/BatchProcessDialog.cpp @@ -965,8 +965,8 @@ void MacrosWindow::OnAdd(wxCommandEvent & WXUNUSED(event)) { while (true) { AudacityTextEntryDialog d(this, - _("Enter name of new macro"), - _("Name of new macro")); + XO("Enter name of new macro"), + XO("Name of new macro")); d.SetName(d.GetTitle()); wxString name; diff --git a/src/CrashReport.cpp b/src/CrashReport.cpp index f6294ff1f..7809957b3 100644 --- a/src/CrashReport.cpp +++ b/src/CrashReport.cpp @@ -59,11 +59,11 @@ void Generate(wxDebugReport::Context ctx) if (ok && rpt.Process()) { - AudacityTextEntryDialog dlg(NULL, - _("Report generated to:"), - _("Audacity Support Data"), - rpt.GetCompressedFileName(), - wxOK | wxCENTER); + AudacityTextEntryDialog dlg(nullptr, + XO("Report generated to:"), + XO("Audacity Support Data"), + rpt.GetCompressedFileName(), + wxOK | wxCENTER); dlg.SetName(dlg.GetTitle()); dlg.ShowModal(); diff --git a/src/FFT.cpp b/src/FFT.cpp index 6441e31c4..984bc9c40 100644 --- a/src/FFT.cpp +++ b/src/FFT.cpp @@ -332,30 +332,39 @@ int NumWindowFuncs() return eWinFuncCount; } -const wxChar *WindowFuncName(int whichFunction) +const TranslatableString WindowFuncName(int whichFunction) { switch (whichFunction) { default: case eWinFuncRectangular: - return _("Rectangular"); + return XO("Rectangular"); case eWinFuncBartlett: - return wxT("Bartlett"); + /* i18n-hint a proper name */ + return XO("Bartlett"); case eWinFuncHamming: - return wxT("Hamming"); + /* i18n-hint a proper name */ + return XO("Hamming"); case eWinFuncHanning: - return wxT("Hann"); + /* i18n-hint a proper name */ + return XO("Hann"); case eWinFuncBlackman: - return wxT("Blackman"); + /* i18n-hint a proper name */ + return XO("Blackman"); case eWinFuncBlackmanHarris: - return wxT("Blackman-Harris"); + /* i18n-hint two proper names */ + return XO("Blackman-Harris"); case eWinFuncWelch: - return wxT("Welch"); + /* i18n-hint a proper name */ + return XO("Welch"); case eWinFuncGaussian25: - return wxT("Gaussian(a=2.5)"); + /* i18n-hint a mathematical function named for C. F. Gauss */ + return XO("Gaussian(a=2.5)"); case eWinFuncGaussian35: - return wxT("Gaussian(a=3.5)"); + /* i18n-hint a mathematical function named for C. F. Gauss */ + return XO("Gaussian(a=3.5)"); case eWinFuncGaussian45: - return wxT("Gaussian(a=4.5)"); + /* i18n-hint a mathematical function named for C. F. Gauss */ + return XO("Gaussian(a=4.5)"); } } diff --git a/src/FFT.h b/src/FFT.h index 2aba3f8b0..7acc6fa30 100644 --- a/src/FFT.h +++ b/src/FFT.h @@ -34,6 +34,8 @@ #include +class TranslatableString; + /* Salvo Ventura - November 2006 Added more window functions: @@ -138,7 +140,7 @@ void DerivativeOfWindowFunc(int whichFunction, size_t NumSamples, bool extraSamp * Returns the name of the windowing function (for UI display) */ -const wxChar *WindowFuncName(int whichFunction); +const TranslatableString WindowFuncName(int whichFunction); /* * Returns the number of windowing functions supported diff --git a/src/FreqWindow.cpp b/src/FreqWindow.cpp index ff76bed52..c8a0e3970 100644 --- a/src/FreqWindow.cpp +++ b/src/FreqWindow.cpp @@ -241,10 +241,11 @@ FrequencyPlotDialog::FrequencyPlotDialog(wxWindow * parent, wxWindowID id, wxArrayStringEx funcChoices; for (int i = 0, cnt = NumWindowFuncs(); i < cnt; i++) { - /* i18n-hint: This refers to a "window function", - * such as Hann or Rectangular, used in the - * Frequency analyze dialog box. */ - funcChoices.push_back(wxString::Format("%s window", WindowFuncName(i) ) ); + funcChoices.push_back( + /* i18n-hint: This refers to a "window function", + * such as Hann or Rectangular, used in the + * Frequency analyze dialog box. */ + XO("%s window").Format( WindowFuncName(i) ).Translation() ); } wxArrayStringEx axisChoices{ @@ -949,35 +950,32 @@ void FrequencyPlotDialog::PlotPaint(wxPaintEvent & event) value = mAnalyst->GetProcessedValue(xPos, xPos + xStep); } - wxString cursor; - wxString peak; - wxString xpitch; - wxString peakpitch; - const wxChar *xp; - const wxChar *pp; + TranslatableString cursor; + TranslatableString peak; if (mAlg == SpectrumAnalyst::Spectrum) { - xpitch = PitchName_Absolute(FreqToMIDInote(xPos)); - peakpitch = PitchName_Absolute(FreqToMIDInote(bestpeak)); - xp = xpitch; - pp = peakpitch; + auto xp = PitchName_Absolute(FreqToMIDInote(xPos)); + auto pp = PitchName_Absolute(FreqToMIDInote(bestpeak)); /* i18n-hint: The %d's are replaced by numbers, the %s by musical notes, e.g. A#*/ - cursor.Printf(_("%d Hz (%s) = %d dB"), (int)(xPos + 0.5), xp, (int)(value + 0.5)); - peak.Printf(_("%d Hz (%s) = %.1f dB"), (int)(bestpeak + 0.5), pp, bestValue); + cursor = XO("%d Hz (%s) = %d dB") + .Format( (int)(xPos + 0.5), xp, (int)(value + 0.5)); + /* i18n-hint: The %d's are replaced by numbers, the %s by musical notes, e.g. A#*/ + peak = XO("%d Hz (%s) = %.1f dB") + .Format( (int)(bestpeak + 0.5), pp, bestValue ); } else if (xPos > 0.0 && bestpeak > 0.0) { - xpitch = PitchName_Absolute(FreqToMIDInote(1.0 / xPos)); - peakpitch = PitchName_Absolute(FreqToMIDInote(1.0 / bestpeak)); - xp = xpitch; - pp = peakpitch; + auto xp = PitchName_Absolute(FreqToMIDInote(1.0 / xPos)); + auto pp = PitchName_Absolute(FreqToMIDInote(1.0 / bestpeak)); /* i18n-hint: The %d's are replaced by numbers, the %s by musical notes, e.g. A# * the %.4f are numbers, and 'sec' should be an abbreviation for seconds */ - cursor.Printf(_("%.4f sec (%d Hz) (%s) = %f"), - xPos, (int)(1.0 / xPos + 0.5), xp, value); - peak.Printf(_("%.4f sec (%d Hz) (%s) = %.3f"), - bestpeak, (int)(1.0 / bestpeak + 0.5), pp, bestValue); + cursor = XO("%.4f sec (%d Hz) (%s) = %f") + .Format( xPos, (int)(1.0 / xPos + 0.5), xp, value ); + /* i18n-hint: The %d's are replaced by numbers, the %s by musical notes, e.g. A# + * the %.4f are numbers, and 'sec' should be an abbreviation for seconds */ + peak = XO("%.4f sec (%d Hz) (%s) = %.3f") + .Format( bestpeak, (int)(1.0 / bestpeak + 0.5), pp, bestValue ); } - mCursorText->SetValue(cursor); - mPeakText->SetValue(peak); + mCursorText->SetValue( cursor.Translation() ); + mPeakText->SetValue( peak.Translation() ); } else { mCursorText->SetValue(wxT("")); diff --git a/src/LabelDialog.cpp b/src/LabelDialog.cpp index ab2520a70..cb3c94b28 100644 --- a/src/LabelDialog.cpp +++ b/src/LabelDialog.cpp @@ -812,10 +812,10 @@ void LabelDialog::OnChangeTrack(wxGridEvent & WXUNUSED(event), int row, RowData // User selected the "New..." choice so ask for a NEW name if ( make_iterator_range( mTrackNames ).index( val ) == 0 ) { AudacityTextEntryDialog d(this, - _("New Label Track"), - _("Enter track name"), - /* i18n-hint: (noun) it's the name of a kind of track.*/ - _("Label Track")); + XO("New Label Track"), + XO("Enter track name"), + /* i18n-hint: (noun) it's the name of a kind of track.*/ + XO("Label Track").Translation()); // User canceled so repopulating the grid will set the track // name to the orignal value diff --git a/src/PitchName.cpp b/src/PitchName.cpp index 72df476c3..37871a0fc 100644 --- a/src/PitchName.cpp +++ b/src/PitchName.cpp @@ -57,7 +57,7 @@ int PitchOctave(const double dMIDInote) } -wxString PitchName(const double dMIDInote, const PitchNameChoice choice) +TranslatableString PitchName(const double dMIDInote, const PitchNameChoice choice) { static const TranslatableString sharpnames[12] = { /* i18n-hint: Name of a musical note in the 12-tone chromatic scale */ @@ -148,14 +148,14 @@ wxString PitchName(const double dMIDInote, const PitchNameChoice choice) default: wxASSERT(false); break; } - return table[PitchIndex(dMIDInote)].Translation(); + return table[PitchIndex(dMIDInote)]; } -wxString PitchName_Absolute(const double dMIDInote, const PitchNameChoice choice) +TranslatableString PitchName_Absolute(const double dMIDInote, const PitchNameChoice choice) { // The format string is not localized. Should it be? - return wxString::Format( - wxT("%s%d"), PitchName(dMIDInote, choice), PitchOctave(dMIDInote) ); + return Verbatim( wxT("%s%d") ) + .Format( PitchName(dMIDInote, choice), PitchOctave(dMIDInote) ); } double PitchToMIDInote(const unsigned int nPitchIndex, const int nPitchOctave) diff --git a/src/PitchName.h b/src/PitchName.h index 8d97273ea..24ed88de9 100644 --- a/src/PitchName.h +++ b/src/PitchName.h @@ -18,7 +18,7 @@ #ifndef __AUDACITY_PITCHNAME__ #define __AUDACITY_PITCHNAME__ -class wxString; +class TranslatableString; // FreqToMIDInote takes a frequency in Hz (exponential scale relative to // alphabetic pitch names) and returns a pitch ID number (linear @@ -44,14 +44,14 @@ enum class PitchNameChoice { Sharps, Flats, Both }; // PitchName takes dMIDInote (per result from // FreqToMIDInote) and returns a standard pitch/note name [C, C#, etc.). -wxString PitchName( +TranslatableString PitchName( const double dMIDInote, const PitchNameChoice choice = PitchNameChoice::Sharps ); // PitchName_Absolute does the same thing as PitchName, but appends // the octave number, e.g., instead of "C" it will return "C4" // if the dMIDInote corresonds to middle C, i.e., is 60. -wxString PitchName_Absolute( +TranslatableString PitchName_Absolute( const double dMIDInote, const PitchNameChoice choice = PitchNameChoice::Sharps); diff --git a/src/Tags.cpp b/src/Tags.cpp index d67382cee..4fc1fecce 100644 --- a/src/Tags.cpp +++ b/src/Tags.cpp @@ -735,33 +735,15 @@ private: #define LABEL_GENRE XO("Genre") #define LABEL_COMMENTS XO("Comments") -static wxArrayString names() -{ - static TranslatableString theNames[] = - { - LABEL_ARTIST, - LABEL_TITLE, - LABEL_ALBUM, - LABEL_TRACK, - LABEL_YEAR, - LABEL_GENRE, - LABEL_COMMENTS - }; - - class NamesArray final : public TranslatableStringArray - { - void Populate() override - { - for (auto &name : theNames) - mContents.push_back( name.Translation() ); - } - }; - - static NamesArray theArray; - - // Yes, return array by value - return theArray.Get(); -} +static TranslatableStrings names{ + LABEL_ARTIST, + LABEL_TITLE, + LABEL_ALBUM, + LABEL_TRACK, + LABEL_YEAR, + LABEL_GENRE, + LABEL_COMMENTS +}; static const struct { @@ -911,7 +893,8 @@ void TagsEditorDialog::PopulateOrExchange(ShuttleGui & S) mGrid->SetColLabelSize(mGrid->GetDefaultRowSize()); - auto cs = names(); + auto cs = transform_container( + names, std::mem_fn( &TranslatableString::Translation ) ); // Build the initial (empty) grid mGrid->CreateGrid(0, 2); diff --git a/src/TranslatableStringArray.h b/src/TranslatableStringArray.h index 5ba428c4b..97f300b24 100644 --- a/src/TranslatableStringArray.h +++ b/src/TranslatableStringArray.h @@ -63,6 +63,4 @@ protected: ArrayType mContents; }; -typedef TranslatableArray TranslatableStringArray; - #endif diff --git a/src/effects/ChangePitch.cpp b/src/effects/ChangePitch.cpp index 9e25203fb..9bf0e5c6b 100644 --- a/src/effects/ChangePitch.cpp +++ b/src/effects/ChangePitch.cpp @@ -255,7 +255,7 @@ void EffectChangePitch::PopulateOrExchange(ShuttleGui & S) wxArrayStringEx pitch; for (int ii = 0; ii < 12; ++ii) - pitch.push_back( PitchName( ii, PitchNameChoice::Both ) ); + pitch.push_back( PitchName( ii, PitchNameChoice::Both ).Translation() ); S.SetBorder(5); @@ -265,8 +265,9 @@ void EffectChangePitch::PopulateOrExchange(ShuttleGui & S) { S.AddTitle(_("Change Pitch without Changing Tempo")); S.AddTitle( - wxString::Format(_("Estimated Start Pitch: %s%d (%.3f Hz)"), - pitch[m_nFromPitch], m_nFromOctave, m_FromFrequency)); + XO("Estimated Start Pitch: %s%d (%.3f Hz)") + .Format( pitch[m_nFromPitch], m_nFromOctave, m_FromFrequency) + .Translation() ); } S.EndVerticalLay(); diff --git a/src/effects/Equalization.cpp b/src/effects/Equalization.cpp index 8f516790b..d6f9273dd 100644 --- a/src/effects/Equalization.cpp +++ b/src/effects/Equalization.cpp @@ -3516,8 +3516,8 @@ void EditCurvesDialog::OnRename(wxCommandEvent & WXUNUSED(event)) bad = false; // build the dialog AudacityTextEntryDialog dlg( this, - wxString::Format( _("Rename '%s' to..."), mEditCurves[ item ].Name ), - _("Rename...") ); + XO("Rename '%s' to...").Format( mEditCurves[ item ].Name ), + XO("Rename...") ); dlg.SetTextValidator( wxFILTER_EXCLUDE_CHAR_LIST ); dlg.SetName( wxString::Format( _("Rename '%s'"), mEditCurves[ item ].Name ) ); diff --git a/src/export/ExportMultiple.cpp b/src/export/ExportMultiple.cpp index 6c1bd34e5..dc8ae0cc2 100644 --- a/src/export/ExportMultiple.cpp +++ b/src/export/ExportMultiple.cpp @@ -1111,20 +1111,22 @@ wxString ExportMultipleDialog::MakeFileName(const wxString &input) if(changed) { // need to get user to fix file name // build the dialog - wxString msg; + TranslatableString msg; wxString excluded = ::wxJoin( Internat::GetExcludedCharacters(), wxChar(' ') ); // TODO: For Russian langauge we should have separate cases for 2 and more than 2 letters. if( excluded.length() > 1 ){ // i18n-hint: The second %s gives some letters that can't be used. - msg.Printf(_("Label or track \"%s\" is not a legal file name. You cannot use any of: %s\nUse..."), input, - excluded); + msg = XO( +"Label or track \"%s\" is not a legal file name. You cannot use any of: %s\nUse...") + .Format( input, excluded ); } else { // i18n-hint: The second %s gives a letter that can't be used. - msg.Printf(_("Label or track \"%s\" is not a legal file name. You cannot use \"%s\".\nUse..."), input, - excluded); + msg = XO( +"Label or track \"%s\" is not a legal file name. You cannot use \"%s\".\nUse...") + .Format( input, excluded ); } - AudacityTextEntryDialog dlg( this, msg, _("Save As..."), newname ); + AudacityTextEntryDialog dlg( this, msg, XO("Save As..."), newname ); // And tell the validator about excluded chars diff --git a/src/prefs/SpectrogramSettings.cpp b/src/prefs/SpectrogramSettings.cpp index f60b7bdd2..4c690de9a 100644 --- a/src/prefs/SpectrogramSettings.cpp +++ b/src/prefs/SpectrogramSettings.cpp @@ -159,25 +159,17 @@ const TranslatableStrings &SpectrogramSettings::GetScaleNames() } //static -const wxArrayStringEx &SpectrogramSettings::GetAlgorithmNames() +const TranslatableStrings &SpectrogramSettings::GetAlgorithmNames() { - class AlgorithmNamesArray final : public TranslatableStringArray - { - void Populate() override - { - mContents.insert( mContents.end(), { - // Keep in correspondence with enum SpectrogramSettings::Algorithm: - _("Frequencies") , - /* i18n-hint: the Reassignment algorithm for spectrograms */ - _("Reassignment") , - /* i18n-hint: EAC abbreviates "Enhanced Autocorrelation" */ - _("Pitch (EAC)") , - } ); - } + static const TranslatableStrings results{ + // Keep in correspondence with enum SpectrogramSettings::Algorithm: + XO("Frequencies") , + /* i18n-hint: the Reassignment algorithm for spectrograms */ + XO("Reassignment") , + /* i18n-hint: EAC abbreviates "Enhanced Autocorrelation" */ + XO("Pitch (EAC)") , }; - - static AlgorithmNamesArray theArray; - return theArray.Get(); + return results; } bool SpectrogramSettings::Validate(bool quiet) diff --git a/src/prefs/SpectrogramSettings.h b/src/prefs/SpectrogramSettings.h index ef47aaaf6..14c02ae29 100644 --- a/src/prefs/SpectrogramSettings.h +++ b/src/prefs/SpectrogramSettings.h @@ -67,7 +67,7 @@ public: }; static const TranslatableStrings &GetScaleNames(); - static const wxArrayStringEx &GetAlgorithmNames(); + static const TranslatableStrings &GetAlgorithmNames(); static SpectrogramSettings &defaults(); SpectrogramSettings(); diff --git a/src/prefs/SpectrumPrefs.cpp b/src/prefs/SpectrumPrefs.cpp index 7a15e375c..862eeb42b 100644 --- a/src/prefs/SpectrumPrefs.cpp +++ b/src/prefs/SpectrumPrefs.cpp @@ -112,7 +112,7 @@ void SpectrumPrefs::Populate(size_t windowSize) PopulatePaddingChoices(windowSize); for (int i = 0; i < NumWindowFuncs(); i++) { - mTypeChoices.push_back(WindowFuncName(i)); + mTypeChoices.push_back( WindowFuncName(i).Translation() ); } //------------------------- Main section -------------------- @@ -242,7 +242,9 @@ void SpectrumPrefs::PopulateOrExchange(ShuttleGui & S) mAlgorithmChoice = S.Id(ID_ALGORITHM).TieChoice(_("A&lgorithm:"), mTempSettings.algorithm, - SpectrogramSettings::GetAlgorithmNames()); + transform_container( + SpectrogramSettings::GetAlgorithmNames(), + std::mem_fn( &TranslatableString::Translation ) ) ); S.Id(ID_WINDOW_SIZE).TieChoice(_("Window &size:"), mTempSettings.windowSize, diff --git a/src/prefs/WaveformPrefs.cpp b/src/prefs/WaveformPrefs.cpp index c02b6c80e..25284fc7b 100644 --- a/src/prefs/WaveformPrefs.cpp +++ b/src/prefs/WaveformPrefs.cpp @@ -110,7 +110,9 @@ void WaveformPrefs::PopulateOrExchange(ShuttleGui & S) mScaleChoice = S.Id(ID_SCALE).TieChoice(_("S&cale:"), mTempSettings.scaleType, - WaveformSettings::GetScaleNames()); + transform_container( + WaveformSettings::GetScaleNames(), + std::mem_fn( &TranslatableString::Translation ) ) ); mRangeChoice = S.Id(ID_RANGE).TieChoice(_("Waveform dB &range:"), diff --git a/src/prefs/WaveformSettings.cpp b/src/prefs/WaveformSettings.cpp index 217c440fa..52a02030b 100644 --- a/src/prefs/WaveformSettings.cpp +++ b/src/prefs/WaveformSettings.cpp @@ -147,20 +147,14 @@ void WaveformSettings::NextHigherDBRange() } //static -const wxArrayStringEx &WaveformSettings::GetScaleNames() +const TranslatableStrings &WaveformSettings::GetScaleNames() { - class ScaleNamesArray final : public TranslatableStringArray - { - void Populate() override - { - // Keep in correspondence with enum WaveTrack::WaveTrackDisplay: - mContents.push_back(_("Linear")); - mContents.push_back(_("Logarithmic")); - } + static const TranslatableStrings result{ + // Keep in correspondence with enum WaveTrack::WaveTrackDisplay: + XO("Linear"), + XO("Logarithmic"), }; - - static ScaleNamesArray theArray; - return theArray.Get(); + return result; } WaveformSettings::~WaveformSettings() diff --git a/src/prefs/WaveformSettings.h b/src/prefs/WaveformSettings.h index fb09092dc..25591e6d6 100644 --- a/src/prefs/WaveformSettings.h +++ b/src/prefs/WaveformSettings.h @@ -11,7 +11,7 @@ Paul Licameli #ifndef __AUDACITY_WAVEFORM_SETTINGS__ #define __AUDACITY_WAVEFORM_SETTINGS__ -class wxArrayStringEx; +#include "../Internat.h" // for TranslatableStrings class WaveformSettings { @@ -58,7 +58,7 @@ public: stNumScaleTypes, }; - static const wxArrayStringEx &GetScaleNames(); + static const TranslatableStrings &GetScaleNames(); ScaleType scaleType; int dBRange; diff --git a/src/tracks/labeltrack/ui/LabelTrackView.cpp b/src/tracks/labeltrack/ui/LabelTrackView.cpp index a69131eeb..d23fae862 100644 --- a/src/tracks/labeltrack/ui/LabelTrackView.cpp +++ b/src/tracks/labeltrack/ui/LabelTrackView.cpp @@ -2085,8 +2085,8 @@ int LabelTrackView::DialogForLabelName( position = trackPanel.ClientToScreen(position); auto &window = GetProjectFrame( project ); AudacityTextEntryDialog dialog{ &window, - _("Name:"), - _("New label"), + XO("Name:"), + XO("New label"), initialValue, wxOK | wxCANCEL, position }; diff --git a/src/widgets/ErrorDialog.h b/src/widgets/ErrorDialog.h index 6b57cc672..5b7f43ca8 100644 --- a/src/widgets/ErrorDialog.h +++ b/src/widgets/ErrorDialog.h @@ -69,13 +69,14 @@ class AudacityTextEntryDialog : public wxTabTraversalWrapper< wxTextEntryDialog public: AudacityTextEntryDialog( wxWindow *parent, - const wxString& message, - const wxString& caption, // don't use = wxGetTextFromUserPromptStr, + const TranslatableString& message, + const TranslatableString& caption, // don't use = wxGetTextFromUserPromptStr, const wxString& value = {}, long style = wxTextEntryDialogStyle, const wxPoint& pos = wxDefaultPosition) - : wxTabTraversalWrapper< wxTextEntryDialog> - ( parent, message, caption, value, style, pos ) + : wxTabTraversalWrapper< wxTextEntryDialog>( + parent, + message.Translation(), caption.Translation(), value, style, pos ) {} void SetInsertionPointEnd();