Index: doc/contributions.txt
===================================================================
--- doc/contributions.txt	(revision 2776)
+++ doc/contributions.txt	(working copy)
@@ -481,6 +481,8 @@
 	CT-352
 Renault Clio
 	VWR-1976
+resu Ampan
+	SNOW-93
 Ringo Tuxing
 	CT-225
 	CT-226
Index: indra/cmake/JsonCpp.cmake
===================================================================
--- indra/cmake/JsonCpp.cmake	(revision 0)
+++ indra/cmake/JsonCpp.cmake	(revision 0)
@@ -0,0 +1,19 @@
+# -*- cmake -*-
+
+include(Prebuilt)
+
+if (STANDALONE)
+  include(FindJsonCpp)
+else (STANDALONE)
+  use_prebuilt_binary(jsoncpp)
+  if (WINDOWS)
+    set(JSONCPP_LIBRARIES 
+      debug json_vc80d
+      optimized json_vc80)
+  elseif (DARWIN)
+    set(JSONCPP_LIBRARIES json_mac-universal-gcc_libmt)
+  elseif (LINUX)
+    set(JSONCPP_LIBRARIES jsoncpp)
+  endif (WINDOWS)
+  set(JSONCPP_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/jsoncpp)
+endif (STANDALONE)
Index: indra/llcommon/llchat.h
===================================================================
--- indra/llcommon/llchat.h	(revision 2776)
+++ indra/llcommon/llchat.h	(working copy)
@@ -79,9 +79,24 @@
 		mMuted(FALSE),
 		mTime(0.0),
 		mPosAgent(),
-		mURL()
+		mURL(),
+		mLanguage()
 	{ }
 	
+	LLChat(const LLChat &chat)
+	:	mText(chat.mText),
+		mFromName(chat.mFromName),
+		mFromID(chat.mFromID),
+		mSourceType(chat.mSourceType),
+		mChatType(chat.mChatType),
+		mAudible(chat.mAudible),
+		mMuted(chat.mMuted),
+		mTime(chat.mTime),
+		mPosAgent(chat.mPosAgent),
+		mURL(chat.mURL),
+		mLanguage(chat.mLanguage)
+	{ }
+
 	std::string		mText;		// UTF-8 line of text
 	std::string		mFromName;	// agent or object name
 	LLUUID			mFromID;	// agent id or object id
@@ -92,6 +107,7 @@
 	F64				mTime;		// viewer only, seconds from viewer start
 	LLVector3		mPosAgent;
 	std::string		mURL;
+	std::string		mLanguage;
 };
 
 #endif
Index: indra/newview/llviewermessage.cpp
===================================================================
--- indra/newview/llviewermessage.cpp	(revision 2776)
+++ indra/newview/llviewermessage.cpp	(working copy)
@@ -135,6 +135,7 @@
 #include "llfloaterworldmap.h"
 #include "llviewerdisplay.h"
 #include "llkeythrottle.h"
+#include "lltranslate.h"
 
 #include <boost/tokenizer.hpp>
 
@@ -2229,7 +2230,87 @@
 	LLNotifications::instance().add("CallingCardDeclined");
 }
 
+class ChatTranslationReceiver : public LLTranslate::TranslationReceiver
+{
+public :
+	ChatTranslationReceiver(const std::string &fromLang, const std::string &toLang, const std::string &mesg, LLChat *chat, 
+		const BOOL history)
+		: LLTranslate::TranslationReceiver(fromLang, toLang, mesg),
+		m_chat(chat),
+		m_history(history)	
+	{
+	}
 
+	static boost::intrusive_ptr<ChatTranslationReceiver> build(const std::string &fromLang, const std::string &toLang, const std::string &mesg, LLChat *chat, const BOOL history)
+	{
+		return boost::intrusive_ptr<ChatTranslationReceiver>(new ChatTranslationReceiver(fromLang, toLang, mesg, chat, history));
+	}
+
+protected:
+	void handleResponse(const std::string &translation, const std::string &detectedLanguage)
+	{		
+		m_chat->mText += m_mesg;
+
+		if (m_toLang != detectedLanguage)
+			m_chat->mText += " (" + translation + ")";			
+
+		add_floater_chat(*m_chat, m_history);
+
+		delete m_chat;
+	}
+
+	void handleFailure()
+	{
+		LLTranslate::TranslationReceiver::handleFailure();
+
+		m_chat->mText += m_mesg;
+
+		m_chat->mText += " (?)";
+
+		add_floater_chat(*m_chat, m_history);
+
+		delete m_chat;
+	}
+
+private:
+	LLChat *m_chat;
+	const BOOL m_history;		
+};
+
+void add_floater_chat(const LLChat &chat, const BOOL history)
+{
+	if (history)
+	{
+		// just add to history
+		LLFloaterChat::addChatHistory(chat);
+	}
+	else
+	{
+		// show on screen and add to history
+		LLFloaterChat::addChat(chat, FALSE, FALSE);
+	}
+}
+
+void check_translate_chat(const std::string &mesg, LLChat &chat, const BOOL history)
+{	
+	const bool translate = LLUI::sConfigGroup->getBOOL("TranslateChat");
+
+	if (translate && chat.mSourceType != CHAT_SOURCE_SYSTEM)
+	{
+		const std::string &fromLang = chat.mLanguage;
+		const std::string &toLang = LLUI::getTranslateLanguage();
+		LLChat *newChat = new LLChat(chat);
+
+		LLHTTPClient::ResponderPtr result = ChatTranslationReceiver::build(fromLang, toLang, mesg, newChat, history);
+		LLTranslate::translate_message(result, fromLang, toLang, mesg);
+	}
+	else
+	{
+		chat.mText += mesg;
+		add_floater_chat(chat, history);
+	}
+}
+
 void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
 {
 	LLChat		chat;
@@ -2243,6 +2324,7 @@
 	LLUUID		owner_id;
 	BOOL		is_owned_by_me = FALSE;
 	LLViewerObject*	chatter;
+	std::string	language;
 
 	msg->getString("ChatData", "FromName", from_name);
 	chat.mFromName = from_name;
@@ -2263,7 +2345,18 @@
 	chat.mAudible = (EChatAudible)audible_temp;
 	
 	chat.mTime = LLFrameTimer::getElapsedSeconds();
-	
+
+	// Empty language value implies automatic language detection.
+	// TODO: Check if the source is an agent to decide whether to
+	// read the language value. Waiting on server fix for this.
+	// if (chat.mSourceType == CHAT_SOURCE_AGENT)
+	int languageSize = msg->getSize(_PREHASH_ChatData, _PREHASH_Language);
+	if (languageSize > 0)
+	{
+		msg->getString(_PREHASH_ChatData, _PREHASH_Language, language);
+		chat.mLanguage = language;
+	}
+
 	BOOL is_busy = gAgent.getBusy();
 
 	BOOL is_muted = FALSE;
@@ -2324,13 +2417,9 @@
 		if (prefix == "/me " || prefix == "/me'")
 		{
 			chat.mText = from_name;
-			chat.mText += mesg.substr(3);
+			mesg = mesg.substr(3);
 			ircstyle = TRUE;
 		}
-		else
-		{
-			chat.mText = mesg;
-		}
 
 		// Look for the start of typing so we can put "..." in the bubbles.
 		if (CHAT_TYPE_START == chat.mChatType)
@@ -2402,7 +2491,6 @@
 
 			chat.mText = from_name;
 			chat.mText += verb;
-			chat.mText += mesg;
 		}
 		
 		if (chatter)
@@ -2429,12 +2517,12 @@
 			&& (is_linden || !is_busy || is_owned_by_me))
 		{
 			// show on screen and add to history
-			LLFloaterChat::addChat(chat, FALSE, FALSE);
+			check_translate_chat(mesg, chat, FALSE);
 		}
 		else
 		{
 			// just add to chat history
-			LLFloaterChat::addChatHistory(chat);
+			check_translate_chat(mesg, chat, TRUE);
 		}
 	}
 }
Index: indra/newview/tests/lltranslate_test.cpp
===================================================================
--- indra/newview/tests/lltranslate_test.cpp	(revision 0)
+++ indra/newview/tests/lltranslate_test.cpp	(revision 0)
@@ -0,0 +1,336 @@
+/**
+* @file lltranslate_test.cpp
+* @brief Tests LLTranslate which translates between human languages.
+*
+* $LicenseInfo:firstyear=2001&license=viewergpl$
+*
+* Copyright (c) 2001-2009, Linden Research, Inc.
+*
+* Second Life Viewer Source Code
+* The source code in this file ("Source Code") is provided by Linden Lab
+* to you under the terms of the GNU General Public License, version 2.0
+* ("GPL"), unless you have obtained a separate licensing agreement
+* ("Other License"), formally executed by you and Linden Lab. Terms of
+* the GPL can be found in doc/GPL-license.txt in this distribution, or
+* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
+*
+* There are special exceptions to the terms and conditions of the GPL as
+* it is applied to this Source Code. View the full text of the exception
+* in the file doc/FLOSS-exception.txt in this software distribution, or
+* online at
+* http://secondlifegrid.net/programs/open_source/licensing/flossexception
+*
+* By copying, modifying or distributing this software, you acknowledge
+* that you have read and understood your obligations described above,
+* and agree to abide by those obligations.
+*
+* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
+* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
+* COMPLETENESS OR PERFORMANCE.
+* $/LicenseInfo$
+*/
+#include "../test/lltut.h"
+#include "../lltranslate.h"
+
+#include "llerror.h"
+#include "llsdhttpserver.h"
+#include "lliohttpserver.h"
+#include "llhttpclient.h"
+#include "indra_constants.h"
+
+namespace tut
+{
+	struct TranslateTestData
+	{
+	public:
+		TranslateTestData()
+		{
+			apr_pool_create(&mPool, NULL);
+			mServerPump = new LLPumpIO(mPool);
+			mClientPump = new LLPumpIO(mPool);
+
+			LLHTTPClient::setPump(*mClientPump);
+		}
+
+		~TranslateTestData()
+		{
+			delete mServerPump;
+			delete mClientPump;
+			apr_pool_destroy(mPool);
+		}
+
+		void setupTheServer()
+		{
+			LLHTTPNode& root = LLIOHTTPServer::create(mPool, *mServerPump, 8888);
+
+			LLHTTPStandardServices::useServices();
+			LLHTTPRegistrar::buildAllServices(root);
+		}
+
+		void runThePump(float timeout = 100.0f)
+		{
+			LLTimer timer;
+			timer.setTimerExpirySec(timeout);			
+			
+			while(!mSawCompleted && !timer.hasExpired())
+			{
+				if (mServerPump)
+				{
+					mServerPump->pump();
+					mServerPump->callback();
+				}
+				if (mClientPump)
+				{
+					mClientPump->pump();
+					mClientPump->callback();
+				}
+			}
+		}
+
+		void killServer()
+		{
+			delete mServerPump;
+			mServerPump = NULL;
+		}
+
+	private:
+		apr_pool_t* mPool;
+		LLPumpIO* mServerPump;
+		LLPumpIO* mClientPump;
+
+	protected:
+		void ensureStatusOK()
+		{
+			if (mSawError)
+			{
+				std::string msg =
+					llformat("error() called when not expected, status %d",
+					mStatus);
+				fail(msg);
+			}
+		}
+
+		void ensureStatusError()
+		{
+			if (!mSawError)
+			{
+				fail("error() wasn't called");
+			}
+		}
+
+		std::string getResult()
+		{
+			return mResult;
+		}
+
+	protected:
+		bool mSawError;
+		U32 mStatus;
+		std::string mReason;
+		bool mSawCompleted;
+		std::string mResult;
+		bool mResultDeleted;
+
+		class TranslationTestReceiver: public LLTranslate::TranslationReceiver
+		{
+		public:
+			TranslationTestReceiver(const std::string &fromLang, const std::string &toLang,
+				const std::string &mesg, TranslateTestData &translationData)
+				: LLTranslate::TranslationReceiver(fromLang, toLang, mesg),
+				mClient(translationData)
+			{
+			}
+
+			~TranslationTestReceiver()
+			{
+				mClient.mResultDeleted = true;
+			}
+
+			virtual void error(U32 status, const std::string& reason)
+			{
+				mClient.mSawError = true;
+				mClient.mStatus = status;
+				mClient.mReason = reason;
+			}
+
+			static boost::intrusive_ptr<TranslationTestReceiver> build(const std::string &fromLang, const std::string &toLang,
+				const std::string &mesg, TranslateTestData &translationData)
+			{
+				return boost::intrusive_ptr<TranslationTestReceiver>(new TranslationTestReceiver(fromLang, toLang, mesg, translationData));
+			}
+
+		protected:
+			void handleResponse(const std::string &translation, const std::string &detectedLanguage)
+			{
+				std::string fromLang = (detectedLanguage.length() > 0 ? detectedLanguage : m_fromLang);
+				LL_INFOS("Translate") << "Translation : " << translation << " (" <<
+					fromLang << ")" << LL_ENDL;
+
+				mClient.mSawCompleted = true;
+				mClient.mResult = translation;
+			}
+		private:
+			TranslateTestData& mClient;
+		};
+
+		friend class TranslationTestReceiver;
+
+	protected:
+		LLHTTPClient::ResponderPtr newResult(const std::string &fromLang, const std::string &toLang, const std::string &mesg)
+		{
+			mSawError = false;
+			mStatus = 0;
+			mSawCompleted = false;
+			mResultDeleted = false;
+
+			return TranslationTestReceiver::build(fromLang, toLang, mesg, *this);
+		}
+	};
+
+	typedef test_group<TranslateTestData> TranslateTestGroup;
+	typedef TranslateTestGroup::object TranslateTestObject;
+	TranslateTestGroup translateTestGroup("translate");
+
+	// Test translation requests aren't throwing an error
+	template<> template<>
+	void TranslateTestObject::test<1>()
+	{
+		std::string fromLang = "en";
+		std::string toLang = "es";
+		std::string mesg = "Hello!";
+
+		setupTheServer();
+		LLTranslate::translate_message(newResult(fromLang, toLang, mesg), fromLang, toLang, mesg);
+		runThePump();
+
+		ensureStatusOK();
+	}
+
+	// Test whether we get a translation back
+	template<> template<>
+	void TranslateTestObject::test<2>()
+	{
+		std::string fromLang = "en";
+		std::string toLang = "es";
+		std::string mesg = "Hello!";
+
+		setupTheServer();
+		LLTranslate::translate_message(newResult(fromLang, toLang, mesg), fromLang, toLang, mesg);
+		runThePump();
+
+		ensureStatusOK();
+		ensure("Translation from English 'Hello!' to Spanish failed, empty string returned",
+			getResult().length() > 0);
+	}
+
+	// Test for a correct translation of an ASCII language
+	template<> template<>
+	void TranslateTestObject::test<3>()
+	{
+		std::string fromLang = "en";
+		std::string toLang = "es";
+		std::string mesg = "Hello!";
+
+		setupTheServer();
+		LLTranslate::translate_message(newResult(fromLang, toLang, mesg), fromLang, toLang, mesg);
+		runThePump();
+		ensureStatusOK();
+
+		ensure("Translation from English 'Hello!' to Spanish failed, expected 'Hola'",
+			getResult() == "Hola!");
+	}
+
+	// Test sending multiple requests simultaneously
+	template<> template<>
+	void TranslateTestObject::test<4>()
+	{
+		setupTheServer();
+		char buff[32];
+		for (int i = 0; i < 5; i++)
+		{
+			std::string fromLang = "en";
+			std::string toLang = "es";
+			sprintf(buff, "Hello %d!", i);
+			std::string mesg = buff;
+
+			LLTranslate::translate_message(newResult(fromLang, toLang, mesg), fromLang, toLang, mesg);
+			runThePump();
+			ensureStatusOK();
+		}
+	}
+
+	// Test 'translating' symbols that may need escaping
+	template<> template<>
+	void TranslateTestObject::test<5>()
+	{
+		std::string fromLang = "en";
+		std::string toLang = "en";
+		std::string mesg = ".?<>,/=&!@#$%^*()-_+[]{};:'\"\\|~`";
+
+		setupTheServer();
+
+		for (unsigned int i = 0; i < mesg.length(); i++)
+		{
+			char c = mesg.at(i);
+			std::stringstream ss;
+			std::string s;
+			ss << c;
+			ss >> s;
+			LLTranslate::translate_message(newResult(fromLang, toLang, s), fromLang, toLang, s);
+			runThePump();
+
+			ensureStatusOK();
+			std::string error = "Translation of symbol '" + s + "' failed, returned '" + getResult() + "'";
+			ensure(error, getResult().compare(s) == 0);
+		}
+	}
+
+	// Test for the correct sending of non ascii languages,
+	// this depends on having a User-Agent header in the URL request
+	template<> template<>
+	void TranslateTestObject::test<6>()
+	{
+		std::string fromLang = "ja";
+		std::string toLang = "en";
+		std::string mesg = "木";
+
+		setupTheServer();
+		LLTranslate::translate_message(newResult(fromLang, toLang, mesg), fromLang, toLang, mesg);
+		runThePump();
+
+		ensureStatusOK();
+		ensure("Translation of non-ascii text failed (Japanese->English) .. expected 'Tree'", getResult() == "Tree");
+	}
+
+	// Test for automatic recognition of a non-ASCII language
+	template<> template<>
+	void TranslateTestObject::test<7>()
+	{
+		std::string fromLang = "";
+		std::string toLang = "en";
+		std::string mesg = "木";
+
+		setupTheServer();
+		LLTranslate::translate_message(newResult(fromLang, toLang, mesg), fromLang, toLang, mesg);
+		runThePump();
+
+		ensureStatusOK();
+		ensure("Translation of non-ascii text failed (Automatic->English) .. expected 'Tree'", getResult() == "Tree");
+	}
+
+	// Test for automatic translation to a non-ASCII language
+	template<> template<>
+	void TranslateTestObject::test<8>()
+	{
+		std::string fromLang = "";
+		std::string toLang = "ja";
+		std::string mesg = "Tree";
+
+		setupTheServer();
+		LLTranslate::translate_message(newResult(fromLang, toLang, mesg), fromLang, toLang, mesg);
+		runThePump();
+
+		ensureStatusOK();
+		ensure("Translation to non-ascii text failed (Automatic->Japanese) .. expected '木'", getResult() == "木");
+	}
+}
Index: indra/newview/llviewermessage.h
===================================================================
--- indra/newview/llviewermessage.h	(revision 2776)
+++ indra/newview/llviewermessage.h	(working copy)
@@ -36,6 +36,7 @@
 #include "llinstantmessage.h"
 #include "lltransactiontypes.h"
 #include "lluuid.h"
+#include "llchat.h"
 #include "stdenums.h"
 
 //
@@ -74,6 +75,9 @@
 void process_script_question(LLMessageSystem *msg, void **user_data);
 void process_chat_from_simulator(LLMessageSystem *mesgsys, void **user_data);
 
+void add_floater_chat(const LLChat &chat, const BOOL history);
+void check_translate_chat(const std::string &mesg, LLChat &chat, const BOOL history);
+
 //void process_agent_to_new_region(LLMessageSystem *mesgsys, void **user_data);
 void send_agent_update(BOOL force_send, BOOL send_reliable = FALSE);
 void process_object_update(LLMessageSystem *mesgsys, void **user_data);
Index: indra/newview/app_settings/settings.xml
===================================================================
--- indra/newview/app_settings/settings.xml	(revision 2776)
+++ indra/newview/app_settings/settings.xml	(working copy)
@@ -5191,6 +5191,28 @@
         <key>Value</key>
             <integer>1</integer>
         </map>
+    <key>TranslateLanguage</key>
+    <map>
+      <key>Comment</key>
+      <string>Translate Language specifier</string>
+      <key>Persist</key>
+      <integer>1</integer>
+      <key>Type</key>
+      <string>String</string>
+      <key>Value</key>
+      <string>default</string>
+    </map>
+    <key>TranslateChat</key>
+    <map>
+        <key>Comment</key>
+            <string>Translate incoming chat messages</string>
+        <key>Persist</key>
+            <integer>1</integer>
+        <key>Type</key>
+            <string>Boolean</string>
+        <key>Value</key>
+            <integer>0</integer>
+    </map>
     <key>LastFeatureVersion</key>
     <map>
       <key>Comment</key>
Index: indra/newview/llprefschat.cpp
===================================================================
--- indra/newview/llprefschat.cpp	(revision 2776)
+++ indra/newview/llprefschat.cpp	(working copy)
@@ -73,6 +73,8 @@
 	BOOL mScriptErrorAsChat;
 	F32	mConsoleOpacity;
 	F32	mBubbleOpacity;
+	std::string mTranslateLanguage;
+	BOOL mTranslateChat;
 };
 
 
@@ -107,6 +109,8 @@
 	childSetValue("play_typing_animation", gSavedSettings.getBOOL("PlayTypingAnim"));
 	childSetValue("console_opacity", gSavedSettings.getF32("ConsoleBackgroundOpacity"));
 	childSetValue("bubble_chat_opacity", gSavedSettings.getF32("ChatBubbleOpacity"));
+	childSetValue("translate_language_combobox", 	gSavedSettings.getString("TranslateLanguage"));
+	childSetValue("translate_chat", 	gSavedSettings.getBOOL("TranslateChat"));
 }
 
 void LLPrefsChatImpl::refreshValues()
@@ -133,6 +137,8 @@
 	mPlayTypingAnim = gSavedSettings.getBOOL("PlayTypingAnim"); 
 	mConsoleOpacity = gSavedSettings.getF32("ConsoleBackgroundOpacity");
 	mBubbleOpacity = gSavedSettings.getF32("ChatBubbleOpacity");
+	mTranslateLanguage = gSavedSettings.getString("TranslateLanguage");
+	mTranslateChat = gSavedSettings.getBOOL("TranslateChat");
 }
 
 void LLPrefsChatImpl::cancel()
@@ -158,6 +164,8 @@
 	gSavedSettings.setBOOL("PlayTypingAnim", mPlayTypingAnim); 
 	gSavedSettings.setF32("ConsoleBackgroundOpacity", mConsoleOpacity);
 	gSavedSettings.setF32("ChatBubbleOpacity", mBubbleOpacity);	
+	gSavedSettings.setString("TranslateLanguage", mTranslateLanguage);	
+	gSavedSettings.setBOOL("TranslateChat", mTranslateChat);
 }
 
 void LLPrefsChatImpl::apply()
@@ -189,6 +197,9 @@
 	gSavedSettings.setF32("ConsoleBackgroundOpacity", childGetValue("console_opacity").asReal());
 	gSavedSettings.setF32("ChatBubbleOpacity", childGetValue("bubble_chat_opacity").asReal());
 
+	gSavedSettings.setString("TranslateLanguage", childGetValue("translate_language_combobox"));
+	gSavedSettings.setBOOL("TranslateChat", childGetValue("translate_chat"));
+
 	refreshValues(); // member values become the official values and cancel becomes a no-op.
 }
 
Index: indra/newview/lltranslate.h
===================================================================
--- indra/newview/lltranslate.h	(revision 0)
+++ indra/newview/lltranslate.h	(revision 0)
@@ -0,0 +1,126 @@
+/**
+* @file lltranslate.h
+* @brief Human language translation class and JSON response receiver.
+*
+* $LicenseInfo:firstyear=2002&license=viewergpl$
+*
+* Copyright (c) 2002-2009, Linden Research, Inc.
+*
+* Second Life Viewer Source Code
+* The source code in this file ("Source Code") is provided by Linden Lab
+* to you under the terms of the GNU General Public License, version 2.0
+* ("GPL"), unless you have obtained a separate licensing agreement
+* ("Other License"), formally executed by you and Linden Lab. Terms of
+* the GPL can be found in doc/GPL-license.txt in this distribution, or
+* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
+*
+* There are special exceptions to the terms and conditions of the GPL as
+* it is applied to this Source Code. View the full text of the exception
+* in the file doc/FLOSS-exception.txt in this software distribution, or
+* online at
+* http://secondlifegrid.net/programs/open_source/licensing/flossexception
+*
+* By copying, modifying or distributing this software, you acknowledge
+* that you have read and understood your obligations described above,
+* and agree to abide by those obligations.
+*
+* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
+* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
+* COMPLETENESS OR PERFORMANCE.
+* $/LicenseInfo$
+*/
+
+#ifndef LL_LLTRANSLATE_H
+#define LL_LLTRANSLATE_H
+
+#include "llhttpclient.h"
+#include "llbufferstream.h"
+#include "jsoncpp/reader.h"
+
+class LLTranslate
+{
+public :
+	class TranslationReceiver: public LLHTTPClient::Responder
+	{
+	protected:
+		TranslationReceiver(const std::string &fromLang, const std::string &toLang, const std::string &mesg)
+			: m_fromLang(fromLang),
+			m_toLang(toLang),
+			m_mesg(mesg)
+		{
+		}
+
+		virtual void handleResponse(const std::string &translation, const std::string &recognizedLang) {}
+		virtual void handleFailure() {};
+
+	public:
+		~TranslationReceiver()
+		{
+		}
+
+		virtual void error(U32 status, const std::string& reason)
+		{
+			LL_WARNS("Translate") << "URL Request error: " << reason << LL_ENDL;
+			handleFailure();
+		}
+
+		virtual void completedRaw(
+			U32 status,
+			const std::string& reason,
+			const LLChannelDescriptors& channels,
+			const LLIOPipe::buffer_ptr_t& buffer)
+		{
+			LLBufferStream istr(channels, buffer.get());
+
+			std::stringstream strstrm;
+			strstrm << istr.rdbuf();
+			const std::string result = strstrm.str();
+
+			std::string translation;
+			std::string detectedLanguage;
+
+			if (!parseGoogleTranslate(result, translation, detectedLanguage))
+			{
+				handleFailure();
+				return;
+			}
+
+			// Fix up the response
+			string_replace_all( translation, "&lt;","<");
+			string_replace_all( translation, "&gt;",">");
+			string_replace_all( translation, "&quot;","\"");
+			string_replace_all( translation, "&#39;","'");
+			string_replace_all( translation, "&amp;","&");
+			string_replace_all( translation, "&apos;","\\");
+
+			handleResponse(translation, detectedLanguage);
+		}
+
+	protected:
+		const std::string m_mesg;
+		const std::string m_toLang;
+		const std::string m_fromLang;
+	};
+
+	static void translate_message(LLHTTPClient::ResponderPtr &result, const std::string &fromLang, const std::string &toLang, const std::string &mesg);
+	static float m_GoogleTimeout;
+
+private:
+	static void get_translate_url(std::string &translateUrl, const std::string &fromLang, const std::string &toLang, const std::string &text);
+	static void string_replace_all(std::string& context, const std::string& from, const std::string& to);
+	static BOOL parseGoogleTranslate(const std::string result, std::string &translation, std::string &detectedLanguage);
+
+	static LLSD m_Header;
+	static const char* m_GoogleURL;
+	static const char* m_GoogleLangSpec;
+	static const char* m_AcceptHeader;
+	static const char* m_AcceptType;
+	static const char* m_AgentHeader;
+	static const char* m_UserAgent;
+
+	static const char* m_GoogleData;
+	static const char* m_GoogleTranslation;
+	static const char* m_GoogleLanguage;
+};
+
+#endif
Index: indra/newview/lltranslate.cpp
===================================================================
--- indra/newview/lltranslate.cpp	(revision 0)
+++ indra/newview/lltranslate.cpp	(revision 0)
@@ -0,0 +1,108 @@
+/**
+* @file lltranslate.cpp
+* @brief Functions for translating text via Google Translate.
+*
+* $LicenseInfo:firstyear=2002&license=viewergpl$
+*
+* Copyright (c) 2002-2009, Linden Research, Inc.
+*
+* Second Life Viewer Source Code
+* The source code in this file ("Source Code") is provided by Linden Lab
+* to you under the terms of the GNU General Public License, version 2.0
+* ("GPL"), unless you have obtained a separate licensing agreement
+* ("Other License"), formally executed by you and Linden Lab. Terms of
+* the GPL can be found in doc/GPL-license.txt in this distribution, or
+* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
+*
+* There are special exceptions to the terms and conditions of the GPL as
+* it is applied to this Source Code. View the full text of the exception
+* in the file doc/FLOSS-exception.txt in this software distribution, or
+* online at
+* http://secondlifegrid.net/programs/open_source/licensing/flossexception
+*
+* By copying, modifying or distributing this software, you acknowledge
+* that you have read and understood your obligations described above,
+* and agree to abide by those obligations.
+*
+* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
+* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
+* COMPLETENESS OR PERFORMANCE.
+* $/LicenseInfo$
+*/
+
+#include "llviewerprecompiledheaders.h"
+
+#include "llbufferstream.h"
+#include "lltranslate.h"
+
+// These two are concatenated with the language specifiers to form a complete Google Translate URL
+const char* LLTranslate::m_GoogleURL = "http://ajax.googleapis.com/ajax/services/language/translate?v=1.0&q=";
+const char* LLTranslate::m_GoogleLangSpec = "&langpair=";
+float LLTranslate::m_GoogleTimeout = 10;
+
+LLSD LLTranslate::m_Header;
+// These constants are for the GET header.
+const char* LLTranslate::m_AcceptHeader = "Accept";
+const char* LLTranslate::m_AcceptType = "Accept: text/plain";
+const char* LLTranslate::m_AgentHeader = "User-Agent";
+const char* LLTranslate::m_UserAgent = "User-Agent: Snowglobe Second Life Viewer";
+
+// These constants are in the JSON returned from Google
+const char* LLTranslate::m_GoogleData = "responseData";
+const char* LLTranslate::m_GoogleTranslation = "translatedText";
+const char* LLTranslate::m_GoogleLanguage = "detectedSourceLanguage";
+
+void LLTranslate::translate_message(LLHTTPClient::ResponderPtr &result, const std::string &fromLang, const std::string &toLang, const std::string &mesg)
+{
+	std::string url;
+	get_translate_url(url, fromLang, toLang, mesg);
+
+	if (!m_Header.size())
+	{
+		m_Header.insert(m_AcceptHeader, LLSD(m_AcceptType));
+		m_Header.insert(m_AgentHeader, LLSD(m_UserAgent));
+	}
+
+	LLHTTPClient::get(url, result, m_Header, m_GoogleTimeout);
+}
+
+void LLTranslate::get_translate_url(std::string &translateUrl, const std::string &fromLang, const std::string &toLang, const std::string &mesg)
+{
+	std::string escaped_mesg = curl_escape(mesg.c_str(), mesg.size());
+
+	translateUrl = m_GoogleURL
+		+ escaped_mesg + m_GoogleLangSpec
+		+ fromLang // 'from' language; empty string for auto
+		+ "%7C" // |
+		+ toLang; // 'to' language
+}
+
+
+void LLTranslate::string_replace_all(std::string& context, const std::string& from, const std::string& to)
+{
+	size_t lookHere = 0;
+	size_t foundHere;
+
+	while((foundHere = context.find(from, lookHere))
+		!= std::string::npos) {
+			context.replace(foundHere, from.size(), to);
+			lookHere = foundHere + to.size();
+	}
+}
+
+
+BOOL LLTranslate::parseGoogleTranslate(const std::string result, std::string &translation, std::string &detectedLanguage)
+{
+	Json::Value root;
+	Json::Reader reader;
+	BOOL parsingSuccessful = reader.parse(result, root );
+	if ( !parsingSuccessful )
+	{
+		LL_WARNS("JSON") << reader.getFormatedErrorMessages() << LL_ENDL;
+		return FALSE;
+	}
+
+	translation = root[m_GoogleData].get(m_GoogleTranslation, "").asString();
+	detectedLanguage = root[m_GoogleData].get(m_GoogleLanguage, "").asString();
+	return TRUE;
+}
Index: indra/newview/skins/default/xui/uk/panel_preferences_chat.xml
===================================================================
--- indra/newview/skins/default/xui/uk/panel_preferences_chat.xml	(revision 2776)
+++ indra/newview/skins/default/xui/uk/panel_preferences_chat.xml	(working copy)
@@ -52,4 +52,62 @@
 	</text>
 	<check_box label="Показувати чат в бульбашці" name="bubble_text_chat"/>
 	<slider label="Прозорість" name="bubble_chat_opacity"/>
+	<combo_box name="translate_language_combobox">
+		<combo_item length="1" name="System Default Language" type="string">
+			За замовчуванням
+		</combo_item>
+		<combo_item name="English">
+			English (Англійська)
+		</combo_item>
+		<combo_item name="Danish">
+			Dansk (Данська) - Beta
+		</combo_item>
+		<combo_item name="Deutsch(German)">
+			Deutsch (Німецька) - Beta
+		</combo_item>
+		<combo_item name="Spanish">
+			Español (Іспанська) - Beta
+		</combo_item>
+		<combo_item name="French">
+			Français (Французька) - Beta
+		</combo_item>
+		<combo_item name="Italian">
+			Italiano (Італійська) - Beta
+		</combo_item>
+		<combo_item name="Hungarian">
+			Magyar (Угорська) - Beta
+		</combo_item>
+		<combo_item name="Dutch">
+			Nederlands (Голландська) - Beta
+		</combo_item>
+		<combo_item name="Polish">
+			Polski (Польська) - Beta
+		</combo_item>
+		<combo_item name="Portugese">
+			Portugués (Португальська) - Beta
+		</combo_item>
+		<combo_item name="Russian">
+			Русский - Beta
+		</combo_item>
+		<combo_item name="Turkish">
+			Türkçe (Турецька) - Beta
+		</combo_item>
+		<combo_item name="Ukrainian">
+			Українська - Beta
+		</combo_item>
+		<combo_item name="Chinese">
+			中文 (简体) (Китайська) - Beta
+		</combo_item>
+		<combo_item name="(Japanese)">
+			日本語 (Японська) - Beta
+		</combo_item>
+		<combo_item name="(Korean)">
+			한국어 (Корейська) - Beta
+		</combo_item>
+	</combo_box>
+	<text type="string" length="1" name="text_chat_language">
+		Чат мову:
+	</text>
+	<text type="string" length="1" name="translate_chat" label="Перевести Чат">
+	</text>
 </panel>
Index: indra/newview/skins/default/xui/zh/panel_preferences_chat.xml
===================================================================
--- indra/newview/skins/default/xui/zh/panel_preferences_chat.xml	(revision 2776)
+++ indra/newview/skins/default/xui/zh/panel_preferences_chat.xml	(working copy)
@@ -68,5 +68,62 @@
 		脚本错误:
 	</text>
 	<check_box label="以聊天形式显示脚本错误和警告" name="script_errors_as_chat" />
-
+	<combo_box name="translate_language_combobox">
+		<combo_item name="System Default Language">
+			系统默认值
+		</combo_item>
+		<combo_item name="English">
+			English （英语）
+		</combo_item>
+		<combo_item name="Danish">
+			Dansk （丹麦）- 测试版
+		</combo_item>
+		<combo_item name="Deutsch(German)">
+			Deutsch （德语）- 测试版
+		</combo_item>
+		<combo_item name="Spanish">
+			Español （西班牙语）- 测试版
+		</combo_item>
+		<combo_item name="French">
+			Français （法语）- 测试版
+		</combo_item>
+		<combo_item name="Italian">
+			Italiano （意大利语）- 测试版
+		</combo_item>
+		<combo_item name="Hungarian">
+			Magyar 马札儿语（匈牙利）- 测试版
+		</combo_item>
+		<combo_item name="Dutch">
+			Nederlands （荷兰语）- 测试版
+		</combo_item>
+		<combo_item name="Polish">
+			Polski （波兰）- 测试版
+		</combo_item>
+		<combo_item name="Portugese">
+			Português （葡萄牙语）- 测试版
+		</combo_item>
+		<combo_item name="Russian">
+			Русский （俄罗斯语）- 测试版
+		</combo_item>
+		<combo_item name="Turkish">
+			Türkçe （土耳其语）- 测试版
+		</combo_item>
+		<combo_item name="Ukrainian">
+			Українська （乌克兰语）- 测试版
+		</combo_item>
+		<combo_item name="Chinese">
+			中文 （简体）- 测试版
+		</combo_item>
+		<combo_item name="(Japanese)">
+			日本語 （日语）- 测试版
+		</combo_item>
+		<combo_item name="(Korean)">
+			한국어 （朝鲜语）- 测试版
+		</combo_item>
+	</combo_box>
+	<text type="string" length="1" name="text_chat_language">
+		聊天語言:
+	</text>
+	<text type="string" length="1" name="translate_chat" label="翻譯聊天">
+	</text>
 </panel>
Index: indra/newview/skins/default/xui/pt/panel_preferences_chat.xml
===================================================================
--- indra/newview/skins/default/xui/pt/panel_preferences_chat.xml	(revision 2776)
+++ indra/newview/skins/default/xui/pt/panel_preferences_chat.xml	(working copy)
@@ -56,4 +56,62 @@
 	</text>
 	<check_box label="Mostrar bolhas do chat" name="bubble_text_chat"/>
 	<slider label="Opacidade" name="bubble_chat_opacity"/>
+	<combo_box name="translate_language_combobox" width="166">
+		<combo_item name="System Default Language">
+			Padrão do Sistema
+		</combo_item>
+		<combo_item name="English">
+			English (Inglês)
+		</combo_item>
+		<combo_item name="Danish">
+			Dansk (Dinamarquês) - Beta
+		</combo_item>
+		<combo_item name="Deutsch(German)">
+			Deutsch (Alemão) - Beta
+		</combo_item>
+		<combo_item name="Spanish">
+			Español (Espanhol) - Beta
+		</combo_item>
+		<combo_item name="French">
+			Français (Francês) - Beta
+		</combo_item>
+		<combo_item name="Italian">
+			Italiano - Beta
+		</combo_item>
+		<combo_item name="Hungarian">
+			Magyar (Húngaro) - Beta
+		</combo_item>
+		<combo_item name="Dutch">
+			Nederlands (Holandês) - Beta
+		</combo_item>
+		<combo_item name="Polish">
+			Polski (Polonês) - Beta
+		</combo_item>
+		<combo_item name="Portugese">
+			Português - Beta
+		</combo_item>
+		<combo_item name="Russian">
+			Русский (Russo) - Beta
+		</combo_item>
+		<combo_item name="Turkish">
+			Türkçe (Turco) - Beta
+		</combo_item>
+		<combo_item name="Ukrainian">
+			Українська (Ucraniano) - Beta
+		</combo_item>
+		<combo_item name="Chinese">
+			中文 (简体) (Chinês) - Beta
+		</combo_item>
+		<combo_item name="(Japanese)">
+			日本語 (Japonês) - Beta
+		</combo_item>
+		<combo_item name="(Korean)">
+			한국어 (Coreano) - Beta
+		</combo_item>
+	</combo_box>
+	<text type="string" length="1" name="text_chat_language">
+		Chat Língua:
+	</text>
+	<text type="string" length="1" name="translate_chat" label="Traduzir Chat">
+	</text>
 </panel>
Index: indra/newview/skins/default/xui/da/panel_preferences_chat.xml
===================================================================
--- indra/newview/skins/default/xui/da/panel_preferences_chat.xml	(revision 2776)
+++ indra/newview/skins/default/xui/da/panel_preferences_chat.xml	(working copy)
@@ -58,4 +58,62 @@
 	</text>
 	<check_box label="Vis chat bobler" name="bubble_text_chat" />
 	<slider label="Gennemsigtighed" name="bubble_chat_opacity" />
+	<combo_box name="translate_language_combobox">
+		<combo_item length="1" name="System Default Language" type="string">
+			System standard
+		</combo_item>
+		<combo_item length="1" name="English" type="string">
+			English (Engelsk)
+		</combo_item>
+		<combo_item length="1" name="Danish" type="string">
+			Dansk - Beta
+		</combo_item>
+		<combo_item length="1" name="Deutsch(German)" type="string">
+			Deutsch (Tysk) - Beta
+		</combo_item>
+		<combo_item length="1" name="Spanish" type="string">
+			Español (Spansk) - Beta
+		</combo_item>
+		<combo_item length="1" name="French" type="string">
+			Français (Fransk) - Beta
+		</combo_item>
+		<combo_item name="Italian">
+			Italiano (Italiensk) - Beta
+		</combo_item>
+		<combo_item length="1" name="Hungarian" type="string">
+			Magyar (Ungarsk) - Beta
+		</combo_item>
+		<combo_item name="Dutch">
+			Nederlands (Hollandsk) - Beta
+		</combo_item>
+		<combo_item length="1" name="Polish" type="string">
+			Polski (Polsk) - Beta
+		</combo_item>
+		<combo_item length="1" name="Portugese" type="string">
+			Portugués (Portugisisk) - Beta
+		</combo_item>
+		<combo_item name="Russian">
+			Русский (Russisk) - Beta
+		</combo_item>
+		<combo_item name="Turkish">
+			Türkçe (Tyrkisk) - Beta
+		</combo_item>
+		<combo_item name="Ukrainian">
+			Українська (Ukrainsk) - Beta
+		</combo_item>
+		<combo_item length="1" name="Chinese" type="string">
+			中文 (简体) (Kinesisk) - Beta
+		</combo_item>
+		<combo_item length="1" name="(Japanese)" type="string">
+			日本語 (Japansk) - Beta
+		</combo_item>
+		<combo_item length="1" name="(Korean)" type="string">
+			한국어 (Koreansk) - Beta
+		</combo_item>
+	</combo_box>
+	<text type="string" length="1" name="text_chat_language">
+		Chat Sprog:
+	</text>
+	<text type="string" length="1" name="translate_chat" label="OversÃ¦t Chat">
+	</text>
 </panel>
Index: indra/newview/skins/default/xui/tr/panel_preferences_chat.xml
===================================================================
--- indra/newview/skins/default/xui/tr/panel_preferences_chat.xml	(revision 2776)
+++ indra/newview/skins/default/xui/tr/panel_preferences_chat.xml	(working copy)
@@ -51,4 +51,62 @@
 	</text>
 	<check_box label="Sohbet baloncuklarını göster" name="bubble_text_chat"/>
 	<slider label="Saydamlık" name="bubble_chat_opacity"/>
+	<combo_box name="translate_language_combobox">
+		<combo_item length="1" name="System Default Language" type="string">
+			Sistem dili
+		</combo_item>
+		<combo_item length="1" name="English" type="string">
+			English (İngilizce)
+		</combo_item>
+		<combo_item name="Danish">
+			Dansk (Danimarkaca) - Beta
+		</combo_item>
+		<combo_item length="1" name="Deutsch(German)" type="string">
+			Deutsch (Almanca) - Beta
+		</combo_item>
+		<combo_item length="1" name="Spanish" type="string">
+			Español (İspanyolca) - Beta
+		</combo_item>
+		<combo_item length="1" name="French" type="string">
+			Français (Fransızca) - Beta
+		</combo_item>
+		<combo_item name="Italian">
+			Italiano (İtalyanca) - Beta
+		</combo_item>
+		<combo_item name="Hungarian">
+			Magyar (Macarca) - Beta
+		</combo_item>
+		<combo_item name="Dutch">
+			Nederlands (Flemenkçe) - Beta
+		</combo_item>
+		<combo_item name="Polish">
+			Polski (Polonyaca) - Beta
+		</combo_item>
+		<combo_item length="1" name="Portugese" type="string">
+			Portugués (Portekizce) - Beta
+		</combo_item>
+		<combo_item name="Russian">
+			Русский (Rusça) - Beta
+		</combo_item>
+		<combo_item length="1" name="Turkish" type="string">
+			Türkçe - Beta
+		</combo_item>
+		<combo_item name="Ukrainian">
+			Українська (Ukraynaca) - Beta
+		</combo_item>
+		<combo_item length="1" name="Chinese" type="string">
+			中文 (简体) (Çince) - Beta
+		</combo_item>
+		<combo_item length="1" name="(Japanese)" type="string">
+			日本語 (Japonca) - Beta
+		</combo_item>
+		<combo_item length="1" name="(Korean)" type="string">
+			한국어 (Korece) - Beta
+		</combo_item>
+	</combo_box>
+	<text type="string" length="1" name="text_chat_language">
+		Sohbet Dili:
+	</text>
+	<text type="string" length="1" name="translate_chat" label="Translate Sohbet">
+	</text>
 </panel>
Index: indra/newview/skins/default/xui/ru/panel_preferences_chat.xml
===================================================================
--- indra/newview/skins/default/xui/ru/panel_preferences_chat.xml	(revision 2776)
+++ indra/newview/skins/default/xui/ru/panel_preferences_chat.xml	(working copy)
@@ -52,4 +52,62 @@
 	</text>
 	<check_box label="Показывать чат в пузыре" name="bubble_text_chat"/>
 	<slider label="Прозрачность" name="bubble_chat_opacity"/>
+	<combo_box name="translate_language_combobox">
+		<combo_item length="1" name="System Default Language" type="string">
+			По умолчанию
+		</combo_item>
+		<combo_item name="English">
+			English (Английский)
+		</combo_item>
+		<combo_item name="Danish">
+			Dansk (Датский) - Beta
+		</combo_item>
+		<combo_item name="Deutsch(German)">
+			Deutsch (Немецкий) - Beta
+		</combo_item>
+		<combo_item name="Spanish">
+			Español (Испанский) - Beta
+		</combo_item>
+		<combo_item name="French">
+			Français (Французский) - Beta
+		</combo_item>
+		<combo_item name="Italian">
+			Italiano (Итальянский) - Beta
+		</combo_item>
+		<combo_item name="Hungarian">
+			Magyar (Венгерский) - Beta
+		</combo_item>
+		<combo_item name="Dutch">
+			Nederlands (Голландский) - Beta
+		</combo_item>
+		<combo_item name="Polish">
+			Polski (Польский) - Beta
+		</combo_item>
+		<combo_item name="Portugese">
+			Portugués (Португальский) - Beta
+		</combo_item>
+		<combo_item name="Russian">
+			Русский - Beta
+		</combo_item>
+		<combo_item name="Turkish">
+			Türkçe (Турецкий) - Beta
+		</combo_item>
+		<combo_item name="Ukrainian">
+			Українська - Beta
+		</combo_item>
+		<combo_item name="Chinese">
+			中文 (简体) (Китайский) - Beta
+		</combo_item>
+		<combo_item name="(Japanese)">
+			日本語 (Японский) - Beta
+		</combo_item>
+		<combo_item name="(Korean)">
+			한국어 (Корейский) - Beta
+		</combo_item>
+	</combo_box>
+	<text type="string" length="1" name="text_chat_language">
+		Чат язык:
+	</text>
+	<text type="string" length="1" name="translate_chat" label="Перевести Чат">
+	</text>
 </panel>
Index: indra/newview/skins/default/xui/en-us/panel_preferences_web.xml
===================================================================
--- indra/newview/skins/default/xui/en-us/panel_preferences_web.xml	(revision 2776)
+++ indra/newview/skins/default/xui/en-us/panel_preferences_web.xml	(working copy)
@@ -20,7 +20,7 @@
 	     v_pad="0" width="128">
 		Browser cache:
 	</text>
-	<button bottom_delta="-10" enabled="true" follows="left|bottom" font="SansSerif"
+	<button bottom_delta="-1" enabled="true" follows="left|top" font="SansSerif"
 	     halign="center" height="22" label="Clear Now" left="140"
 	     mouse_opaque="true" name="clear_cache" scale_image="true" width="85" />
 	<text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
Index: indra/newview/skins/default/xui/en-us/panel_preferences_general.xml
===================================================================
--- indra/newview/skins/default/xui/en-us/panel_preferences_general.xml	(revision 2776)
+++ indra/newview/skins/default/xui/en-us/panel_preferences_general.xml	(working copy)
@@ -2,7 +2,7 @@
 <panel border="true" bottom="-409" enabled="true" follows="left|top|right|bottom"
      height="408" label="General" left="102" mouse_opaque="true"
      name="general_panel" width="517">
-  <radio_group bottom="-45" draw_border="false" follows="left|bottom" height="40" left="151"
+  <radio_group bottom="-45" draw_border="false" follows="left|top" height="40" left="151"
 	     name="default_start_location" width="220">
     <radio_item bottom="-20" height="20" left="0" name="MyHome" width="50"
 		  tool_tip="Log into my home location by default.">
@@ -139,7 +139,7 @@
 		Crash reports:
 	</text>
 	<text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
-	     bottom="-384" drop_shadow_visible="true" enabled="true" follows="left|top"
+	     bottom="-394" drop_shadow_visible="true" enabled="true" follows="left|top"
 	     font="SansSerifSmall" h_pad="0" halign="left" height="18" left="10"
 	     mouse_opaque="true" name="language_textbox" v_pad="0" width="394">
 		Language:
@@ -151,24 +151,8 @@
 	     v_pad="0" width="400">
 		(Requires restart for full effect)
 	</text>
-	<string name="region_name_prompt">
-		&lt;Type region name&gt;
-	</string>
-	<combo_box allow_text_entry="false" bottom="-362" enabled="true" follows="left|top"
-	     height="18" left="153" max_chars="20" mouse_opaque="true"
-	     name="crash_behavior_combobox" width="146">
-		<combo_item type="string" length="1" enabled="true" name="Askbeforesending" value="Ask before sending">
-			Ask before sending
-		</combo_item>
-		<combo_item type="string" length="1" enabled="true" name="Alwayssend" value="Always send">
-			Always send
-		</combo_item>
-		<combo_item type="string" length="1" enabled="true" name="Neversend" value="Never send">
-			Never send
-		</combo_item>
-	</combo_box>
-	<combo_box allow_text_entry="true" bottom="-382" enabled="true"
-	     follows="left|bottom" height="16" left="153" max_chars="135"
+	<combo_box allow_text_entry="true" bottom="-394" enabled="true"
+	     follows="left|top" height="16" left="153" max_chars="135"
 	     mouse_opaque="true" name="language_combobox" width="146">
 		<combo_item type="string" length="1" enabled="true" name="System Default Language" value="default">
 			System Default
@@ -225,7 +209,23 @@
 			한국어 (Korean) - Beta
 		</combo_item>
 	</combo_box>
-	<check_box bottom="-400" enabled="true"
+	<string name="region_name_prompt">
+		&lt;Type region name&gt;
+	</string>
+	<combo_box allow_text_entry="false" bottom="-362" enabled="true" follows="left|top"
+	     height="18" left="153" max_chars="20" mouse_opaque="true"
+	     name="crash_behavior_combobox" width="146">
+		<combo_item type="string" length="1" enabled="true" name="Askbeforesending" value="Ask before sending">
+			Ask before sending
+		</combo_item>
+		<combo_item type="string" length="1" enabled="true" name="Alwayssend" value="Always send">
+			Always send
+		</combo_item>
+		<combo_item type="string" length="1" enabled="true" name="Neversend" value="Never send">
+			Never send
+		</combo_item>
+	</combo_box>
+	<check_box bottom="-415" enabled="true"
 	     follows="left|top" font="SansSerifSmall" height="16" hidden="false"
 	     initial_value="false" label="Share language with objects" left="151"
 	     mouse_opaque="true" name="language_is_public"
Index: indra/newview/skins/default/xui/en-us/floater_preferences.xml
===================================================================
--- indra/newview/skins/default/xui/en-us/floater_preferences.xml	(revision 2776)
+++ indra/newview/skins/default/xui/en-us/floater_preferences.xml	(working copy)
@@ -1,28 +1,28 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <floater bottom="-666" can_close="true" can_drag_on_left="false" can_minimize="true"
      can_resize="false" can_tear_off="true" default_tab_group="1" enabled="true"
-     height="460" left="330" min_height="213" min_width="324"
+     height="510" left="330" min_height="213" min_width="324"
      mouse_opaque="true" name="Preferences" title="Preferences" width="620">
-	<button bottom="-455" enabled="true" follows="right|bottom" font="SansSerif"
+	<button bottom="-505" enabled="true" follows="right|bottom" font="SansSerif"
 	     halign="center" height="20" label="OK" label_selected="OK" left="335"
 	     mouse_opaque="true" name="OK" scale_image="true" width="90" />
-	<button bottom="-455" enabled="true" follows="right|bottom" font="SansSerif"
+	<button bottom="-505" enabled="true" follows="right|bottom" font="SansSerif"
 	     halign="center" height="20" label="Cancel" label_selected="Cancel"
 	     left_delta="93" mouse_opaque="true" name="Cancel" scale_image="true"
 	     width="90" />
-	<button bottom="-455" enabled="true" follows="right|bottom" font="SansSerif"
+	<button bottom="-505" enabled="true" follows="right|bottom" font="SansSerif"
 	     halign="center" height="20" label="Apply" label_selected="Apply"
 	     left_delta="93" mouse_opaque="true" name="Apply" scale_image="true"
 	     width="90" />
-	<button bottom="-455" enabled="true" follows="left|bottom" font="SansSerif"
+	<button bottom="-505" enabled="true" follows="left|bottom" font="SansSerif"
 	     halign="center" height="20" label="About" label_selected="About" left="9"
 	     mouse_opaque="true" name="About..." scale_image="true" width="90" />
-	<button bottom="-455" enabled="true" follows="left|bottom" font="SansSerif"
+	<button bottom="-505" enabled="true" follows="left|bottom" font="SansSerif"
 	     halign="center" height="20"
 	     help_url="http://secondlife.com/app/help/technical/preferences.php"
 	     label="Help" label_selected="Help" left_delta="93" mouse_opaque="true"
 	     name="Help" scale_image="true" width="90" />
-	<tab_container bottom="-431" enabled="true" follows="left|top|right|bottom" height="410"
+	<tab_container bottom="-466" enabled="true" follows="left|top|right|bottom" height="445"
 	     left="0" mouse_opaque="false" name="pref core" tab_group="1"
 	     tab_position="left" tab_width="120" width="620" />
 </floater>
Index: indra/newview/skins/default/xui/en-us/panel_preferences_chat.xml
===================================================================
--- indra/newview/skins/default/xui/en-us/panel_preferences_chat.xml	(revision 2776)
+++ indra/newview/skins/default/xui/en-us/panel_preferences_chat.xml	(working copy)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
-<panel border="true" bottom="-409" enabled="true" follows="left|top|right|bottom"
-    height="408" label="Text Chat" left="102" mouse_opaque="true" name="chat"
+<panel border="true" bottom="-499" enabled="true" follows="left|top|right|bottom"
+    height="548" label="Text Chat" left="102" mouse_opaque="true" name="chat"
     width="517">
 	<text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
 	     bottom="-20" drop_shadow_visible="true" enabled="true" follows="left|top"
@@ -154,4 +154,73 @@
 	     increment="0.05" initial_val="1" label="Opacity" left="148" max_val="1"
 	     min_val="0" mouse_opaque="true" name="bubble_chat_opacity" show_text="true"
 	     value="0.5" width="200" />
+
+	<text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
+	     bottom="-410" drop_shadow_visible="true" enabled="true" follows="left|top"
+	     font="SansSerifSmall" h_pad="0" halign="left" height="10" left="12"
+	     mouse_opaque="false" name="text_chat_language" v_pad="0" width="128">
+		Chat Language:
+	</text>
+	<combo_box allow_text_entry="true" bottom="-417" enabled="true"
+	     follows="left|top" height="16" left="148" max_chars="135"
+	     mouse_opaque="true" name="translate_language_combobox" width="146">
+		<combo_item type="string" length="1" enabled="true" name="System Default Language" value="default">
+			System Default
+		</combo_item>
+		<combo_item type="string" length="1" enabled="true" name="English" value="en">
+			English
+		</combo_item>
+		
+		<!-- After "System Default" and "English", please keep the rest of these combo_items in alphabetical order by the first character in the string. -->
+		
+		<combo_item type="string" length="1" enabled="true" name="Danish" value="da">
+			Dansk (Danish) - Beta
+		</combo_item>
+		<combo_item type="string" length="1" enabled="true" name="Deutsch(German)" value="de">
+			Deutsch (German) - Beta
+		</combo_item>
+		<combo_item type="string" length="1" enabled="true" name="Spanish" value="es">
+			Espaol (Spanish) - Beta
+		</combo_item>
+		<combo_item type="string" length="1" enabled="true" name="French" value="fr">
+			Fran�ais (French) - Beta
+		</combo_item>
+		<combo_item type="string" length="1" enabled="true" name="Italian" value="it">
+			Italiano (Italian) - Beta
+		</combo_item>
+		<combo_item type="string" length="1" enabled="true" name="Hungarian" value="hu">
+			Magyar (Hungarian) - Beta
+		</combo_item>
+		<combo_item type="string" length="1" enabled="true" name="Dutch" value="nl">
+			Nederlands (Dutch) - Beta
+		</combo_item>
+		<combo_item type="string" length="1" enabled="true" name="Polish" value="pl">
+			Polski (Polish) - Beta
+		</combo_item>
+		<combo_item type="string" length="1" enabled="true" name="Portugese" value="pt">
+			Portugu�s (Portuguese) - Beta
+		</combo_item>
+ 		<combo_item type="string" length="1" enabled="true" name="Russian" value="ru">
+ 			??????? (Russian) - Beta
+ 		</combo_item>
+		<combo_item type="string" length="1" enabled="true" name="Turkish" value="tr">
+			T�rk�e (Turkish) - Beta
+		</combo_item>
+ 		<combo_item type="string" length="1" enabled="true" name="Ukrainian" value="uk">
+ 			?????????? (Ukrainian) - Beta
+ 		</combo_item>
+		<combo_item type="string" length="1" enabled="true" name="Chinese" value="zh">
+			?? (??) (Chinese) - Beta
+		</combo_item>
+		<combo_item type="string" length="1" enabled="true" name="(Japanese)" value="ja">
+			??? (Japanese) - Beta
+		</combo_item>
+		<combo_item type="string" length="1" enabled="true" name="(Korean)" value="ko">
+			??? (Korean) - Beta
+		</combo_item>
+	</combo_box>
+	<check_box bottom="-440" control_name="TranslateChat" enabled="true" follows="left|top"
+	     font="SansSerifSmall" height="16" initial_value="false"
+	     label="Translate chat" left="148" mouse_opaque="true"
+	     name="translate_chat" radio_style="false" width="237" />
 </panel>
Index: indra/newview/skins/default/xui/en-us/panel_preferences_network.xml
===================================================================
--- indra/newview/skins/default/xui/en-us/panel_preferences_network.xml	(revision 2776)
+++ indra/newview/skins/default/xui/en-us/panel_preferences_network.xml	(working copy)
@@ -38,7 +38,7 @@
 	     v_pad="0" width="40">
 		MB
 	</text>
-	<button bottom="-55" bottom_delta="-4" enabled="true" follows="left|bottom"
+	<button bottom="-55" bottom_delta="-4" enabled="true" follows="left|top"
 	     font="SansSerif" halign="center" height="22" label="Clear Cache" left="340"
 	     left_delta="30" mouse_opaque="true" name="clear_cache" scale_image="true"
 	     width="100" />
Index: indra/newview/skins/default/xui/de/panel_preferences_chat.xml
===================================================================
--- indra/newview/skins/default/xui/de/panel_preferences_chat.xml	(revision 2776)
+++ indra/newview/skins/default/xui/de/panel_preferences_chat.xml	(working copy)
@@ -56,4 +56,62 @@
 	</text>
 	<check_box label="Skriptfehler und Warnungen als normalen Chat anzeigen" name="script_errors_as_chat"/>
 	<color_swatch label="Fehler" name="script_error"/>
+	<combo_box name="translate_language_combobox" width="166">
+		<combo_item name="System Default Language">
+			Betriebssystem-Einstellung
+		</combo_item>
+		<combo_item name="English">
+			English (Englisch)
+		</combo_item>
+		<combo_item name="Danish">
+			Danks (Dänisch) - Beta
+		</combo_item>
+		<combo_item name="Deutsch(German)">
+			Deutsch - Beta
+		</combo_item>
+		<combo_item name="Spanish">
+			Español (Spanisch) - Beta
+		</combo_item>
+		<combo_item name="French">
+			Français (Französisch) - Beta
+		</combo_item>
+		<combo_item name="Italian">
+			Italiano (Italienisch) - Beta
+		</combo_item>
+		<combo_item name="Hungarian">
+			Magyar (Ungarisch) - Beta
+		</combo_item>
+		<combo_item name="Dutch">
+			Nederlands (Niederländisch) - Beta
+		</combo_item>
+		<combo_item name="Polish">
+			Polski (Polnisch) - Beta
+		</combo_item>
+		<combo_item name="Portugese">
+			Português (Portugiesisch) - Beta
+		</combo_item>
+		<combo_item name="Russian">
+			Русский (Russian) - Beta
+		</combo_item>
+		<combo_item name="Turkish">
+			Türkçe (Türkisch) - Beta
+		</combo_item>
+		<combo_item name="Ukrainian">
+			Українська (Ukrainisch) - Beta
+		</combo_item>
+		<combo_item name="Chinese">
+			中文 (简体) (Chinesisch) - Beta
+		</combo_item>
+		<combo_item name="(Japanese)">
+			日本語 (Japanisch) - Beta
+		</combo_item>
+		<combo_item name="(Korean)">
+			한국어 (Koreanisch) - Beta
+		</combo_item>
+	</combo_box>
+	<text type="string" length="1" name="text_chat_language">
+		Chat-Sprache:
+	</text>
+	<text type="string" length="1" name="translate_chat" label="Übersetzen Chat">
+	</text>
 </panel>
Index: indra/newview/skins/default/xui/ja/panel_preferences_chat.xml
===================================================================
--- indra/newview/skins/default/xui/ja/panel_preferences_chat.xml	(revision 2776)
+++ indra/newview/skins/default/xui/ja/panel_preferences_chat.xml	(working copy)
@@ -55,4 +55,62 @@
 	</text>
 	<check_box label="スクリプト・エラーと警告をチャット同様に表示" name="script_errors_as_chat"/>
 	<color_swatch label="エラー" name="script_error"/>
+	<combo_box name="translate_language_combobox">
+		<combo_item length="1" name="System Default Language" type="string">
+			システム・デフォルト
+		</combo_item>
+		<combo_item length="1" name="English" type="string">
+			English (英語)
+		</combo_item>
+		<combo_item length="1" name="Danish" type="string">
+			Dansk (デンマーク語) – ベータ
+		</combo_item>
+		<combo_item length="1" name="Deutsch(German)" type="string">
+			Deutsch (ドイツ語) – ベータ
+		</combo_item>
+		<combo_item length="1" name="Spanish" type="string">
+			Español (スペイン語) – ベータ
+		</combo_item>
+		<combo_item length="1" name="French" type="string">
+			Français (フランス語) – ベータ
+		</combo_item>
+		<combo_item name="Italian">
+			Italiano （イタリア語） - ベータ
+		</combo_item>
+		<combo_item name="Hungarian">
+			Magyar (ハンガリー語) - ベータ
+		</combo_item>
+		<combo_item name="Dutch">
+			Nederlands （オランダ語） - ベータ
+		</combo_item>
+		<combo_item name="Polish">
+			Polski (ポーランド語) - ベータ
+		</combo_item>
+		<combo_item length="1" name="Portugese" type="string">
+			Português (ポルトガル語) – ベータ
+		</combo_item>
+		<combo_item name="Russian">
+			Русский (ロシア語) - ベータ
+		</combo_item>
+		<combo_item name="Turkish">
+			Türkçe （トルコ語） - ベータ
+		</combo_item>
+		<combo_item name="Ukrainian">
+			Українська (ウクライナ語) - ベータ
+		</combo_item>
+		<combo_item length="1" name="Chinese" type="string">
+			中文 (简体) (中国語) - ベータ
+		</combo_item>
+		<combo_item length="1" name="(Japanese)" type="string">
+			日本語 – ベータ
+		</combo_item>
+		<combo_item length="1" name="(Korean)" type="string">
+			한국어 (韓国語) – ベータ
+		</combo_item>
+	</combo_box>
+	<text type="string" length="1" name="text_chat_language">
+		チャット言語:
+	</text>
+	<text type="string" length="1" name="translate_chat" label="翻訳チャット">
+	</text>
 </panel>
Index: indra/newview/skins/default/xui/es/panel_preferences_chat.xml
===================================================================
--- indra/newview/skins/default/xui/es/panel_preferences_chat.xml	(revision 2776)
+++ indra/newview/skins/default/xui/es/panel_preferences_chat.xml	(working copy)
@@ -55,4 +55,62 @@
 	</text>
 	<check_box label="Mostrar el chat en bocadillos" name="bubble_text_chat"/>
 	<slider label="Opacidad" name="bubble_chat_opacity"/>
+	<combo_box name="translate_language_combobox" width="166">
+		<combo_item name="System Default Language">
+			Predeterminado del sistema
+		</combo_item>
+		<combo_item length="1" name="English" type="string">
+			English (Inglés)
+		</combo_item>
+		<combo_item name="Danish">
+			Dansk (Danés) - Beta
+		</combo_item>
+		<combo_item length="1" name="Deutsch(German)" type="string">
+			Deutsch (Alemán) - Beta
+		</combo_item>
+		<combo_item name="Spanish" type="string">
+			Español - Beta
+		</combo_item>
+		<combo_item length="1" name="French" type="string">
+			Français (Francés) - Beta
+		</combo_item>
+		<combo_item name="Italian">
+			Italiano - Beta
+		</combo_item>
+		<combo_item name="Hungarian">
+			Magyar (Húngaro) - Beta
+		</combo_item>
+		<combo_item name="Dutch">
+			Nederlands (Neerlandés) - Beta
+		</combo_item>
+		<combo_item name="Polish">
+			Polski (Polaco) - Beta
+		</combo_item>
+		<combo_item name="Portugese">
+			Portugués (Portugués) - Beta
+		</combo_item>
+		<combo_item name="Russian">
+			Русский (Ruso) - Beta
+		</combo_item>
+		<combo_item name="Turkish">
+			Türkçe (Turco) - Beta
+		</combo_item>
+		<combo_item name="Ukrainian">
+			Українська (Ucraniano) - Beta
+		</combo_item>
+		<combo_item length="1" name="Chinese" type="string">
+			中文 (简体) (Chino) - Beta
+		</combo_item>
+		<combo_item length="1" name="(Japanese)" type="string">
+			日本語 (Japonés) - Beta
+		</combo_item>
+		<combo_item length="1" name="(Korean)" type="string">
+			한국어 (Coreano) - Beta
+		</combo_item>
+	</combo_box>
+	<text type="string" length="1" name="text_chat_language">
+		Idioma de chat:
+	</text>
+	<text type="string" length="1" name="translate_chat" label="Traducir Chat">	
+	</text>
 </panel>
Index: indra/newview/skins/default/xui/fr/panel_preferences_chat.xml
===================================================================
--- indra/newview/skins/default/xui/fr/panel_preferences_chat.xml	(revision 2776)
+++ indra/newview/skins/default/xui/fr/panel_preferences_chat.xml	(working copy)
@@ -56,4 +56,63 @@
 		Erreurs de script :
 	</text>
 	<check_box label="Afficher les erreurs dans le chat" name="script_errors_as_chat"/>
+
+	<combo_box name="translate_language_combobox" width="166">
+		<combo_item name="System Default Language">
+			Choix par défaut
+		</combo_item>
+		<combo_item length="1" name="English" type="string">
+			English (Anglais)
+		</combo_item>
+		<combo_item length="1" name="Danish" type="string">
+			Dansk (Danois) - Bêta
+		</combo_item>
+		<combo_item length="1" name="Deutsch(German)" type="string">
+			Deutsch (Allemand) - Bêta
+		</combo_item>
+		<combo_item name="Spanish">
+			Español (Espagnol) - Bêta
+		</combo_item>
+		<combo_item name="French">
+			Français - Bêta
+		</combo_item>
+		<combo_item name="Italian">
+			Italiano (Italien) - Bêta
+		</combo_item>
+		<combo_item name="Hungarian">
+			Magyar (Hongrois) - Bêta
+		</combo_item>
+		<combo_item name="Dutch">
+			Nederlands (Néerlandais) - Bêta
+		</combo_item>
+		<combo_item name="Polish">
+			Polski (Polonais) - Bêta
+		</combo_item>
+		<combo_item name="Portugese">
+			Portugués (Portugais) - Bêta
+		</combo_item>
+		<combo_item name="Russian">
+			Русский (Russe) - Bêta
+		</combo_item>
+		<combo_item name="Turkish">
+			Türkçe (Turc) - Bêta
+		</combo_item>
+		<combo_item name="Ukrainian">
+			Українська (Ukrainien) - Bêta
+		</combo_item>
+		<combo_item length="1" name="Chinese" type="string">
+			中文 (简体) (Chinois) - Bêta
+		</combo_item>
+		<combo_item length="1" name="(Japanese)" type="string">
+			日本語 (Japonais) - Bêta
+		</combo_item>
+		<combo_item length="1" name="(Korean)" type="string">
+			한국어 (Coréen) - Bêta
+		</combo_item>
+	</combo_box>
+	<text type="string" length="1" name="text_chat_language">
+		Langue de chat :
+	</text>
+	<text type="string" length="1" name="translate_chat" label="Traduire Chat">
+	</text>
 </panel>
Index: indra/newview/skins/default/xui/ko/panel_preferences_chat.xml
===================================================================
--- indra/newview/skins/default/xui/ko/panel_preferences_chat.xml	(revision 2776)
+++ indra/newview/skins/default/xui/ko/panel_preferences_chat.xml	(working copy)
@@ -55,4 +55,38 @@
 	</text>
 	<check_box label="스크립트 오류 및 경고를 일반 채팅으로 표시하기" name="script_errors_as_chat"/>
 	<color_swatch label="오류" name="script_error"/>
+	<combo_box name="translate_language_combobox">
+		<combo_item type="string" length="1" name="System Default Language">
+			시스템 기본값
+		</combo_item>
+		<combo_item type="string" length="1" name="English">
+			English (영어)
+		</combo_item>
+		<combo_item type="string" length="1" name="Chinese">
+			中文 (简体) (중국어) - 베타
+		</combo_item>
+		<combo_item type="string" length="1" name="Deutsch(German)">
+			Deutsch (독일어) - 베타
+		</combo_item>
+		<combo_item type="string" length="1" name="French">
+			Français (불어) - 베타
+		</combo_item>
+		<combo_item type="string" length="1" name="(Japanese)">
+			日本語 (일본어) - 베타
+		</combo_item>
+		<combo_item type="string" length="1" name="(Korean)">
+			한국어 - 베타
+		</combo_item>
+		<combo_item type="string" length="1" name="Portugese">
+			Português(포르투갈어) - 베타
+		</combo_item>
+		<combo_item type="string" length="1" name="Spanish">
+			Español (스페인어) - 베타
+		</combo_item>
+	</combo_box>
+	<text type="string" length="1" name="text_chat_language">
+		채팅 언어:
+	</text>
+	<text type="string" length="1" name="translate_chat" label="채팅 번역기">
+	</text>
 </panel>
Index: indra/newview/skins/default/xui/pl/panel_preferences_chat.xml
===================================================================
--- indra/newview/skins/default/xui/pl/panel_preferences_chat.xml	(revision 2776)
+++ indra/newview/skins/default/xui/pl/panel_preferences_chat.xml	(working copy)
@@ -54,4 +54,62 @@
 	</text>
   <check_box label="Pokazuj chmurki w czacie" name="bubble_text_chat" />
   <slider label="Przeźroczystość" name="bubble_chat_opacity" />
+	<combo_box name="translate_language_combobox">
+		<combo_item length="1" name="System Default Language" type="string">
+			Domyślny
+		</combo_item>
+		<combo_item length="1" name="English" type="string">
+			English (Angielski)
+		</combo_item>
+		<combo_item name="Danish">
+			Dansk (Duński) - Beta
+		</combo_item>
+		<combo_item length="1" name="Deutsch(German)" type="string">
+			Deutsch (Niemiecki) - Beta
+		</combo_item>
+		<combo_item length="1" name="Spanish" type="string">
+			Español (Hiszpański) - Beta
+		</combo_item>
+		<combo_item length="1" name="French" type="string">
+			Français (Francuski) - Beta
+		</combo_item>
+		<combo_item name="Italian">
+			Italiano (Włoski) - Beta
+		</combo_item>
+		<combo_item name="Hungarian">
+			Magyar (Węgierski) - Beta
+		</combo_item>
+		<combo_item name="Dutch">
+			Nederlands (Niderlandzki) - Beta
+		</combo_item>
+		<combo_item length="1" name="Polish" type="string">
+			Polski - Beta
+		</combo_item>
+		<combo_item length="1" name="Portugese" type="string">
+			Portugués (Portugalski) - Beta
+		</combo_item>
+		<combo_item name="Russian">
+			Русский (Rosyjski) - Beta
+		</combo_item>
+		<combo_item name="Turkish">
+			Türkçe (Turecki) - Beta
+		</combo_item>
+		<combo_item name="Ukrainian">
+			Українська (Ukraiński) - Beta
+		</combo_item>
+		<combo_item length="1" name="Chinese" type="string">
+			中文 (简体) (Chiński) - Beta
+		</combo_item>
+		<combo_item length="1" name="(Japanese)" type="string">
+			日本語 (Japoński) - Beta
+		</combo_item>
+		<combo_item length="1" name="(Korean)" type="string">
+			한국어 (Koreański) - Beta
+		</combo_item>
+	</combo_box>
+	<text type="string" length="1" name="text_chat_language">
+		Czat Język:
+	</text>
+	<text type="string" length="1" name="translate_chat" label="Przetłumacz Czat">
+	</text>
 </panel>
Index: indra/newview/skins/default/xui/hu/panel_preferences_chat.xml
===================================================================
--- indra/newview/skins/default/xui/hu/panel_preferences_chat.xml	(revision 2776)
+++ indra/newview/skins/default/xui/hu/panel_preferences_chat.xml	(working copy)
@@ -59,4 +59,62 @@
 	<check_box label="Szöveges üzenetek buborék jellegű megjelenítése"
 	     name="bubble_text_chat" />
 	<slider label="Átlátszóság" name="bubble_chat_opacity" />
+	<combo_box name="translate_language_combobox" width="166">
+		<combo_item length="1" name="System Default Language" type="string">
+			Alapértelmezett
+		</combo_item>
+		<combo_item length="1" name="English" type="string">
+			English
+		</combo_item>
+		<combo_item name="Danish">
+			Dansk (Dán) - Beta
+		</combo_item>
+		<combo_item length="1" name="Deutsch(German)" type="string">
+			Deutsch (German) - Beta
+		</combo_item>
+		<combo_item length="1" name="Spanish" type="string">
+			Español (Spanish) - Beta
+		</combo_item>
+		<combo_item length="1" name="French" type="string">
+			Français (French) - Beta
+		</combo_item>
+		<combo_item name="Italian">
+			Italiano (Olasz) - Beta
+		</combo_item>
+		<combo_item length="1" name="Hungarian" type="string">
+			Magyar - Beta
+		</combo_item>
+		<combo_item name="Dutch">
+			Nederlands (Holland) - Beta
+		</combo_item>
+		<combo_item name="Polish">
+			Polski (Lengyel) - Beta
+		</combo_item>
+		<combo_item name="Portugese">
+			Portugués (Portugál) - Beta
+		</combo_item>
+		<combo_item name="Russian">
+			Русский (Orosz) - Beta
+		</combo_item>
+		<combo_item name="Turkish">
+			Türkçe (Török) - Beta
+		</combo_item>
+		<combo_item name="Ukrainian">
+			Українська (Ukrán) - Beta
+		</combo_item>
+		<combo_item length="1" name="Chinese" type="string">
+			中文 (简体) (Kínai) - Beta
+		</combo_item>
+		<combo_item length="1" name="(Japanese)" type="string">
+			日本語 (Japanese) - Beta
+		</combo_item>
+		<combo_item length="1" name="(Korean)" type="string">
+			한국어 (Korean) - Beta
+		</combo_item>
+	</combo_box>
+	<text type="string" length="1" name="text_chat_language">
+		Chat Nyelv:
+	</text>
+	<text type="string" length="1" name="translate_chat" label="FordÃ­tÃ¡s Chat">
+	</text>
 </panel>
Index: indra/newview/skins/default/xui/it/panel_preferences_chat.xml
===================================================================
--- indra/newview/skins/default/xui/it/panel_preferences_chat.xml	(revision 2776)
+++ indra/newview/skins/default/xui/it/panel_preferences_chat.xml	(working copy)
@@ -55,4 +55,62 @@
 	</text>
 	<check_box label="Mostra vignette chat" name="bubble_text_chat"/>
 	<slider label="Opacità" name="bubble_chat_opacity"/>
+	<combo_box name="translate_language_combobox" width="166">
+		<combo_item name="System Default Language">
+			Default di sistema
+		</combo_item>
+		<combo_item name="English">
+			English
+		</combo_item>
+		<combo_item name="Danish">
+			Dansk (Danese) - Beta
+		</combo_item>
+		<combo_item name="Deutsch(German)">
+			Deutsch (Tedesco) - Beta
+		</combo_item>
+		<combo_item name="Spanish">
+			Español (Spagnolo) - Beta
+		</combo_item>
+		<combo_item name="French">
+			Français (Francese) - Beta
+		</combo_item>
+		<combo_item name="Italian">
+			Italiano - Beta
+		</combo_item>
+		<combo_item name="Hungarian">
+			Magyar (Ungherese) - Beta
+		</combo_item>
+		<combo_item name="Dutch">
+			Nederlands (Olandese) - Beta
+		</combo_item>
+		<combo_item name="Polish">
+			Polski (Polacco) - Beta
+		</combo_item>
+		<combo_item name="Portugese">
+			Portugués (Portoghese) - Beta
+		</combo_item>
+		<combo_item name="Russian">
+			Русский (Russo) - Beta
+		</combo_item>
+		<combo_item name="Turkish">
+			Türkçe (Turco) - Beta
+		</combo_item>
+		<combo_item name="Ukrainian">
+			Українська (Ukraino) - Beta
+		</combo_item>
+		<combo_item name="Chinese">
+			中文 (简体) (Cinese) - Beta
+		</combo_item>
+		<combo_item name="(Japanese)">
+			日本語 (Giapponese) - Beta
+		</combo_item>
+		<combo_item name="(Korean)">
+			한국어 (Coreano) - Beta
+		</combo_item>
+	</combo_box>
+	<text type="string" length="1" name="text_chat_language">
+		Chat Lingua:
+	</text>
+	<text type="string" length="1" name="translate_chat" label="Traduci Chat">
+	</text>
 </panel>
Index: indra/newview/CMakeLists.txt
===================================================================
--- indra/newview/CMakeLists.txt	(revision 2776)
+++ indra/newview/CMakeLists.txt	(working copy)
@@ -10,6 +10,7 @@
 include(FMOD)
 include(OPENAL)
 include(FindOpenGL)
+include(JsonCpp)
 include(LLAddBuildTest)
 include(LLAudio)
 include(LLCharacter)
@@ -44,6 +45,7 @@
 include_directories(
     ${DBUSGLIB_INCLUDE_DIRS}
     ${ELFIO_INCLUDE_DIR}
+    ${JSONCPP_INCLUDE_DIRS}
     ${LLAUDIO_INCLUDE_DIRS}
     ${LLCHARACTER_INCLUDE_DIRS}
     ${LLCOMMON_INCLUDE_DIRS}
@@ -359,6 +361,7 @@
     lltoolview.cpp
     lltracker.cpp
     lltrans.cpp
+    lltranslate.cpp
     lluploaddialog.cpp
     llurl.cpp
     llurldispatcher.cpp
@@ -773,6 +776,7 @@
     lltoolview.h
     lltracker.h
     lltrans.h
+    lltranslate.h
     lluiconstants.h
     lluploaddialog.h
     llurl.h
@@ -1466,6 +1470,7 @@
     ${OPENGL_LIBRARIES}
     ${FMODWRAPPER_LIBRARY}
     ${OPENGL_LIBRARIES}
+    ${JSONCPP_LIBRARIES}
     ${MOZLIB_LIBRARIES}
     ${SDL_LIBRARY}
     ${SMARTHEAP_LIBRARY}
@@ -1600,3 +1605,4 @@
 ADD_VIEWER_BUILD_TEST(lltextureinfo viewer)
 ADD_VIEWER_BUILD_TEST(lltextureinfodetails viewer)
 ADD_VIEWER_BUILD_TEST(lltexturestatsuploader viewer)
+#ADD_VIEWER_COMM_BUILD_TEST(lltranslate viewer "")
Index: indra/llui/llui.h
===================================================================
--- indra/llui/llui.h	(revision 2776)
+++ indra/llui/llui.h	(working copy)
@@ -174,6 +174,7 @@
 	// Return the ISO639 language name ("en", "ko", etc.) for the viewer UI.
 	// http://www.loc.gov/standards/iso639-2/php/code_list.php
 	static std::string getLanguage();
+	static std::string getTranslateLanguage();
 
 	//helper functions (should probably move free standing rendering helper functions here)
 	static std::string locateSkin(const std::string& filename);
Index: indra/llui/llui.cpp
===================================================================
--- indra/llui/llui.cpp	(revision 2776)
+++ indra/llui/llui.cpp	(working copy)
@@ -1699,6 +1699,22 @@
 }
 
 //static
+std::string LLUI::getTranslateLanguage()
+{
+	std::string language = "en";
+	if (sConfigGroup)
+	{
+		language = sConfigGroup->getString("TranslateLanguage");
+		if (language.empty() || language == "default")
+		{
+		  language = getLanguage();
+		}
+	}
+	language = language.substr(0,2);
+	return language;
+}
+
+//static
 std::string LLUI::locateSkin(const std::string& filename)
 {
 	std::string slash = gDirUtilp->getDirDelimiter();
Index: indra/llmessage/message_prehash.cpp
===================================================================
--- indra/llmessage/message_prehash.cpp	(revision 2776)
+++ indra/llmessage/message_prehash.cpp	(working copy)
@@ -1378,3 +1378,4 @@
 char* _PREHASH_FaceIndex = LLMessageStringTable::getInstance()->getString("FaceIndex");
 char* _PREHASH_StatusData = LLMessageStringTable::getInstance()->getString("StatusData");
 char* _PREHASH_ProductSKU = LLMessageStringTable::getInstance()->getString("ProductSKU");
+char* _PREHASH_Language = LLMessageStringTable::getInstance()->getString("Language");
Index: indra/llmessage/message_prehash.h
===================================================================
--- indra/llmessage/message_prehash.h	(revision 2776)
+++ indra/llmessage/message_prehash.h	(working copy)
@@ -1378,4 +1378,5 @@
 extern char * _PREHASH_FaceIndex;
 extern char * _PREHASH_StatusData;
 extern char * _PREHASH_ProductSKU;
+extern char * _PREHASH_Language;
 #endif
