diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2012-05-02 13:00:59 -0400 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2012-05-02 13:00:59 -0400 |
commit | 678864e4ed497de7d17e02fa79b93be54379a5b8 (patch) | |
tree | f946f0f5ffc116d2ba9c9ada237eb70594966ee6 /indra/newview/lltranslate.cpp | |
parent | 78fec489b53434a8ac8f9c0a8e72fd883067ce42 (diff) | |
parent | d6569db3520f7e0ce2d93febb6f4e26b48c08a3d (diff) |
merge viewer-release to drano
Diffstat (limited to 'indra/newview/lltranslate.cpp')
-rwxr-xr-x | indra/newview/lltranslate.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/indra/newview/lltranslate.cpp b/indra/newview/lltranslate.cpp index c1cc9c7bc4..f3d8de1904 100755 --- a/indra/newview/lltranslate.cpp +++ b/indra/newview/lltranslate.cpp @@ -162,10 +162,10 @@ void LLBingTranslationHandler::getTranslateURL( const std::string &text) const { url = std::string("http://api.microsofttranslator.com/v2/Http.svc/Translate?appId=") - + getAPIKey() + "&text=" + LLURI::escape(text) + "&to=" + to_lang; + + getAPIKey() + "&text=" + LLURI::escape(text) + "&to=" + getAPILanguageCode(to_lang); if (!from_lang.empty()) { - url += "&from=" + from_lang; + url += "&from=" + getAPILanguageCode(from_lang); } } @@ -236,6 +236,12 @@ std::string LLBingTranslationHandler::getAPIKey() return gSavedSettings.getString("BingTranslateAPIKey"); } +// static +std::string LLBingTranslationHandler::getAPILanguageCode(const std::string& lang) +{ + return lang == "zh" ? "zh-CHT" : lang; // treat Chinese as Traditional Chinese +} + LLTranslate::TranslationReceiver::TranslationReceiver(const std::string& from_lang, const std::string& to_lang) : mFromLang(from_lang) , mToLang(to_lang) |