1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-16 16:10:06 +02:00

Move definition of _ and related into Internat.h

This commit is contained in:
Paul Licameli 2017-09-25 14:07:23 -04:00
parent e37d701bc0
commit c6696f1b49
52 changed files with 89 additions and 53 deletions

View File

@ -213,52 +213,6 @@ void QuitAudacity();
#define JUST_BELOW_MAX_AUDIO (1.f - 1.f/(1<<14))
#ifndef IN_RC
//#include <wx/defs.h>
//#include <wx/string.h>
class wxString;
extern const wxString& GetCustomTranslation(const wxString& str1 );
extern const wxString& GetCustomSubstitution(const wxString& str1 );
// Marks strings for extraction only...must use wxGetTranslation() to translate.
#define XO(s) wxT(s)
// Marks string for substitution only.
#define _TS( s ) GetCustomSubstitution( s )
//#define WXINTL_NO_GETTEXT_MACRO
#ifdef wxPLURAL
#undef wxPLURAL
#endif
// The two string arugments will go to the .pot file, as
// msgid sing
// msgid_plural plural
//
// (You must use plain string literals. Do not use _() or wxT() or L prefix,
// which (inentionally) will fail to compile. The macro inserts wxT).
//
// Note too: it seems an i18n-hint comment is not extracted if it precedes
// wxPLURAL directly. A workaround: after the comment, insert a line
// _("dummyStringXXXX");
// where for XXXX subsitute something making this dummy string unique in the
// program. Then check in your generated audacity.pot that the dummy is
// immediately before the singular/plural entry.
//
// Your i18n-comment should therefore say something like,
// "In the string after this one, ..."
#define wxPLURAL(sing, plur, n) wxGetTranslation( wxT(sing), wxT(plur), n)
#ifdef _
#undef _
#endif
#define _(s) GetCustomTranslation((s))
#endif
// This renames a good use of this C++ keyword that we don't need to review when hunting for leaks.
#define PROHIBITED = delete

View File

@ -80,7 +80,6 @@ It handles initialization and termination by subclassing wxApp.
#include "Screenshot.h"
#include "Sequence.h"
#include "WaveTrack.h"
#include "Internat.h"
#include "prefs/PrefsDialog.h"
#include "Theme.h"
#include "PlatformCompatibility.h"

View File

@ -19,6 +19,8 @@
#include "MemoryX.h"
#include <wx/app.h>
#include "Internat.h"
class wxString;
class AudacityException /* not final */

View File

@ -28,6 +28,7 @@ Provides thread-safe logging based on the wxWidgets log facility.
#include "../images/AudacityLogoAlpha.xpm"
#include "Experimental.h"
#include "widgets/ErrorDialog.h"
#include "Internat.h"
//
// AudacityLogger class

View File

@ -40,6 +40,8 @@
*/
#include "Audacity.h"
#include "Internat.h"
#include "FFT.h"
#include "MemoryX.h"
#include "SampleFormat.h"

View File

@ -18,6 +18,8 @@ Describes shared object that is used to access FFmpeg libraries.
#include "MemoryX.h"
#include "Internat.h"
// TODO: Determine whether the libav* headers come from the FFmpeg or libav
// project and set IS_FFMPEG_PROJECT depending on it.
#define IS_FFMPEG_PROJECT 1

View File

@ -8,6 +8,7 @@
#include "Audacity.h"
#include "FileException.h"
#include "Internat.h"
#include "Prefs.h"
FileException::~FileException()

View File

@ -20,6 +20,7 @@
#include "FileNames.h"
#include "AboutDialog.h"
#include "AllThemeResources.h"
#include "Internat.h"
wxString HtmlColourOfIndex( int i ){

View File

@ -8,6 +8,7 @@
#include "Audacity.h"
#include "InconsistencyException.h"
#include "Internat.h"
InconsistencyException::~InconsistencyException()
{

View File

@ -27,10 +27,10 @@ and on Mac OS X for the filesystem.
#include <locale.h>
#include <math.h> // for pow()
#include "Internat.h"
#include "Experimental.h"
#include "FileNames.h"
#include "widgets/ErrorDialog.h"
#include "Internat.h"
// in order for the static member variables to exist, they must appear here
// (_outside_) the class definition, in order to be allocated some storage.

View File

@ -16,6 +16,41 @@
#include <wx/string.h>
#include <wx/longlong.h>
#ifndef IN_RC
class wxString;
extern const wxString& GetCustomTranslation(const wxString& str1 );
extern const wxString& GetCustomSubstitution(const wxString& str1 );
// Marks string for substitution only.
#define _TS( s ) GetCustomSubstitution( s )
// Marks strings for extraction only...must use wxGetTranslation() to translate.
#define XO(s) wxT(s)
#define _(s) GetCustomTranslation((s))
// The two string arugments will go to the .pot file, as
// msgid sing
// msgid_plural plural
//
// (You must use plain string literals. Do not use _() or wxT() or L prefix,
// which (intentionally) will fail to compile. The macro inserts wxT).
//
// Note too: it seems an i18n-hint comment is not extracted if it precedes
// wxPLURAL directly. A workaround: after the comment, insert a line
// _("dummyStringXXXX");
// where for XXXX subsitute something making this dummy string unique in the
// program. Then check in your generated audacity.pot that the dummy is
// immediately before the singular/plural entry.
//
// Your i18n-comment should therefore say something like,
// "In the string after this one, ..."
#define wxPLURAL(sing, plur, n) wxGetTranslation( wxT(sing), wxT(plur), n)
#endif
class Internat
{
public:

View File

@ -29,6 +29,7 @@ of languages for Audacity.
#include "ShuttleGui.h"
#include "widgets/wxPanelWrapper.h"
#include "widgets/ErrorDialog.h"
#include "Internat.h"
class LangChoiceDialog final : public wxDialogWrapper {
public:

View File

@ -22,6 +22,7 @@
#include "Audacity.h"
#include "PitchName.h"
#include "Internat.h"
double FreqToMIDInote(const double freq)

View File

@ -66,6 +66,7 @@
#include "Prefs.h"
#include "widgets/ErrorDialog.h"
#include "Internat.h"
std::unique_ptr<wxFileConfig> ugPrefs {};
wxFileConfig *gPrefs = NULL;

View File

@ -33,6 +33,7 @@
#include "Experimental.h"
#include "TrackPanelDrawingContext.h"
#include "Internat.h"
// Globals, so that we remember settings from session to session
wxPrintData &gPrintData()

View File

@ -25,6 +25,7 @@
#include "Resample.h"
#include "Prefs.h"
#include "TranslatableStringArray.h"
#include "Internat.h"
#include <soxr.h>

View File

@ -43,6 +43,7 @@
#include "SampleFormat.h"
#include "Prefs.h"
#include "Dither.h"
#include "Internat.h"
static Dither::DitherType gLowQualityDither = Dither::none;
static Dither::DitherType gHighQualityDither = Dither::none;

View File

@ -25,6 +25,7 @@
#include "ShuttlePrefs.h"
#include "Prefs.h"
#include "prefs/GUISettings.h"
#include "Internat.h"
BEGIN_EVENT_TABLE(SoundActivatedRecord, wxDialogWrapper)
EVT_BUTTON(wxID_OK, SoundActivatedRecord::OnOK)

View File

@ -16,6 +16,7 @@
#include <wx/string.h>
#include "widgets/wxPanelWrapper.h"
#include "Internat.h"
class NumericTextCtrl;
class ShuttleGui;

View File

@ -29,6 +29,7 @@
#include <wx/intl.h>
#include "Track.h"
#include "Internat.h"
TrackPanelAx::TrackPanelAx( wxWindow *window )
#if wxUSE_ACCESSIBILITY

View File

@ -32,6 +32,7 @@ or "OFF" point
#include "WaveTrack.h"
#include "widgets/ErrorDialog.h"
#include "Internat.h"
using std::cout;
using std::endl;

View File

@ -8,6 +8,7 @@
#include "../Audacity.h"
#include "NotYetAvailableException.h"
#include "../Internat.h"
NotYetAvailableException::~NotYetAvailableException()
{

View File

@ -42,6 +42,7 @@
#include "../../widgets/wxPanelWrapper.h"
#include "AudioUnitEffect.h"
#include "../../Internat.h"
struct CFReleaser
{ void operator () (const void *p) const { if (p) CFRelease(p); } };

View File

@ -84,7 +84,6 @@
#include "../WaveTrack.h"
#include "ImportPlugin.h"
#include "Import.h"
#include "../Internat.h"
#include "../NoteTrack.h"
#include "../Project.h"
#include "../FileFormats.h"

View File

@ -56,9 +56,8 @@ but little else.
#define __AUDACITY_IMPORTER__
#include "../Audacity.h"
#include <wx/arrstr.h>
#include "../Internat.h"
#include <wx/filename.h>
#include <wx/string.h>
#include "../MemoryX.h"
#include "../widgets/ProgressDialog.h"

View File

@ -30,6 +30,7 @@
#include "EffectsPrefs.h"
#include "../Experimental.h"
#include "../Internat.h"
EffectsPrefs::EffectsPrefs(wxWindow * parent)
: PrefsPanel(parent, _("Effects"))

View File

@ -34,6 +34,7 @@
#include "ThemePrefs.h"
#include "../AColor.h"
#include "../Internat.h"
GUIPrefs::GUIPrefs(wxWindow * parent)
/* i18n-hint: refers to Audacity's user interface settings */

View File

@ -23,6 +23,7 @@
#include "../ShuttleGui.h"
#include "ImportExportPrefs.h"
#include "../Internat.h"
ImportExportPrefs::ImportExportPrefs(wxWindow * parent)
: PrefsPanel(parent, _("Import / Export"))

View File

@ -24,6 +24,7 @@ with names like mnod-script-pipe that add NEW features.
#include "ModulePrefs.h"
#include "../Prefs.h"
#include "../Internat.h"
////////////////////////////////////////////////////////////////////////////////

View File

@ -34,6 +34,7 @@
#include "../Audacity.h"
#include "../Experimental.h"
#include "MousePrefs.h"
#include <wx/defs.h>
#include <wx/intl.h>
@ -41,7 +42,7 @@
#include "../Prefs.h"
#include "../ShuttleGui.h"
#include "MousePrefs.h"
#include "../Internat.h"
// The numbers of the columns of the mList.
enum

View File

@ -26,6 +26,7 @@
#include "../ShuttleGui.h"
#include "../Prefs.h"
#include "../Internat.h"
PlaybackPrefs::PlaybackPrefs(wxWindow * parent)
: PrefsPanel(parent, _("Playback"))

View File

@ -20,6 +20,7 @@
#include <wx/treebook.h>
#include <wx/window.h>
#include "../widgets/wxPanelWrapper.h"
#include "../Internat.h"
class PrefsPanel;
class PrefsPanelFactory;

View File

@ -25,6 +25,7 @@ handling.
#include "../ShuttleGui.h"
#include "ProjectsPrefs.h"
#include "../Internat.h"
////////////////////////////////////////////////////////////////////////////////

View File

@ -26,6 +26,7 @@
#include "../Resample.h"
#include "../SampleFormat.h"
#include "../ShuttleGui.h"
#include "../Internat.h"
#define ID_SAMPLE_RATE_CHOICE 7001

View File

@ -31,6 +31,7 @@
#include "../ShuttleGui.h"
#include "../Experimental.h"
#include "../Internat.h"
using std::min;

View File

@ -28,6 +28,7 @@ Paul Licameli
#include "../Experimental.h"
#include "../widgets/ErrorDialog.h"
#include "../Internat.h"
SpectrogramSettings::Globals::Globals()
{

View File

@ -20,6 +20,7 @@
#include "../Prefs.h"
#include "../ShuttleGui.h"
#include "../Experimental.h"
#include "../Internat.h"
TracksBehaviorsPrefs::TracksBehaviorsPrefs(wxWindow * parent)
/* i18n-hint: two nouns */

View File

@ -28,6 +28,7 @@
#include "../WaveTrack.h"
#include "../Experimental.h"
#include "../Internat.h"
int TracksPrefs::iPreferencePinned = -1;

View File

@ -24,6 +24,7 @@
#include "../ShuttleGui.h"
#include "WarningsPrefs.h"
#include "../Internat.h"
////////////////////////////////////////////////////////////////////////////////

View File

@ -23,6 +23,8 @@ Paul Licameli
#include "../Prefs.h"
#include "../TranslatableStringArray.h"
#include "../Internat.h"
WaveformSettings::Globals::Globals()
{

View File

@ -57,6 +57,7 @@ with changes in the SpectralSelectionBar.
#include "../widgets/NumericTextCtrl.h"
#include "../Experimental.h"
#include "../Internat.h"
#ifdef EXPERIMENTAL_SPECTRAL_EDITING

View File

@ -21,6 +21,7 @@ Paul Licameli split from TrackPanel.cpp
#include <wx/fontenum.h>
#include <wx/listbox.h>
#include <wx/spinctrl.h>
#include "../../../Internat.h"
LabelTrackControls::~LabelTrackControls()
{

View File

@ -20,6 +20,7 @@
#include <wx/menu.h>
#include "FileHistory.h"
#include "../Internat.h"
FileHistory::FileHistory(size_t maxfiles, wxWindowID base)
{

View File

@ -33,6 +33,7 @@ around to NEW positions.
#include "../AColor.h"
#include "../AllThemeResources.h"
#include "../Internat.h"
////////////////////////////////////////////////////////////
/// Methods for Grabber

View File

@ -26,6 +26,7 @@
#include "Grid.h"
#include "NumericTextCtrl.h"
#include "../SelectedRegion.h"
#include "../Internat.h"
NumericEditor::NumericEditor
(NumericConverter::Type type, const wxString &format, double rate)

View File

@ -25,6 +25,7 @@
#include <wx/arrimpl.cpp>
#include <wx/dc.h>
#include "../Internat.h"
// Various drawing constants
#define KV_BITMAP_SIZE 16

View File

@ -51,6 +51,7 @@
#include "ProgressDialog.h"
#include "ErrorDialog.h"
#include "../Prefs.h"
#include "../Internat.h"
// This really should be a Preferences setting
static const unsigned char beep[] =

View File

@ -30,6 +30,7 @@ the ability to not see similar warnings again for this session.
#include <wx/sizer.h>
#include <wx/stattext.h>
#include "wxPanelWrapper.h"
#include "../Internat.h"
class WarningDialog final : public wxDialogWrapper
{

View File

@ -30,6 +30,7 @@
#include "../Audacity.h"
#include "numformatter.h"
#include "../Internat.h"
#include <wx/intl.h>
#include <locale.h> // for setlocale and LC_ALL

View File

@ -40,6 +40,7 @@
#include <wx/dataobj.h>
#include "numformatter.h"
#include "../Internat.h"
// ============================================================================
// NumValidatorBase implementation

View File

@ -13,6 +13,8 @@
#include <wx/panel.h>
#include <wx/dialog.h>
#include "../Internat.h"
void wxTabTraversalWrapperCharHook(wxKeyEvent &event);
template <typename Base>

View File

@ -19,8 +19,8 @@
#include <string.h>
#include "../Internat.h"
#include "XMLFileReader.h"
#include "../Internat.h"
XMLFileReader::XMLFileReader()
{