summaryrefslogtreecommitdiff
path: root/src/wx/i18n_hook.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2018-12-08 02:12:56 +0000
committerCarl Hetherington <cth@carlh.net>2018-12-08 02:12:56 +0000
commit5869a4b402e16ea735fb6902fe7604ec4d0ec0d4 (patch)
tree5eb6c29217fffd840a68fb3eb9f7e922f04fd8ae /src/wx/i18n_hook.cc
parentd12f444eadb2aafbc61b8b62006d9aa85fc40ba7 (diff)
Add sending of translations via email.v2.13.82
Diffstat (limited to 'src/wx/i18n_hook.cc')
-rw-r--r--src/wx/i18n_hook.cc18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/wx/i18n_hook.cc b/src/wx/i18n_hook.cc
index f7bc4829d..84dcd761f 100644
--- a/src/wx/i18n_hook.cc
+++ b/src/wx/i18n_hook.cc
@@ -24,7 +24,11 @@
#include "lib/cross.h"
#include <wx/wx.h>
#include <boost/bind.hpp>
-#include <boost/filesystem.hpp>
+
+using std::map;
+using std::string;
+
+map<string, string> I18NHook::_translations;
I18NHook::I18NHook (wxWindow* window)
: _window (window)
@@ -40,6 +44,7 @@ I18NHook::handle (wxMouseEvent& ev)
InstantI18NDialog* d = new InstantI18NDialog (_window, get_text());
d->ShowModal();
set_text (d->get());
+ d->Destroy ();
wxWindow* w = _window;
while (w) {
@@ -51,14 +56,5 @@ I18NHook::handle (wxMouseEvent& ev)
ev.Skip ();
- boost::filesystem::path file = "instant_i18n";
-
- FILE* f = fopen_boost (file, "a");
- if (!f) {
- error_dialog (_window, wxString::Format(_("Could not open translation file %s"), std_to_wx(file.string()).data()));
- return;
- }
- fprintf (f, "%s\n", wx_to_std(original).c_str());
- fprintf (f, "%s\n", wx_to_std(get_text()).c_str());
- fclose (f);
+ _translations[wx_to_std(original)] = wx_to_std(get_text());
}