Audacity  3.0.3
Classes | Public Types | Public Member Functions | Static Public Attributes | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
TranslatableString Class Reference

#include <Types.h>

Collaboration diagram for TranslatableString:
[legend]

Classes

struct  PluralTemp
 

Public Types

enum  StripOptions : unsigned { MenuCodes = 0x1, Ellipses = 0x2 }
 
using Formatter = std::function< wxString(const wxString &, Request) >
 

Public Member Functions

 TranslatableString ()
 
 TranslatableString (wxString str, Formatter formatter)
 
 TranslatableString (const TranslatableString &)=default
 
TranslatableStringoperator= (const TranslatableString &)=default
 
 TranslatableString (TranslatableString &&str)
 
TranslatableStringoperator= (TranslatableString &&str)
 
bool empty () const
 
Identifier MSGID () const
 
wxString Translation () const
 
wxString Debug () const
 
bool IsVerbatim () const
 
template<typename... Args>
TranslatableStringFormat (Args &&...args) &
 
template<typename... Args>
TranslatableString && Format (Args &&...args) &&
 
TranslatableStringContext (const wxString &context) &
 
TranslatableString && Context (const wxString &context) &&
 
TranslatableStringJoin (TranslatableString arg, const wxString &separator={}) &
 
TranslatableString && Join (TranslatableString arg, const wxString &separator={}) &&
 
TranslatableStringoperator+= (TranslatableString arg)
 
template<size_t N>
PluralTemp< N > Plural (const wxString &pluralStr) &&
 
TranslatableStringStrip (unsigned options=MenuCodes) &
 
TranslatableString && Strip (unsigned options=MenuCodes) &&
 
TranslatableString Stripped (unsigned options=MenuCodes) const
 
wxString StrippedTranslation () const
 

Static Public Attributes

static const TranslatableString Inaudible { wxT("\a") }
 

Private Types

enum  Request { Request::Context, Request::Format, Request::DebugFormat }
 

Private Member Functions

 TranslatableString (wxString str)
 
wxString DoFormat (bool debug) const
 

Static Private Member Functions

static wxString DoGetContext (const Formatter &formatter)
 
static wxString DoSubstitute (const Formatter &formatter, const wxString &format, const wxString &context, bool debug)
 
static wxString DoChooseFormat (const Formatter &formatter, const wxString &singular, const wxString &plural, unsigned nn, bool debug)
 
template<typename T >
static const T & TranslateArgument (const T &arg, bool)
 
template<typename T >
static auto TranslateArgument (const std::reference_wrapper< T > &arg, bool debug) -> decltype(TranslatableString::TranslateArgument(arg.get(), debug))
 
static wxString TranslateArgument (const TranslatableString &arg, bool debug)
 

Private Attributes

wxString mMsgid
 
Formatter mFormatter
 

Static Private Attributes

static const Formatter NullContextFormatter
 
static const wxChar *const NullContextName = wxT("*")
 

Friends

bool operator== (const TranslatableString &x, const TranslatableString &y)
 
bool operator!= (const TranslatableString &x, const TranslatableString &y)
 
TranslatableString Verbatim (wxString str)
 

Detailed Description

Definition at line 290 of file Types.h.

Member Typedef Documentation

◆ Formatter

using TranslatableString::Formatter = std::function< wxString(const wxString &, Request) >

Definition at line 302 of file Types.h.

Member Enumeration Documentation

◆ Request

enum TranslatableString::Request
strongprivate
Enumerator
Context 
Format 
DebugFormat 

Definition at line 475 of file Types.h.

475  {
476  Context, // return a disambiguating context string
477  Format, // Given the msgid, format the string for end users
478  DebugFormat, // Given the msgid, format the string for developers
479  };

◆ StripOptions

Enumerator
MenuCodes 
Ellipses 

Definition at line 447 of file Types.h.

447  : unsigned {
448  // Values to be combined with bitwise OR
449  MenuCodes = 0x1,
450  Ellipses = 0x2,
451  };

Constructor & Destructor Documentation

◆ TranslatableString() [1/5]

TranslatableString::TranslatableString ( )
inline

Definition at line 304 of file Types.h.

304 {}

◆ TranslatableString() [2/5]

TranslatableString::TranslatableString ( wxString  str,
Formatter  formatter 
)
inlineexplicit

Definition at line 308 of file Types.h.

309  : mFormatter{ std::move(formatter) }
310  {
311  mMsgid.swap( str );
312  }

◆ TranslatableString() [3/5]

TranslatableString::TranslatableString ( const TranslatableString )
default

◆ TranslatableString() [4/5]

TranslatableString::TranslatableString ( TranslatableString &&  str)
inline

Definition at line 317 of file Types.h.

318  : mFormatter( std::move( str.mFormatter ) )
319  {
320  mMsgid.swap( str.mMsgid );
321  }

◆ TranslatableString() [5/5]

TranslatableString::TranslatableString ( wxString  str)
inlineexplicitprivate

Definition at line 467 of file Types.h.

469  {
470  mMsgid.swap( str );
471  }

Member Function Documentation

◆ Context() [1/2]

TranslatableString& TranslatableString::Context ( const wxString &  context) &
inline

Definition at line 398 of file Types.h.

399  {
400  this->mFormatter = [context]
401  (const wxString &str, Request request) -> wxString {
402  switch ( request ) {
403  case Request::Context:
404  return context;
406  return DoSubstitute( {}, str, context, true );
407  case Request::Format:
408  default:
409  return DoSubstitute( {}, str, context, false );
410  }
411  };
412  return *this;
413  }

◆ Context() [2/2]

TranslatableString&& TranslatableString::Context ( const wxString &  context) &&
inline

Definition at line 414 of file Types.h.

415  {
416  return std::move( Context( context ) );
417  }

◆ Debug()

wxString TranslatableString::Debug ( ) const
inline

Definition at line 341 of file Types.h.

341 { return DoFormat( true ); }

Referenced by CommandManager::NewIdentifier(), XMLFileReader::ParseString(), Sequence::Paste(), AUPImportFileHandle::SetError(), and AUPImportFileHandle::SetWarning().

Here is the caller graph for this function:

◆ DoChooseFormat()

wxString TranslatableString::DoChooseFormat ( const Formatter formatter,
const wxString &  singular,
const wxString &  plural,
unsigned  nn,
bool  debug 
)
staticprivate

Definition at line 372 of file Internat.cpp.

375 {
376  // come here for translatable strings that choose among forms by number;
377  // if not debugging, then two keys are passed to an overload of
378  // wxGetTranslation, and also a number.
379  // Some languages might choose among more or fewer than two forms
380  // (e.g. Arabic has duals and Russian has complicated declension rules)
381  wxString context;
382  return ( debug || NullContextName == (context = DoGetContext(formatter)) )
383  ? ( nn == 1 ? singular : plural )
384  : wxGetTranslation(
385  singular, plural, nn
387  , wxString{} // domain
388  , context
389 #endif
390  );
391 }

References DoGetContext(), HAS_I18N_CONTEXTS, and NullContextName.

Referenced by TranslatableString::PluralTemp< N >::operator()().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DoFormat()

wxString TranslatableString::DoFormat ( bool  debug) const
inlineprivate

Definition at line 488 of file Types.h.

489  { return DoSubstitute(

Referenced by TranslateArgument().

Here is the caller graph for this function:

◆ DoGetContext()

wxString TranslatableString::DoGetContext ( const Formatter formatter)
staticprivate

Definition at line 358 of file Internat.cpp.

359 {
360  return formatter ? formatter( {}, Request::Context ) : wxString{};
361 }

References Context.

Referenced by DoChooseFormat(), Format(), IsVerbatim(), Join(), TranslatableString::PluralTemp< N >::operator()(), and Strip().

Here is the caller graph for this function:

◆ DoSubstitute()

wxString TranslatableString::DoSubstitute ( const Formatter formatter,
const wxString &  format,
const wxString &  context,
bool  debug 
)
staticprivate

Definition at line 363 of file Internat.cpp.

365 {
366  return formatter
367  ? formatter( format, debug ? Request::DebugFormat : Request::Format )
368  : // come here for most translatable strings, which have no formatting
369  ( debug ? format : wxGetTranslation( format, wxString{}, context ) );
370 }

References DebugFormat, Format, and format.

Referenced by Format(), Join(), and Strip().

Here is the caller graph for this function:

◆ empty()

bool TranslatableString::empty ( ) const
inline

Definition at line 329 of file Types.h.

329 { return mMsgid.empty(); }

Referenced by CommandMessageTarget::AddBool(), LispyCommandMessageTarget::AddBool(), Effect::AddedAnalysisTrack::AddedAnalysisTrack(), anonymous_namespace{PluginMenus.cpp}::AddEffectMenuItems(), CommandMessageTarget::AddItem(), LispyCommandMessageTarget::AddItem(), ShuttleGuiBase::AddPrompt(), ShuttleGuiBase::AddTitle(), ShuttleGuiBase::AddUnits(), BatchEvalCommand::Apply(), ShuttleGuiBase::ApplyItem(), MacroCommands::ApplyMacro(), ApplyMacroDialog::ApplyMacroToProject(), ProgressDialog::Beep(), anonymous_namespace{ClipMenus.cpp}::ClipBoundaryMessage(), MessageBoxException::DelayedHandlerAction(), CommandManager::DescribeCommandsAndShortcuts(), anonymous_namespace{ClipMenus.cpp}::DoSelectClip(), Ruler::Draw(), ExportMultipleDialog::ExportMultipleByLabel(), anonymous_namespace{Registry.cpp}::CollectedItems::Find(), anonymous_namespace{ProjectFileManager.cpp}::FindHelpUrl(), VSTEffect::GetAutomationParameters(), TracksPrefs::GetDefaultAudioTrackNamePreference(), CommandManager::GetPrefixedLabelFromName(), Effect::GetSquashedName(), LWSlider::GetTip(), Effect::GetUserPresetsGroup(), LWSlider::GetWidestTips(), CellularPanel::HandleMotion(), Importer::Import(), ProjectFileManager::Import(), AUPImportFileHandle::Import(), Ruler::TickSizes::LabelString(), MenuTable::MenuOrItems(), AudacityCommand::MessageBox(), Effect::MessageBox(), Effect::ModifiedAnalysisTrack::ModifiedAnalysisTrack(), CommandManager::NewIdentifier(), EffectUIHost::OnMenu(), PluginRegistrationDialog::OnOK(), EditCurvesDialog::OnRename(), EffectUIHost::OnSaveAs(), AudacityApp::OnTimer(), SelectHandle::Preview(), NyquistEffect::ProcessOne(), ExportFFmpegOptions::SavePreset(), VSTEffect::SetAutomationParameters(), DBConnection::SetDBError(), AUPImportFileHandle::SetError(), DBConnection::SetError(), ProgressDialog::SetMessage(), anonymous_namespace{EffectManager.cpp}::EffectPresetsDialog::SetPrefix(), ProjectFileIO::SetProjectTitle(), AUPImportFileHandle::SetWarning(), LyricsWindow::SetWindowTitle(), MixerBoardFrame::SetWindowTitle(), SpinSliderHandlers(), CommandMessageTarget::StartField(), ShuttleGuiBase::StartStatic(), EffectReverb::Startup(), anonymous_namespace{EffectManager.cpp}::EffectPresetsDialog::UpdateUI(), and anonymous_namespace{Registry.cpp}::VisitItems().

◆ Format() [1/2]

template<typename... Args>
TranslatableString& TranslatableString::Format ( Args &&...  args) &
inline

Definition at line 363 of file Types.h.

364  {
365  auto prevFormatter = mFormatter;
366  this->mFormatter = [prevFormatter, args...]
367  (const wxString &str, Request request) -> wxString {
368  switch ( request ) {
369  case Request::Context:
370  return TranslatableString::DoGetContext( prevFormatter );
371  case Request::Format:
373  default: {
374  bool debug = request == Request::DebugFormat;
375  return wxString::Format(
377  prevFormatter,
378  str, TranslatableString::DoGetContext( prevFormatter ),
379  debug ),
380  TranslatableString::TranslateArgument( args, debug )...
381  );
382  }
383  }
384  };
385  return *this;
386  }

References DoGetContext(), DoSubstitute(), and TranslateArgument().

Referenced by CommandManager::DescribeCommandsAndShortcuts(), TrackUtilities::DoMoveTrack(), anonymous_namespace{Contrast.cpp}::FormatRMSMessage(), CommandManager::GetPrefixedLabelFromName(), LWSlider::GetTip(), KeyConfigPrefs::OnSet(), PitchName_Absolute(), EffectEqualization::PopulateOrExchange(), EffectScienFilter::PopulateOrExchange(), NyquistEffect::Process(), ShowExportErrorDialog(), ControlToolBar::StateForStatusBar(), and anonymous_namespace{WaveTrackControls.cpp}::Status1DrawFunction().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Format() [2/2]

template<typename... Args>
TranslatableString&& TranslatableString::Format ( Args &&...  args) &&
inline

Definition at line 388 of file Types.h.

389  {
390  return std::move( Format( std::forward<Args>(args)... ) );
391  }

◆ IsVerbatim()

bool TranslatableString::IsVerbatim ( ) const

Definition at line 319 of file Internat.cpp.

320 {
322 }

References DoGetContext(), mFormatter, and NullContextName.

Here is the call graph for this function:

◆ Join() [1/2]

TranslatableString & TranslatableString::Join ( TranslatableString  arg,
const wxString &  separator = {} 
) &

Definition at line 393 of file Internat.cpp.

395 {
396  auto prevFormatter = mFormatter;
397  mFormatter =
398  [prevFormatter,
399  arg /* = std::move( arg ) */,
400  separator](const wxString &str, Request request)
401  -> wxString {
402  switch ( request ) {
403  case Request::Context:
404  return TranslatableString::DoGetContext( prevFormatter );
405  case Request::Format:
407  default: {
408  bool debug = request == Request::DebugFormat;
409  return
410  TranslatableString::DoSubstitute( prevFormatter,
411  str, TranslatableString::DoGetContext( prevFormatter ),
412  debug )
413  + separator
414  + arg.DoFormat( debug );
415  }
416  }
417  };
418  return *this;
419 }

References DoGetContext(), and DoSubstitute().

Referenced by MacroCommandsCatalog::MacroCommandsCatalog(), PluginRegistrationDialog::OnOK(), SelectHandle::Preview(), PrefsDialog::ShowModal(), EffectDistortion::UpdateControl(), and TrackPanel::UpdateStatusMessage().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Join() [2/2]

TranslatableString&& TranslatableString::Join ( TranslatableString  arg,
const wxString &  separator = {} 
) &&
inline

Definition at line 424 of file Types.h.

425  {} ) &&
426  { return std::move( Join( std::move(arg), separator ) ); }

◆ MSGID()

Identifier TranslatableString::MSGID ( ) const
inline

Definition at line 335 of file Types.h.

335 { return Identifier{ mMsgid }; }

Referenced by ComponentInterfaceSymbol::ComponentInterfaceSymbol(), anonymous_namespace{ProjectFileManager.cpp}::FindHelpUrl(), CommandManager::NewIdentifier(), AudioUnitEffectOptionsDialog::OnOk(), and PluginManager::SaveGroup().

Here is the caller graph for this function:

◆ operator+=()

TranslatableString& TranslatableString::operator+= ( TranslatableString  arg)
inline

Definition at line 428 of file Types.h.

429  {
430  Join( std::move( arg ) );
431  return *this;
432  }

◆ operator=() [1/2]

TranslatableString& TranslatableString::operator= ( const TranslatableString )
default

◆ operator=() [2/2]

TranslatableString& TranslatableString::operator= ( TranslatableString &&  str)
inline

Definition at line 322 of file Types.h.

323  {
324  mFormatter = std::move( str.mFormatter );
325  mMsgid.swap( str.mMsgid );
326  return *this;
327  }

◆ Plural()

template<size_t N>
PluralTemp< N > TranslatableString::Plural ( const wxString &  pluralStr) &&
inline

Definition at line 439 of file Types.h.

440  {
441  return PluralTemp< N >{ *this, pluralStr };
442  }

◆ Strip() [1/2]

TranslatableString & TranslatableString::Strip ( unsigned  options = MenuCodes) &

Definition at line 324 of file Internat.cpp.

325 {
326  auto prevFormatter = mFormatter;
327  mFormatter = [prevFormatter, codes]
328  ( const wxString & str, TranslatableString::Request request ) -> wxString {
329  switch ( request ) {
330  case Request::Context:
331  return TranslatableString::DoGetContext( prevFormatter );
332  case Request::Format:
334  default: {
335  bool debug = request == Request::DebugFormat;
336  auto result =
338  prevFormatter,
339  str, TranslatableString::DoGetContext( prevFormatter ),
340  debug );
341  if ( codes & MenuCodes )
342  result = wxStripMenuCodes( result );
343  if ( codes & Ellipses ) {
344  if (result.EndsWith(wxT("...")))
345  result = result.Left( result.length() - 3 );
346  // Also check for the single-character Unicode ellipsis
347  else if (result.EndsWith(wxT("\u2026")))
348  result = result.Left( result.length() - 1 );
349  }
350  return result;
351  }
352  }
353  };
354 
355  return *this;
356 }

References DoGetContext(), and DoSubstitute().

Referenced by MacroCommandsCatalog::MacroCommandsCatalog(), KeyView::RefreshBindings(), and Stripped().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Strip() [2/2]

TranslatableString&& TranslatableString::Strip ( unsigned  options = MenuCodes) &&
inline

Definition at line 453 of file Types.h.

454  { return std::move( Strip( options ) ); }

◆ Stripped()

TranslatableString TranslatableString::Stripped ( unsigned  options = MenuCodes) const
inline

Definition at line 457 of file Types.h.

458  { return TranslatableString{ *this }.Strip( options ); }

References Strip().

Referenced by ShuttleGuiBase::AddCheckBoxOnRight(), ShuttleGuiBase::AddChoice(), BatchEvalCommand::Apply(), ShuttleGuiBase::ApplyItem(), MacroCommands::ApplyMacro(), CommandManager::GetPrefixedLabelFromName(), CommandManager::HandleCommandEntry(), CommandManager::NewIdentifier(), AButton::SetLabel(), AButton::SetToolTip(), Grabber::SetToolTip(), wxPanelWrapper::SetToolTip(), and ComponentInterfaceSymbol::Stripped().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ StrippedTranslation()

wxString TranslatableString::StrippedTranslation ( ) const
inline

Definition at line 460 of file Types.h.

460 { return Stripped().Translation(); }

Referenced by ShuttleGuiBase::AddChoice(), and ShuttleGui::SetMinSize().

Here is the caller graph for this function:

◆ TranslateArgument() [1/3]

template<typename T >
static auto TranslatableString::TranslateArgument ( const std::reference_wrapper< T > &  arg,
bool  debug 
) -> decltype( TranslatableString::TranslateArgument( arg.get(), debug ) )
inlinestaticprivate

Definition at line 500 of file Types.h.

504  { return TranslatableString::TranslateArgument( arg.get(), debug ); }

References TranslateArgument().

Here is the call graph for this function:

◆ TranslateArgument() [2/3]

template<typename T >
static const T& TranslatableString::TranslateArgument ( const T &  arg,
bool   
)
inlinestaticprivate

Definition at line 496 of file Types.h.

497  { return arg; }

Referenced by Format(), TranslatableString::PluralTemp< N >::operator()(), and TranslateArgument().

Here is the caller graph for this function:

◆ TranslateArgument() [3/3]

static wxString TranslatableString::TranslateArgument ( const TranslatableString arg,
bool  debug 
)
inlinestaticprivate

Definition at line 505 of file Types.h.

506  { return arg.DoFormat( debug ); }

References DoFormat().

Here is the call graph for this function:

◆ Translation()

wxString TranslatableString::Translation ( ) const
inline

Definition at line 337 of file Types.h.

337 { return DoFormat( false ); }

Referenced by ShuttleGuiBase::AddButton(), ShuttleGuiBase::AddCheckBox(), ShuttleGuiBase::AddCheckBoxOnRight(), ShuttleGuiBase::AddChoice(), ShuttleGuiBase::AddCombo(), ShuttleGuiBase::AddConstTextBox(), anonymous_namespace{PluginMenus.cpp}::AddEffectMenuItemGroup(), ShuttleGuiBase::AddFixedText(), MousePrefs::AddItem(), ShuttleGuiBase::AddNumericTextBox(), ShuttleGuiBase::AddPrompt(), ShuttleGuiBase::AddReadOnlyText(), ShuttleGuiBase::AddSlider(), ShuttleGuiBase::AddSpinCtrl(), ShuttleGuiBase::AddTextBox(), ShuttleGuiBase::AddTitle(), SelectionBar::AddTitle(), ShuttleGuiBase::AddUnits(), ShuttleGuiBase::AddVariableText(), MacroCommands::ApplyCommand(), ShuttleGuiBase::ApplyItem(), ASlider::ASlider(), AudacityMessageBox(), VSTEffectsModule::Check(), DBConnection::Close(), ProgressDialog::Create(), FileDialogWrapper::Create(), wxDialogWrapper::Create(), wxPanelWrapper::Create(), ShuttleGuiBase::DoAddRadioButton(), HistoryDialog::DoUpdate(), CommandManager::EndMainMenu(), CommandManager::EndSubMenu(), CommandManager::FormatLabelForMenu(), CommandManager::FormatLabelWithDisabledAccel(), EffectDistortion::GetFactoryPresets(), EffectEqualization::GetFactoryPresets(), EffectReverb::GetFactoryPresets(), NyquistEffect::GetVersion(), CellularPanel::HandleMotion(), ImportStreamDialog::ImportStreamDialog(), ExportMP3Options::LoadNames(), MacroCommandsCatalog::MacroCommandsCatalog(), MixerBoard::MakeButtonBitmap(), TrackPanelAx::MessageForScreenReader(), MultiDialog::MultiDialog(), TimerRecordDialog::NewPathControl(), DependencyDialog::OnCopyToClipboard(), LinkingHtmlWindow::OnLinkClicked(), EffectUIHost::OnMenu(), TipWindow::OnPaint(), DirectoriesPrefs::OnTempText(), operator<<(), NumericConverter::ParseFormatString(), FrequencyPlotDialog::PlotPaint(), SelectionBar::Populate(), TranscriptionToolBar::Populate(), LabelDialog::PopulateLabels(), DependencyDialog::PopulateList(), TagsEditorDialog::PopulateOrExchange(), BenchmarkDialog::Printf(), NyquistEffect::Process(), NyquistEffect::ProcessOne(), UndoManager::PushState(), KeyView::RefreshBindings(), CommandManager::RemoveDuplicateShortcuts(), ProjectStatus::Set(), Importer::SetDefaultOpenType(), AButton::SetLabel(), wxPanelWrapper::SetLabel(), wxDialogWrapper::SetLabel(), Importer::SetLastOpenType(), ProgressDialog::SetMessage(), NumericTextCtrl::SetName(), wxPanelWrapper::SetName(), wxDialogWrapper::SetName(), anonymous_namespace{EffectManager.cpp}::EffectPresetsDialog::SetPrefix(), ProjectManager::SetStatusText(), wxDialogWrapper::SetTitle(), AButton::SetToolTip(), Grabber::SetToolTip(), wxPanelWrapper::SetToolTip(), ReadOnlyText::SetValue(), HelpSystem::ShowHtmlText(), ShuttleGuiBase::StartNotebookPage(), ShuttleGuiBase::StartStatic(), ComponentInterfaceSymbol::StrippedTranslation(), anonymous_namespace{GetInfoCommand.cpp}::ShuttleGuiGetDefinition::TieCheckBox(), anonymous_namespace{GetInfoCommand.cpp}::ShuttleGuiGetDefinition::TieCheckBoxOnRight(), anonymous_namespace{GetInfoCommand.cpp}::ShuttleGuiGetDefinition::TieChoice(), anonymous_namespace{GetInfoCommand.cpp}::ShuttleGuiGetDefinition::TieIntegerTextBox(), anonymous_namespace{GetInfoCommand.cpp}::ShuttleGuiGetDefinition::TieNumberAsChoice(), anonymous_namespace{GetInfoCommand.cpp}::ShuttleGuiGetDefinition::TieNumericTextBox(), anonymous_namespace{GetInfoCommand.cpp}::ShuttleGuiGetDefinition::TieSlider(), anonymous_namespace{GetInfoCommand.cpp}::ShuttleGuiGetDefinition::TieSpinCtrl(), anonymous_namespace{GetInfoCommand.cpp}::ShuttleGuiGetDefinition::TieTextBox(), TipWindow::TipWindow(), TagsEditorDialog::TransferDataToWindow(), ComponentInterfaceSymbol::Translation(), NyquistEffect::UnQuote(), EffectDistortion::UpdateControl(), and EffectCompressor::UpdateUI().

Friends And Related Function Documentation

◆ operator!=

bool operator!= ( const TranslatableString x,
const TranslatableString y 
)
friend

Definition at line 350 of file Types.h.

352  { return !(x == y); }

◆ operator==

bool operator== ( const TranslatableString x,
const TranslatableString y 
)
friend

Definition at line 346 of file Types.h.

348  { return x.mMsgid == y.mMsgid; }

◆ Verbatim

TranslatableString Verbatim ( wxString  str)
friend

Definition at line 581 of file Types.h.

582 { return TranslatableString( std::move( str ) ); }

Member Data Documentation

◆ Inaudible

const TranslatableString TranslatableString::Inaudible { wxT("\a") }
static

Definition at line 296 of file Types.h.

Referenced by EffectUIHost::BuildButtonBar(), and EffectPanel::EffectPanel().

◆ mFormatter

Formatter TranslatableString::mFormatter
private

Definition at line 546 of file Types.h.

Referenced by IsVerbatim(), and TranslatableString::PluralTemp< N >::operator()().

◆ mMsgid

wxString TranslatableString::mMsgid
private

Definition at line 545 of file Types.h.

Referenced by std::hash< TranslatableString >::operator()().

◆ NullContextFormatter

const TranslatableString::Formatter TranslatableString::NullContextFormatter
staticprivate
Initial value:
{
[](const wxString & str, TranslatableString::Request request) -> wxString {
switch ( request ) {
default:
return str;
}
}
}

Definition at line 463 of file Types.h.

◆ NullContextName

const wxChar *const TranslatableString::NullContextName = wxT("*")
staticprivate

Definition at line 481 of file Types.h.

Referenced by DoChooseFormat(), and IsVerbatim().


The documentation for this class was generated from the following files:
TranslatableString::Request::Format
@ Format
TranslatableString
Definition: Types.h:290
TranslatableString::DoGetContext
static wxString DoGetContext(const Formatter &formatter)
Definition: Internat.cpp:358
TranslatableString::Context
TranslatableString & Context(const wxString &context) &
Definition: Types.h:398
TranslatableString::Ellipses
@ Ellipses
Definition: Types.h:450
TranslatableString::Request
Request
Definition: Types.h:475
TranslatableString::NullContextFormatter
static const Formatter NullContextFormatter
Definition: Types.h:463
TranslatableString::Request::Context
@ Context
Identifier
Definition: Types.h:64
TranslatableString::Strip
TranslatableString & Strip(unsigned options=MenuCodes) &
Definition: Internat.cpp:324
TranslatableString::DoFormat
wxString DoFormat(bool debug) const
Definition: Types.h:488
TranslatableString::mFormatter
Formatter mFormatter
Definition: Types.h:546
TranslatableString::DoSubstitute
static wxString DoSubstitute(const Formatter &formatter, const wxString &format, const wxString &context, bool debug)
Definition: Internat.cpp:363
TranslatableString::TranslateArgument
static const T & TranslateArgument(const T &arg, bool)
Definition: Types.h:496
format
int format
Definition: ExportPCM.cpp:54
HAS_I18N_CONTEXTS
#define HAS_I18N_CONTEXTS
Definition: Internat.h:171
TranslatableString::Request::DebugFormat
@ DebugFormat
TranslatableString::TranslatableString
TranslatableString()
Definition: Types.h:304
TranslatableString::MenuCodes
@ MenuCodes
Definition: Types.h:449
TranslatableString::mMsgid
wxString mMsgid
Definition: Types.h:545
TranslatableString::Translation
wxString Translation() const
Definition: Types.h:337
TranslatableString::Format
TranslatableString & Format(Args &&...args) &
Definition: Types.h:363
TranslatableString::Join
TranslatableString & Join(TranslatableString arg, const wxString &separator={}) &
Definition: Internat.cpp:393
TranslatableString::Stripped
TranslatableString Stripped(unsigned options=MenuCodes) const
Definition: Types.h:457
TranslatableString::NullContextName
static const wxChar *const NullContextName
Definition: Types.h:481