From 5760a4b852f059e1a001ebd2f088935d524b7a5b Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Sat, 21 Jul 2012 04:44:47 +0200 Subject: [PATCH] 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. --- code/nel/include/nel/misc/i18n.h | 5 +++++ code/nel/src/misc/i18n.cpp | 8 ++++++++ .../src/plugins/gui_editor/nelgui_widget.cpp | 3 +++ 3 files changed, 16 insertions(+) diff --git a/code/nel/include/nel/misc/i18n.h b/code/nel/include/nel/misc/i18n.h index c41d49735..5f98c5f34 100644 --- a/code/nel/include/nel/misc/i18n.h +++ b/code/nel/include/nel/misc/i18n.h @@ -206,6 +206,8 @@ public: static void hashToUCString(uint64 hash, ucstring &dst); //@} + static void setNoResolution( bool b ){ noResolution = b; } + private: typedef std::map StrMapContainer; @@ -254,6 +256,9 @@ private: TLineFormat lineFmt, bool warnIfIncludesNotFound, TReadContext &readContext); + + // Don't resolve labels + static bool noResolution; }; } // NLMISC diff --git a/code/nel/src/misc/i18n.cpp b/code/nel/src/misc/i18n.cpp index 92da17250..1094d75a7 100644 --- a/code/nel/src/misc/i18n.cpp +++ b/code/nel/src/misc/i18n.cpp @@ -33,6 +33,7 @@ string CI18N::_SelectedLanguageCode; CI18N::ILoadProxy *CI18N::_LoadProxy = 0; vector CI18N::_LanguageCodes; vector 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; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/nelgui_widget.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/nelgui_widget.cpp index e9cf2713b..fe346bb82 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/nelgui_widget.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/nelgui_widget.cpp @@ -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 #include @@ -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 );