Audacity  2.2.0
Internat Class Reference

Internationalisation support. More...

#include <Internat.h>

Static Public Member Functions

static void Init ()
 Initialize internationalisation support. Call this once at program start. More...
 
static wxChar GetDecimalSeparator ()
 Get the decimal separator for the current locale. More...
 
static bool CompatibleToDouble (const wxString &stringToConvert, double *result)
 Convert a string to a number. More...
 
static double CompatibleToDouble (const wxString &stringToConvert)
 
static wxString ToString (double numberToConvert, int digitsAfterDecimalPoint=-1)
 Convert a number to a string, always uses the dot as decimal separator. More...
 
static wxString ToDisplayString (double numberToConvert, int digitsAfterDecimalPoint=-1)
 Convert a number to a string, uses the user's locale's decimal separator. More...
 
static wxString FormatSize (wxLongLong size)
 Convert a number to a string while formatting it in bytes, KB, MB, GB. More...
 
static wxString FormatSize (double size)
 
static bool SanitiseFilename (wxString &name, const wxString &sub)
 Protect against Unicode to multi-byte conversion failures on Windows. More...
 
static wxString StripAccelerators (const wxString &str)
 Remove accelerator charactors from strings. More...
 
static wxString Parenthesize (const wxString &str)
 
static const wxArrayString & GetExcludedCharacters ()
 

Static Private Attributes

static wxChar mDecimalSeparator = wxT('.')
 
static wxArrayString exclude
 
static wxCharBuffer mFilename
 

Detailed Description

Internationalisation support.

This class is used to help internationalisation and in general compatibility with different locales and character sets. It deals mostly with converting numbers, but also has important functions to convert to/from UTF-8, which is used in XML files and on Mac OS X for the filesystem.

Member Function Documentation

double Internat::CompatibleToDouble ( const wxString &  stringToConvert)
static

References CompatibleToDouble().

wxString Internat::FormatSize ( wxLongLong  size)
static

Convert a number to a string while formatting it in bytes, KB, MB, GB.

Referenced by HistoryWindow::DoUpdate(), UndoManager::GetLongDescription(), DependencyDialog::PopulateList(), and DirectoriesPrefs::UpdateFreeSpace().

wxString Internat::FormatSize ( double  size)
static

References _(), and ToDisplayString().

wxChar Internat::GetDecimalSeparator ( )
static

Get the decimal separator for the current locale.

Normally, this is a decimal point ('.'), but e.g. Germany uses a comma (',').

References mDecimalSeparator.

Referenced by CompatibleToDouble(), ToDisplayString(), and ToString().

static const wxArrayString& Internat::GetExcludedCharacters ( )
inlinestatic

References exclude.

Referenced by ExportMultiple::MakeFileName().

void Internat::Init ( )
static

Initialize internationalisation support. Call this once at program start.

References exclude, format, and mDecimalSeparator.

Referenced by AudacityApp::InitLang().

wxString Internat::Parenthesize ( const wxString &  str)
static
bool Internat::SanitiseFilename ( wxString &  name,
const wxString &  sub 
)
static

Protect against Unicode to multi-byte conversion failures on Windows.

Check a proposed file name string for illegal characters and remove them return true iff name is "visibly" changed (not necessarily equivalent to character-wise changed)

References exclude.

Referenced by ExportMultiple::MakeFileName().

wxString Internat::StripAccelerators ( const wxString &  str)
static

Remove accelerator charactors from strings.

Utility function - takes a translatable string to be used as a menu item, for example _("&Splash...\tAlt+S"), and strips all of the menu accelerator stuff from it, to make "Splash". That way the same translatable string can be used both when accelerators are needed and when they aren't, saving translators effort.

wxString Internat::ToDisplayString ( double  numberToConvert,
int  digitsAfterDecimalPoint = -1 
)
static

Convert a number to a string, uses the user's locale's decimal separator.

References format, and GetDecimalSeparator().

Referenced by FormatSize(), EffectAutoDuckPanel::OnPaint(), LadspaEffect::OnSlider(), LadspaEffect::PopulateUI(), LadspaEffect::RefreshControls(), and ToString().

wxString Internat::ToString ( double  numberToConvert,
int  digitsAfterDecimalPoint = -1 
)
static

Member Data Documentation

wxArrayString Internat::exclude
staticprivate
wxChar Internat::mDecimalSeparator = wxT('.')
staticprivate

Referenced by GetDecimalSeparator(), and Init().

wxCharBuffer Internat::mFilename
staticprivate

The documentation for this class was generated from the following files: