![]() |
Audacity 3.2.0
|
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 void | SetCeeNumberFormat () |
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 TranslatableString | FormatSize (wxLongLong size) |
Convert a number to a string while formatting it in bytes, KB, MB, GB. More... | |
static TranslatableString | FormatSize (double size) |
static bool | SanitiseFilename (wxString &name, const wxString &sub) |
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) More... | |
static const wxArrayString & | GetExcludedCharacters () |
Static Private Attributes | |
static wxChar | mDecimalSeparator = wxT('.') |
static wxArrayString | exclude |
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.
Definition at line 103 of file Internat.h.
|
static |
Definition at line 144 of file Internat.cpp.
References CompatibleToDouble().
|
static |
Convert a string to a number.
This function will accept BOTH point and comma as a decimal separator, regardless of the current locale. Returns 'true' on success, and 'false' if an error occurs.
Definition at line 134 of file Internat.cpp.
References GetDecimalSeparator().
Referenced by CompatibleToDouble(), NyquistEffect::GetCtrlValue(), LabelStruct::Import(), LOFImportFileHandle::lofOpenFiles(), LadspaEffect::Validator::OnTextCtrl(), WrappedType::ReadAsDouble(), and WrappedType::WriteToAsString().
|
static |
Definition at line 213 of file Internat.cpp.
References size, ToDisplayString(), and XO.
|
static |
Convert a number to a string while formatting it in bytes, KB, MB, GB.
Definition at line 204 of file Internat.cpp.
References FormatSize(), and size.
Referenced by ProjectFileManager::Compact(), HistoryDialog::DoUpdate(), FormatSize(), HistoryDialog::OnCompact(), DependencyDialog::OnCopyToClipboard(), DirectoriesPrefs::OnTempText(), and DependencyDialog::PopulateList().
|
static |
Get the decimal separator for the current locale.
Normally, this is a decimal point ('.'), but e.g. Germany uses a comma (',').
Definition at line 129 of file Internat.cpp.
References mDecimalSeparator.
Referenced by CompatibleToDouble(), ToDisplayString(), and ToString().
|
inlinestatic |
Definition at line 149 of file Internat.h.
Referenced by ExportMultipleDialog::MakeFileName().
|
static |
Initialize internationalisation support. Call this once at program start.
Definition at line 78 of file Internat.cpp.
References exclude, format, and mDecimalSeparator.
Referenced by Languages::SetLang().
|
static |
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)
Definition at line 240 of file Internat.cpp.
Referenced by ExportMultipleDialog::MakeFileName().
|
static |
Definition at line 122 of file Internat.cpp.
References mDecimalSeparator.
Referenced by GUISettings::SetLang().
|
static |
Convert a number to a string, uses the user's locale's decimal separator.
Definition at line 162 of file Internat.cpp.
References format, and GetDecimalSeparator().
Referenced by LV2Effect::BuildPlain(), FormatSize(), EffectAutoDuck::Panel::OnPaint(), LadspaEffect::Validator::OnSlider(), VampEffect::PopulateOrExchange(), LadspaEffect::Validator::PopulateUI(), LadspaEffect::Validator::RefreshControls(), and ToString().
|
static |
Convert a number to a string, always uses the dot as decimal separator.
Definition at line 151 of file Internat.cpp.
References GetDecimalSeparator(), and ToDisplayString().
Referenced by LabelStruct::Export(), Sequence::HandleXMLEndTag(), Sequence::Paste(), NyquistEffect::Process(), NyquistEffect::ProcessOne(), XMLWriter::WriteAttr(), and Sequence::WriteXML().
|
staticprivate |
Definition at line 155 of file Internat.h.
Referenced by Init(), and SanitiseFilename().
|
staticprivate |
Definition at line 153 of file Internat.h.
Referenced by GetDecimalSeparator(), Init(), and SetCeeNumberFormat().