diff options
| author | Richard Linden <none@none> | 2012-02-06 15:28:45 -0800 |
|---|---|---|
| committer | Richard Linden <none@none> | 2012-02-06 15:28:45 -0800 |
| commit | 2ed1de224a45fafb12fea42e8dfb83f9728cdcf1 (patch) | |
| tree | a78f96c5ada866ec93cbba72f2c7bf1daf7ade80 /indra/newview/lltranslate.cpp | |
| parent | 289d756ea86bd3898f41592146d8f549cd056846 (diff) | |
| parent | e328dcf4062177c903d3099d0d16477824d23025 (diff) | |
Automated merge with http://hg.secondlife.com/viewer-development
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) |
