X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FThesaurus.cpp;h=6e5d80a07d351068aaf4690c760ae81ea10b90d3;hb=2f71fca7df3c7149542cadf577395ecedf82bbf5;hp=14c82f61d3c68605a8ad56393dfc1307b21a32bc;hpb=f630be890494c849981e4fb52ea4740506e92bed;p=lyx.git diff --git a/src/Thesaurus.cpp b/src/Thesaurus.cpp index 14c82f61d3..6e5d80a07d 100644 --- a/src/Thesaurus.cpp +++ b/src/Thesaurus.cpp @@ -12,17 +12,20 @@ #include "Thesaurus.h" +#include "support/gettext.h" + #include "support/lstrings.h" +#include "frontends/alert.h" + #include +using namespace std; namespace lyx { #ifdef HAVE_LIBAIKSAURUS - -using std::sort; -using std::string; +using support::bformat; Thesaurus::Thesaurus() @@ -49,6 +52,18 @@ Thesaurus::Meanings Thesaurus::lookup(docstring const & t) return meanings; string const text = to_ascii(t); + + docstring error = from_ascii(aik_->error()); + if (!error.empty()) { + static bool sent_error = false; + if (!sent_error) { + frontend::Alert::error(_("Thesaurus failure"), + bformat(_("Aiksaurus returned the following error:\n\n%1$s."), + error)); + sent_error = true; + } + return meanings; + } if (!aik_->find(text.c_str())) return meanings;