mirror of
https://github.com/cookiengineer/audacity
synced 2025-08-01 08:29:27 +02:00
Bug1661: Default audio track name not being translated...
... Problem was introduced in 2.1.3 at: 8a6edf3623662b6cb3eb90e794c34e44c283c33d
This commit is contained in:
parent
a9d8da62af
commit
1ef235c21c
@ -53,6 +53,7 @@ Track classes.
|
||||
|
||||
#include "effects/TimeWarper.h"
|
||||
#include "prefs/SpectrumPrefs.h"
|
||||
#include "prefs/TracksPrefs.h"
|
||||
#include "prefs/WaveformPrefs.h"
|
||||
|
||||
#include "InconsistencyException.h"
|
||||
@ -107,7 +108,7 @@ WaveTrack::WaveTrack(const std::shared_ptr<DirManager> &projDirManager, sampleFo
|
||||
mRate = (int) rate;
|
||||
mGain = 1.0;
|
||||
mPan = 0.0;
|
||||
SetDefaultName(gPrefs->Read(wxT("/GUI/TrackNames/DefaultTrackName"), _("Audio Track")));
|
||||
SetDefaultName(TracksPrefs::GetDefaultAudioTrackNamePreference());
|
||||
SetName(GetDefaultName());
|
||||
mDisplayMin = -1.0;
|
||||
mDisplayMax = 1.0;
|
||||
|
@ -158,6 +158,18 @@ void TracksPrefs::SetPinnedHeadPreference(bool value, bool flush)
|
||||
gPrefs->Flush();
|
||||
}
|
||||
|
||||
wxString TracksPrefs::GetDefaultAudioTrackNamePreference()
|
||||
{
|
||||
const auto name =
|
||||
gPrefs->Read(wxT("/GUI/TrackNames/DefaultTrackName"), _(""));
|
||||
if (name.empty())
|
||||
// When nothing was specified,
|
||||
// the default-default is whatever translation of...
|
||||
return _("Audio Track");
|
||||
else
|
||||
return name;
|
||||
}
|
||||
|
||||
bool TracksPrefs::Commit()
|
||||
{
|
||||
// Bug 1583: Clear the caching of the preference pinned state.
|
||||
@ -165,6 +177,12 @@ bool TracksPrefs::Commit()
|
||||
ShuttleGui S(this, eIsSavingToPrefs);
|
||||
PopulateOrExchange(S);
|
||||
|
||||
if (gPrefs->Read(wxT("/GUI/TrackNames/DefaultTrackName"),
|
||||
_("Audio Track")) == _("Audio Track")) {
|
||||
gPrefs->DeleteEntry(wxT("/GUI/TrackNames/DefaultTrackName"));
|
||||
gPrefs->Flush();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -33,6 +33,8 @@ class TracksPrefs final : public PrefsPanel
|
||||
static bool GetPinnedHeadPreference();
|
||||
static void SetPinnedHeadPreference(bool value, bool flush = false);
|
||||
|
||||
static wxString GetDefaultAudioTrackNamePreference();
|
||||
|
||||
private:
|
||||
void Populate();
|
||||
void PopulateOrExchange(ShuttleGui & S);
|
||||
|
@ -1109,7 +1109,7 @@ void ControlToolBar::OnRecord(wxCommandEvent &evt)
|
||||
gPrefs->Read(wxT("/GUI/TrackNames/DateStamp"), &useDateStamp, false);
|
||||
gPrefs->Read(wxT("/GUI/TrackNames/TimeStamp"), &useTimeStamp, false);
|
||||
/* i18n-hint: The default name for an audio track. */
|
||||
gPrefs->Read(wxT("/GUI/TrackNames/DefaultTrackName"),&defaultTrackName, _("Audio Track"));
|
||||
defaultTrackName = TracksPrefs::GetDefaultAudioTrackNamePreference();
|
||||
gPrefs->Read(wxT("/GUI/TrackNames/RecodingTrackName"), &defaultRecordingTrackName, defaultTrackName);
|
||||
|
||||
wxString baseTrackName = recordingNameCustom? defaultRecordingTrackName : defaultTrackName;
|
||||
|
Loading…
x
Reference in New Issue
Block a user