From 883e83c8e0141250d267aad1075061b5ca6a2cdb Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Sat, 24 Feb 2007 22:54:19 +0000 Subject: [PATCH] make the code to avoid multiple warnings actually work git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17332 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/messages.C | 7 +++---- src/messages.h | 2 ++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/messages.C b/src/messages.C index bb83e90dfc..3a628fe9bf 100644 --- a/src/messages.C +++ b/src/messages.C @@ -60,7 +60,7 @@ using support::setEnv; // This version use the traditional gettext. Messages::Messages(string const & l) - : lang_(l) + : lang_(l), warned_(false) { if ( lang_.empty() ) { char const * lc_msgs = 0; @@ -107,9 +107,8 @@ docstring const Messages::get(string const & m) const // Since this method gets called for every translatable // buffer string like e.g. "Figure:" we warn only once. #if !defined(_WIN32) && !defined(__CYGWIN__) - bool warned = false; - if (!warned && !lc_msgs) { - warned = true; + if (!warned_ && !lc_msgs) { + warned_ = true; lyxerr << "Locale " << lang_ << " could not be set" << endl; } #endif diff --git a/src/messages.h b/src/messages.h index 166f4601d0..87ebb4025d 100644 --- a/src/messages.h +++ b/src/messages.h @@ -29,6 +29,8 @@ public: private: /// std::string lang_; + /// Did we warn about unavailable locale already? + mutable bool warned_; /// typedef std::map TranslationCache; /// Internal cache for gettext translated strings. -- 2.39.2