mirror of
https://github.com/cookiengineer/audacity
synced 2025-11-23 17:30:17 +01:00
TranslatableString has + and +=, and translation of Format arguments
This commit is contained in:
@@ -240,7 +240,7 @@ bool Internat::SanitiseFilename(wxString &name, const wxString &sub)
|
||||
// Special Mac stuff
|
||||
// '/' is permitted in file names as seen in dialogs, even though it is
|
||||
// the path separator. The "real" filename as seen in the terminal has ':'.
|
||||
// Do NOT return true if this is the only subsitution.
|
||||
// Do NOT return true if this is the only substitution.
|
||||
name.Replace(wxT("/"), wxT(":"));
|
||||
#endif
|
||||
|
||||
@@ -325,3 +325,17 @@ wxString TranslatableString::Translation() const
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
TranslatableString &TranslatableString::operator +=(
|
||||
const TranslatableString &arg )
|
||||
{
|
||||
auto prevFormatter = mFormatter;
|
||||
mFormatter = [prevFormatter, arg](const wxString &str){
|
||||
if (str.empty())
|
||||
return prevFormatter ? prevFormatter({}) : wxString{};
|
||||
else
|
||||
return (prevFormatter ? prevFormatter(str) : str)
|
||||
+ arg.Translation();
|
||||
};
|
||||
return *this;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user