Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 19, 2010, 2:14:54 AM (14 years ago)
Author:
landauf
Message:

Moved ability to possess descriptions from Executor to ConsoleCommand, since no other executors use this feature. Also simplified this code a little by introducing a new shortcut in Language.h. XMLPort has to use a temporary solution for descriptions without Language support atm.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/consolecommands3/src/libraries/core/Language.cc

    r6417 r7186  
    3636#include <fstream>
    3737#include "util/Debug.h"
     38#include "util/StringUtils.h"
    3839#include "Core.h"
    3940#include "PathConfig.h"
     
    169170        @return The localisation
    170171    */
    171     const std::string& Language::getLocalisation(const LanguageEntryLabel& label) const
     172    const std::string& Language::getLocalisation(const LanguageEntryLabel& label, bool bError) const
    172173    {
    173174        std::map<std::string, LanguageEntry*>::const_iterator it = this->languageEntries_.find(label);
    174175        if (it != this->languageEntries_.end())
    175176            return it->second->getLocalisation();
    176         else
     177        else if (bError)
    177178        {
    178179            // Uh, oh, an undefined entry was requested: return the default string
     
    180181            return this->defaultLocalisation_;
    181182        }
     183        else
     184            return BLANKSTRING;
    182185    }
    183186
Note: See TracChangeset for help on using the changeset viewer.