From ad0ea7798b82cc3a4dfed4c2fce6f2cb1b6805e4 Mon Sep 17 00:00:00 2001 From: Daniel Wilhelm Date: Fri, 18 Apr 2014 16:50:14 +0200 Subject: 1.6 --- library/misc.cpp | 138 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 138 insertions(+) create mode 100644 library/misc.cpp (limited to 'library/misc.cpp') diff --git a/library/misc.cpp b/library/misc.cpp new file mode 100644 index 00000000..2a5c0ec2 --- /dev/null +++ b/library/misc.cpp @@ -0,0 +1,138 @@ +#include "misc.h" +#include +#include +#include "resources.h" + +wxString exchangeEscapeChars(char* temp) +{ + wxString output(temp); + output.Replace("\\\\", "\\"); + output.Replace("\\n", "\n"); + output.Replace("\\t", "\t"); + output.Replace("\"\"", """"); + output.Replace("\\\"", "\""); + return output; +} + + +CustomLocale::CustomLocale() : + wxLocale(), + currentLanguage(wxLANGUAGE_ENGLISH) +{} + + +CustomLocale::~CustomLocale() +{ + //write language to file + ofstream output("lang.dat"); + if (!output) + { + wxMessageBox(wxString(_("Could not write to ")) + "\"" + "lang.dat" + "\"", _("An exception occured!"), wxOK | wxICON_ERROR); + return; + } + output<translation.c_str()); + //fallback + return (szOrigString); +} + -- cgit