X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmessages.C;h=90a345470cbaaac57c0cb2aa09bbb14cdfa914c7;hb=35204f8f33d7400a5fefeffea533fb4cb4097211;hp=2ff381bb9cadb5827ce42e2113154c5e3e7dc381;hpb=2c64f843005306c6294d734cbc15e5c2c81e75bf;p=lyx.git diff --git a/src/messages.C b/src/messages.C index 2ff381bb9c..90a345470c 100644 --- a/src/messages.C +++ b/src/messages.C @@ -32,6 +32,10 @@ using support::setEnv; using std::string; using std::endl; + +static boost::regex const reg("^([^\\[]*)\\[\\[[^\\]]*\\]\\]$"); + + #ifdef ENABLE_NLS @@ -188,7 +192,6 @@ public: // string, otherwise the user sees bogus messages. // If we are unable to honour the request we just // return what we got in. - static boost::regex const reg("^([^\\[]*)\\[\\[[^\\]]*\\]\\]$"); boost::smatch sub; if (regex_match(m, sub, reg)) translated = from_ascii(sub.str(1)); @@ -221,7 +224,12 @@ public: docstring const get(string const & m) const { - return from_ascii(m); + // See comment above + boost::smatch sub; + if (regex_match(m, sub, reg)) + return from_ascii(sub.str(1)); + else + return from_ascii(m); } }; #endif