1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-09-17 16:50:26 +02:00

i18n of names of FFT window functions (transliterations, maybe)...

... and fix format string in FreqWindow.cpp that wasn't really translated
This commit is contained in:
Paul Licameli 2019-12-21 12:04:02 -05:00
parent 86e9288bbd
commit 65b6d5aad5
4 changed files with 29 additions and 17 deletions

View File

@ -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)");
}
}

View File

@ -34,6 +34,8 @@
#include <wx/defs.h>
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

View File

@ -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{

View File

@ -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 --------------------