mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-25 19:07:45 +00:00
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
This commit is contained in:
parent
b555834103
commit
883e83c8e0
@ -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
|
||||
|
@ -29,6 +29,8 @@ public:
|
||||
private:
|
||||
///
|
||||
std::string lang_;
|
||||
/// Did we warn about unavailable locale already?
|
||||
mutable bool warned_;
|
||||
///
|
||||
typedef std::map<std::string, docstring> TranslationCache;
|
||||
/// Internal cache for gettext translated strings.
|
||||
|
Loading…
Reference in New Issue
Block a user