CHANGED: #1471 Added a new property for CI18N noResolution, when it's set the translation labels are not resolved, and it's set while using the GUI Editor.

This commit is contained in:
dfighter1985 2012-07-21 04:44:47 +02:00
parent 6639ed1a81
commit ef2c79cdcb
3 changed files with 16 additions and 0 deletions

View file

@ -206,6 +206,8 @@ public:
static void hashToUCString(uint64 hash, ucstring &dst);
//@}
static void setNoResolution( bool b ){ noResolution = b; }
private:
typedef std::map<std::string, ucstring> StrMapContainer;
@ -254,6 +256,9 @@ private:
TLineFormat lineFmt,
bool warnIfIncludesNotFound,
TReadContext &readContext);
// Don't resolve labels
static bool noResolution;
};
} // NLMISC

View file

@ -33,6 +33,7 @@ string CI18N::_SelectedLanguageCode;
CI18N::ILoadProxy *CI18N::_LoadProxy = 0;
vector<string> CI18N::_LanguageCodes;
vector<ucstring> CI18N::_LanguageNames;
bool CI18N::noResolution = false;
void CI18N::setLoadProxy(ILoadProxy *loadProxy)
{
@ -160,6 +161,13 @@ void CI18N::loadFromFilename(const string &filename, bool reload)
const ucstring &CI18N::get (const string &label)
{
if( noResolution )
{
static ucstring labelString;
labelString = label;
return labelString;
}
if (label.empty())
{
static ucstring emptyString;

View file

@ -21,6 +21,7 @@
#include "nel/gui/interface_group.h"
#include "nel/gui/widget_manager.h"
#include "nel/misc/path.h"
#include "nel/misc/i18n.h"
#include <set>
#include <string>
@ -36,11 +37,13 @@ namespace GUIEditor
NelGUIWidget::~NelGUIWidget()
{
NLGUI::CViewRenderer::release();
NLMISC::CI18N::setNoResolution( false );
}
void NelGUIWidget::init()
{
NLMISC::CI18N::setNoResolution( true );
NLMISC::CPath::remapExtension( "dds", "tga", true );
NLMISC::CPath::remapExtension( "dds", "png", true );
NLMISC::CPath::remapExtension( "png", "tga", true );