Audacity  2.2.2
Classes | Macros | Functions
Internat.h File Reference
#include <wx/arrstr.h>
#include <wx/string.h>
#include <wx/longlong.h>
#include <algorithm>

Go to the source code of this file.


class  Internat
 Internationalisation support. More...
class  TranslatedInternalString


#define _TS(s)   GetCustomSubstitution( s )
#define XO(s)   wxT(s)
#define _(s)   GetCustomTranslation((s))
#define wxPLURAL(sing, plur, n)   wxGetTranslation( wxT(sing), wxT(plur), n)
#define _NoAcc(X)   Internat::StripAccelerators(_(X))
#define OSFILENAME(X)   ((char *) (const char *)(X).mb_str())
#define UTF8CTOWX(X)   wxString((X), wxConvUTF8)
#define LAT1CTOWX(X)   wxString((X), wxConvISO8859_1)


const wxString & GetCustomTranslation (const wxString &str1)
const wxString & GetCustomSubstitution (const wxString &str1)
wxArrayString LocalizedStrings (const wxString strings[], size_t nStrings)
wxArrayString LocalizedStrings (const wxArrayString &strings)

Macro Definition Documentation

#define _ (   s)    GetCustomTranslation((s))

Definition at line 53 of file Internat.h.

#define _NoAcc (   X)    Internat::StripAccelerators(_(X))

Definition at line 148 of file Internat.h.

#define _TS (   s)    GetCustomSubstitution( s )

Definition at line 29 of file Internat.h.

Referenced by AudacityLogger::DoLogText(), and AudacityProject::SetProjectTitle().

#define LAT1CTOWX (   X)    wxString((X), wxConvISO8859_1)
#define OSFILENAME (   X)    ((char *) (const char *)(X).mb_str())
#define OSINPUT (   X)    OSFILENAME(X)

Definition at line 164 of file Internat.h.

Referenced by FileNames::PathFromAddr().

#define OSOUTPUT (   X)    OSFILENAME(X)

Definition at line 165 of file Internat.h.

Referenced by MP3Exporter::PutInfoTag().

#define UTF8CTOWX (   X)    wxString((X), wxConvUTF8)
#define wxPLURAL (   sing,
)    wxGetTranslation( wxT(sing), wxT(plur), n)
#define XO (   s)    wxT(s)

Function Documentation

const wxString& GetCustomSubstitution ( const wxString &  str1)

Definition at line 66 of file Internat.cpp.

Referenced by GetCustomTranslation().

67 {
68  return str1 ;
69 }
const wxString& GetCustomTranslation ( const wxString &  str1)

Definition at line 74 of file Internat.cpp.

References GetCustomSubstitution().

Referenced by EffectManager::GetCommandName(), MacroCommands::GetNamesOfDefaultMacros(), gettext(), LocalizedStrings(), MacroCommandsCatalog::MacroCommandsCatalog(), EffectUIHost::OnMenu(), and MacroCommands::RestoreMacro().

75 {
76  const wxString& str2 = wxGetTranslation( str1 );
77  return GetCustomSubstitution( str2 );
78 }
const wxString & GetCustomSubstitution(const wxString &str1)
Definition: Internat.cpp:66
wxArrayString LocalizedStrings ( const wxString  strings[],
size_t  nStrings 

Definition at line 172 of file Internat.h.

References GetCustomTranslation().

Referenced by NyquistEffect::BuildEffectWindow(), LocalizedStrings(), SetClipCommand::PopulateOrExchange(), DragCommand::PopulateOrExchange(), GetTrackInfoCommand::PopulateOrExchange(), SetTrackCommand::PopulateOrExchange(), GetInfoCommand::PopulateOrExchange(), SelectTimeCommand::PopulateOrExchange(), ScreenshotCommand::PopulateOrExchange(), and SelectTracksCommand::PopulateOrExchange().

173 {
174  wxArrayString results;
175  std::transform( strings, strings + nStrings, std::back_inserter(results),
177  return results;
178 }
const wxString & GetCustomTranslation(const wxString &str1)
Definition: Internat.cpp:74
wxArrayString LocalizedStrings ( const wxArrayString &  strings)

Definition at line 180 of file Internat.h.

References LocalizedStrings().

181 {
182  if (strings.empty())
183  return {};
184  return LocalizedStrings( &strings[0], strings.size() );
185 }
wxArrayString LocalizedStrings(const wxString strings[], size_t nStrings)
Definition: Internat.h:172