Skip to content

Commit 65b6d5a

Browse files
committed
i18n of names of FFT window functions (transliterations, maybe)...
... and fix format string in FreqWindow.cpp that wasn't really translated
1 parent 86e9288 commit 65b6d5a

File tree

4 files changed

+29
-17
lines changed

4 files changed

+29
-17
lines changed

src/FFT.cpp

+20-11
Original file line numberDiff line numberDiff line change
@@ -332,30 +332,39 @@ int NumWindowFuncs()
332332
return eWinFuncCount;
333333
}
334334

335-
const wxChar *WindowFuncName(int whichFunction)
335+
const TranslatableString WindowFuncName(int whichFunction)
336336
{
337337
switch (whichFunction) {
338338
default:
339339
case eWinFuncRectangular:
340-
return _("Rectangular");
340+
return XO("Rectangular");
341341
case eWinFuncBartlett:
342-
return wxT("Bartlett");
342+
/* i18n-hint a proper name */
343+
return XO("Bartlett");
343344
case eWinFuncHamming:
344-
return wxT("Hamming");
345+
/* i18n-hint a proper name */
346+
return XO("Hamming");
345347
case eWinFuncHanning:
346-
return wxT("Hann");
348+
/* i18n-hint a proper name */
349+
return XO("Hann");
347350
case eWinFuncBlackman:
348-
return wxT("Blackman");
351+
/* i18n-hint a proper name */
352+
return XO("Blackman");
349353
case eWinFuncBlackmanHarris:
350-
return wxT("Blackman-Harris");
354+
/* i18n-hint two proper names */
355+
return XO("Blackman-Harris");
351356
case eWinFuncWelch:
352-
return wxT("Welch");
357+
/* i18n-hint a proper name */
358+
return XO("Welch");
353359
case eWinFuncGaussian25:
354-
return wxT("Gaussian(a=2.5)");
360+
/* i18n-hint a mathematical function named for C. F. Gauss */
361+
return XO("Gaussian(a=2.5)");
355362
case eWinFuncGaussian35:
356-
return wxT("Gaussian(a=3.5)");
363+
/* i18n-hint a mathematical function named for C. F. Gauss */
364+
return XO("Gaussian(a=3.5)");
357365
case eWinFuncGaussian45:
358-
return wxT("Gaussian(a=4.5)");
366+
/* i18n-hint a mathematical function named for C. F. Gauss */
367+
return XO("Gaussian(a=4.5)");
359368
}
360369
}
361370

src/FFT.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434

3535
#include <wx/defs.h>
3636

37+
class TranslatableString;
38+
3739
/*
3840
Salvo Ventura - November 2006
3941
Added more window functions:
@@ -138,7 +140,7 @@ void DerivativeOfWindowFunc(int whichFunction, size_t NumSamples, bool extraSamp
138140
* Returns the name of the windowing function (for UI display)
139141
*/
140142

141-
const wxChar *WindowFuncName(int whichFunction);
143+
const TranslatableString WindowFuncName(int whichFunction);
142144

143145
/*
144146
* Returns the number of windowing functions supported

src/FreqWindow.cpp

+5-4
Original file line numberDiff line numberDiff line change
@@ -241,10 +241,11 @@ FrequencyPlotDialog::FrequencyPlotDialog(wxWindow * parent, wxWindowID id,
241241
wxArrayStringEx funcChoices;
242242
for (int i = 0, cnt = NumWindowFuncs(); i < cnt; i++)
243243
{
244-
/* i18n-hint: This refers to a "window function",
245-
* such as Hann or Rectangular, used in the
246-
* Frequency analyze dialog box. */
247-
funcChoices.push_back(wxString::Format("%s window", WindowFuncName(i) ) );
244+
funcChoices.push_back(
245+
/* i18n-hint: This refers to a "window function",
246+
* such as Hann or Rectangular, used in the
247+
* Frequency analyze dialog box. */
248+
XO("%s window").Format( WindowFuncName(i) ).Translation() );
248249
}
249250

250251
wxArrayStringEx axisChoices{

src/prefs/SpectrumPrefs.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ void SpectrumPrefs::Populate(size_t windowSize)
112112
PopulatePaddingChoices(windowSize);
113113

114114
for (int i = 0; i < NumWindowFuncs(); i++) {
115-
mTypeChoices.push_back(WindowFuncName(i));
115+
mTypeChoices.push_back( WindowFuncName(i).Translation() );
116116
}
117117

118118
//------------------------- Main section --------------------

0 commit comments

Comments
 (0)