From 0f00eef21798520bcfe27ae03b3f1b2ae938ff13 Mon Sep 17 00:00:00 2001
From: Josh Bell <josh@lindenlab.com>
Date: Thu, 1 Nov 2007 23:10:05 +0000
Subject: svn merge -r 71509:72877
 svn+ssh://svn.lindenlab.com/svn/linden/branches/Branch_1-18-4-Viewer -->
 release

Backport patches and translations from RC branch
---
 indra/llui/llmenugl.cpp |   8 +++-
 indra/llui/llui.cpp     | 101 ------------------------------------------------
 indra/llui/llui.h       |   3 --
 3 files changed, 7 insertions(+), 105 deletions(-)

(limited to 'indra/llui')

diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp
index 906b134d2b..8ec5656e18 100644
--- a/indra/llui/llmenugl.cpp
+++ b/indra/llui/llmenugl.cpp
@@ -1239,6 +1239,7 @@ BOOL LLMenuItemBranchGL::handleMouseUp(S32 x, S32 y, MASK mask)
 
 		doIt();
 		make_ui_sound("UISndClickRelease");
+		return TRUE;
 	}
 	return FALSE;
 }
@@ -1550,7 +1551,7 @@ public:
 
 	// LLView functionality
 	virtual BOOL handleMouseDown( S32 x, S32 y, MASK mask );
-	virtual BOOL handleMouseUp( S32 x, S32 y, MASK mask ) {return FALSE; }
+	virtual BOOL handleMouseUp( S32 x, S32 y, MASK mask ); 
 	virtual void draw( void );
 	virtual BOOL handleKeyHere(KEY key, MASK mask, BOOL called_from_parent);
 	
@@ -1674,6 +1675,11 @@ BOOL LLMenuItemBranchDownGL::handleMouseDown( S32 x, S32 y, MASK mask )
 	return TRUE;
 }
 
+BOOL LLMenuItemBranchDownGL::handleMouseUp( S32 x, S32 y, MASK mask )
+{
+	return TRUE;
+}
+
 
 BOOL LLMenuItemBranchDownGL::handleAcceleratorKey(KEY key, MASK mask)
 {
diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp
index 1d2d8a7146..7af0d726cb 100644
--- a/indra/llui/llui.cpp
+++ b/indra/llui/llui.cpp
@@ -67,7 +67,6 @@ const LLColor4 UI_VERTEX_COLOR(1.f, 1.f, 1.f, 1.f);
 BOOL gShowTextEditCursor = TRUE;
 
 // Language for UI construction
-LLString gLanguage = "english-usa";
 std::map<LLString, LLString> gTranslation;
 std::list<LLString> gUntranslated;
 
@@ -1515,104 +1514,6 @@ void gl_segmented_rect_3d_tex_top(const LLVector2& border_scale, const LLVector3
 	gl_segmented_rect_3d_tex(border_scale, border_width, border_height, width_vec, height_vec, ROUNDED_RECT_TOP);
 }
 
-#if 0 // No longer used
-void load_tr(const LLString& lang)
-{
-	LLString inname = "words." + lang + ".txt";
-	LLString filename = gDirUtilp->getExpandedFilename(LL_PATH_SKINS, inname.c_str());
-
-	llifstream file;
-	file.open(filename.c_str(), std::ios_base::binary);	/* Flawfinder: ignore */
-	if (!file)
-	{
-		llinfos << "No translation dictionary for: " << filename << llendl;
-		return;
-	}
-
-	llinfos << "Reading language translation dictionary: " << filename << llendl;
-
-	gTranslation.clear();
-	gUntranslated.clear();
-
-	const S32 MAX_LINE_LEN = 1024;
-	char buffer[MAX_LINE_LEN];	/* Flawfinder: ignore */
-	while (!file.eof())
-	{
-		file.getline(buffer, MAX_LINE_LEN);
-		LLString line(buffer);
-		S32 commentpos = line.find("//");
-		if (commentpos != LLString::npos)
-		{
-			line = line.substr(0, commentpos);
-		}
-		S32 offset = line.find('\t');
-		if (offset != LLString::npos)
-		{
-			LLString english = line.substr(0,offset);
-			LLString translation = line.substr(offset+1);
-			//llinfos << "TR: " << english << " = " << translation << llendl;
-			gTranslation[english] = translation;
-		}
-	}
-
-	file.close();
-}
-
-void init_tr(const LLString& language)
-{
-	if (!language.empty())
-	{
-		gLanguage = language;
-	}
-	load_tr(gLanguage);
-}
-
-void cleanup_tr()
-{
-	// Dump untranslated phrases to help with translation
-	if (gUntranslated.size() > 0)
-	{
-		LLString outname = "untranslated_" + gLanguage + ".txt";
-		LLString outfilename = gDirUtilp->getExpandedFilename(LL_PATH_SKINS, outname.c_str());
-		llofstream outfile;
-		outfile.open(outfilename.c_str());	/* Flawfinder: ignore */
-		if (!outfile)
-		{
-			return;
-		}
-		llinfos << "Writing untranslated words to: " << outfilename << llendl;
-		LLString outtext;
-		for (std::list<LLString>::iterator iter = gUntranslated.begin();
-			 iter != gUntranslated.end(); ++iter)
-		{
-			// output: english_phrase	english_phrase
-			outtext += *iter;
-			outtext += "\t";
-			outtext += *iter;
-			outtext += "\n";
-		}
-		outfile << outtext.c_str();
-		outfile.close();
-	}
-}
-
-LLString tr(const LLString& english_string)
-{
-	std::map<LLString, LLString>::iterator it = gTranslation.find(english_string);
-	if (it != gTranslation.end())
-	{
-		return it->second;
-	}
-	else
-	{
-		gUntranslated.push_back(english_string);
-		return english_string;
-	}
-}
-
-#endif
-
-
 class LLShowXUINamesListener: public LLSimpleListener
 {
 	bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
@@ -1643,12 +1544,10 @@ void LLUI::initClass(LLControlGroup* config,
 
 	LLUI::sShowXUINames = LLUI::sConfigGroup->getBOOL("ShowXUINames");
 	LLUI::sConfigGroup->getControl("ShowXUINames")->addListener(&show_xui_names_listener);
-// 	init_tr(language);
 }
 
 void LLUI::cleanupClass()
 {
-// 	cleanup_tr();
 }
 
 
diff --git a/indra/llui/llui.h b/indra/llui/llui.h
index a947e61af9..b78b046a8c 100644
--- a/indra/llui/llui.h
+++ b/indra/llui/llui.h
@@ -144,9 +144,6 @@ inline void gl_rect_2d_offset_local( const LLRect& rect, S32 pixel_offset, BOOL
 // Used to hide the flashing text cursor when window doesn't have focus.
 extern BOOL gShowTextEditCursor;
 
-// Language
-extern LLString gLanguage;
-
 class LLImageProviderInterface;
 typedef	void (*LLUIAudioCallback)(const LLUUID& uuid);
 
-- 
cgit v1.2.3