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 101 of file Internat.h.
|
static |
Definition at line 119 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 109 of file Internat.cpp.
References GetDecimalSeparator(), and wxT().
Referenced by CompatibleToDouble(), NyquistBase::GetCtrlValue(), LabelStruct::Import(), LOFImportFileHandle::lofOpenFiles(), LadspaEditor::OnTextCtrl(), WrappedType::ReadAsDouble(), and WrappedType::WriteToAsString().
|
static |
Definition at line 188 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 179 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 104 of file Internat.cpp.
References mDecimalSeparator.
Referenced by CompatibleToDouble(), ToDisplayString(), and ToString().
|
inlinestatic |
Definition at line 147 of file Internat.h.
|
static |
Initialize internationalisation support. Call this once at program start.
Definition at line 53 of file Internat.cpp.
References exclude, anonymous_namespace{ExportPCM.cpp}::format, mDecimalSeparator, and wxT().
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 215 of file Internat.cpp.
References exclude, name, and wxT().
Referenced by ExportAudioDialog::UpdateLabelExportSettings(), and ExportAudioDialog::UpdateTrackExportSettings().
|
static |
Definition at line 97 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 137 of file Internat.cpp.
References anonymous_namespace{ExportPCM.cpp}::format, GetDecimalSeparator(), and wxT().
Referenced by LV2Editor::BuildPlain(), FormatSize(), EffectAutoDuck::Panel::OnPaint(), LadspaEditor::OnSlider(), VampEffect::PopulateOrExchange(), LadspaEditor::PopulateUI(), LadspaEditor::RefreshControls(), and ToString().
|
static |
Convert a number to a string, always uses the dot as decimal separator.
Definition at line 126 of file Internat.cpp.
References GetDecimalSeparator(), ToDisplayString(), and wxT().
Referenced by LabelStruct::Export(), anonymous_namespace{NyquistBase.cpp}::GetClipBoundaries(), Sequence::HandleXMLEndTag(), Sequence::Paste(), NyquistBase::Process(), NyquistBase::ProcessOne(), XMLWriter::WriteAttr(), and Sequence::WriteXML().
|
staticprivate |
Definition at line 153 of file Internat.h.
Referenced by Init(), and SanitiseFilename().
|
staticprivate |
Definition at line 151 of file Internat.h.
Referenced by GetDecimalSeparator(), Init(), and SetCeeNumberFormat().