1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-28 06:08:40 +02:00

Supply some missing translation in Macros dialogs...

... The "Set" prompt for checkboxes;

Strings in Choice controls, which had been declared translatable with XO, but
the translations not yet used.

This can be tested in Ukrainian locale now, for editing parameters of
commands like Select or Drag, but be aware that even uk.po is not up to date
for all recent changes in the Manage Macros dialog itself.
This commit is contained in:
Paul Licameli 2018-03-07 14:48:11 -05:00
parent ffadd64a56
commit bc773e02d3
11 changed files with 31 additions and 25 deletions

@ -167,4 +167,19 @@ private:
#define UTF8CTOWX(X) wxString((X), wxConvUTF8)
#define LAT1CTOWX(X) wxString((X), wxConvISO8859_1)
inline wxArrayString LocalizedStrings(const wxString strings[], size_t nStrings)
{
wxArrayString results;
std::transform( strings, strings + nStrings, std::back_inserter(results),
GetCustomTranslation );
return results;
}
inline wxArrayString LocalizedStrings(const wxArrayString &strings)
{
if (strings.empty())
return {};
return LocalizedStrings( &strings[0], strings.size() );
}
#endif

@ -2077,7 +2077,8 @@ ShuttleGui & ShuttleGui::Id(int id )
}
ShuttleGui & ShuttleGui::Optional( bool &bVar ){
TieCheckBox( "Set", bVar );
/* i18n-hint verb, imperative */
TieCheckBox( _("Set"), bVar );
return *this;
};

@ -61,7 +61,7 @@ bool DragCommand::DefineParams( ShuttleParams & S ){
void DragCommand::PopulateOrExchange(ShuttleGui & S)
{
wxArrayString coords( nCoordTypes, kCoordTypeStrings );
auto coords = LocalizedStrings( kCoordTypeStrings, nCoordTypes );
S.AddSpace(0, 5);

@ -94,8 +94,8 @@ bool GetInfoCommand::DefineParams( ShuttleParams & S ){
void GetInfoCommand::PopulateOrExchange(ShuttleGui & S)
{
wxArrayString types( nTypes, kTypes );
wxArrayString formats( nFormats, kFormats );
auto types = LocalizedStrings( kTypes, nTypes );
auto formats = LocalizedStrings( kFormats, nFormats );
S.AddSpace(0, 5);
S.StartMultiColumn(2, wxALIGN_CENTER);

@ -48,7 +48,7 @@ bool GetTrackInfoCommand::DefineParams( ShuttleParams & S ){
void GetTrackInfoCommand::PopulateOrExchange(ShuttleGui & S)
{
wxArrayString types( nTypes, kTypes );
auto types = LocalizedStrings( kTypes, nTypes );
S.AddSpace(0, 5);
S.StartMultiColumn(2, wxALIGN_CENTER);

@ -148,8 +148,8 @@ bool ScreenshotCommand::DefineParams( ShuttleParams & S ){
void ScreenshotCommand::PopulateOrExchange(ShuttleGui & S)
{
wxArrayString whats(nCaptureWhats, kCaptureWhatStrings);
wxArrayString backs(nBackgrounds, kBackgroundStrings);
auto whats = LocalizedStrings(kCaptureWhatStrings, nCaptureWhats);
auto backs = LocalizedStrings(kBackgroundStrings, nBackgrounds);
S.AddSpace(0, 5);
S.StartMultiColumn(2, wxALIGN_CENTER);

@ -107,6 +107,7 @@ bool SelectFrequenciesCommand::Apply(const CommandContext & context){
const int nModes =3;
static const wxString kModes[nModes] =
{
/* i18n-hint verb, imperative */
XO("Set"),
XO("Add"),
XO("Remove")
@ -123,7 +124,7 @@ bool SelectTracksCommand::DefineParams( ShuttleParams & S ){
void SelectTracksCommand::PopulateOrExchange(ShuttleGui & S)
{
wxArrayString modes( nModes, kModes );
auto modes = LocalizedStrings( kModes, nModes );
S.AddSpace(0, 5);
S.StartMultiColumn(3, wxALIGN_CENTER);

@ -61,7 +61,7 @@ bool SetClipCommand::DefineParams( ShuttleParams & S ){
void SetClipCommand::PopulateOrExchange(ShuttleGui & S)
{
wxArrayString colours( nColours, kColourStrings );
auto colours = LocalizedStrings( kColourStrings, nColours );
S.AddSpace(0, 5);

@ -123,10 +123,10 @@ bool SetTrackCommand::DefineParams( ShuttleParams & S ){
void SetTrackCommand::PopulateOrExchange(ShuttleGui & S)
{
wxArrayString colours( nColours, kColourStrings );
wxArrayString displays( nDisplayTypes, kDisplayTypeStrings );
wxArrayString scales( nScaleTypes, kScaleTypeStrings );
wxArrayString vzooms( nZoomTypes, kZoomTypeStrings );
auto colours = LocalizedStrings( kColourStrings, nColours );
auto displays = LocalizedStrings( kDisplayTypeStrings, nDisplayTypes );
auto scales = LocalizedStrings( kScaleTypeStrings, nScaleTypes );
auto vzooms = LocalizedStrings( kZoomTypeStrings, nZoomTypes );
S.AddSpace(0, 5);

@ -94,15 +94,6 @@ enum
static const wxChar *KEY_Version = wxT("Version");
static const wxChar *KEY_Command = wxT("Command");
wxArrayString NyqControl::GetTranslatedChoices() const
{
wxArrayString results;
std::transform(
choices.begin(), choices.end(), std::back_inserter(results),
GetCustomTranslation);
return results;
}
///////////////////////////////////////////////////////////////////////////////
//
// NyquistEffect
@ -2405,7 +2396,7 @@ void NyquistEffect::BuildEffectWindow(ShuttleGui & S)
{
S.AddSpace(10, 10);
const wxArrayString &choices = ctrl.GetTranslatedChoices();
auto choices = LocalizedStrings(ctrl.choices);
S.Id(ID_Choice + i).AddChoice( {}, wxT(""), &choices);
}
else

@ -53,8 +53,6 @@ public:
//NyqControl( NyqControl && ) = default;
//NyqControl &operator = ( NyqControl && ) = default;
wxArrayString GetTranslatedChoices() const;
int type;
wxString var;
wxString name;