diff options
Diffstat (limited to 'indra/newview/lltranslate.h')
-rwxr-xr-x | indra/newview/lltranslate.h | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/indra/newview/lltranslate.h b/indra/newview/lltranslate.h index c2330daa81..db5ad9479c 100755 --- a/indra/newview/lltranslate.h +++ b/indra/newview/lltranslate.h @@ -89,6 +89,11 @@ public: std::string& detected_lang, std::string& err_msg) const = 0; + /** + * @return if the handler is configured to function properly + */ + virtual bool isConfigured() const = 0; + virtual ~LLTranslationAPIHandler() {} protected: @@ -115,6 +120,7 @@ public: std::string& translation, std::string& detected_lang, std::string& err_msg) const; + /*virtual*/ bool isConfigured() const; private: static void parseErrorResponse( @@ -148,8 +154,10 @@ public: std::string& translation, std::string& detected_lang, std::string& err_msg) const; + /*virtual*/ bool isConfigured() const; private: static std::string getAPIKey(); + static std::string getAPILanguageCode(const std::string& lang); }; /** @@ -255,8 +263,8 @@ public : EService mService; }; - typedef boost::intrusive_ptr<TranslationReceiver> TranslationReceiverPtr; - typedef boost::intrusive_ptr<KeyVerificationReceiver> KeyVerificationReceiverPtr; + typedef LLPointer<TranslationReceiver> TranslationReceiverPtr; + typedef LLPointer<KeyVerificationReceiver> KeyVerificationReceiverPtr; /** * Translate given text. @@ -275,8 +283,17 @@ public : * @param key Key to verify. */ static void verifyKey(KeyVerificationReceiverPtr& receiver, const std::string& key); + + /** + * @return translation target language + */ static std::string getTranslateLanguage(); + /** + * @return true if translation is configured properly. + */ + static bool isTranslationConfigured(); + private: static const LLTranslationAPIHandler& getPreferredHandler(); static const LLTranslationAPIHandler& getHandler(EService service); |