diff options
author | Vladimir Byko-Ianko <v.bykoianko@corp.mail.ru> | 2015-09-04 16:41:32 +0300 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 03:03:48 +0300 |
commit | ac57f8d4da92af07513664613bcc5c085bf098a0 (patch) | |
tree | 74930659ddb64385cf838f147a53b986780ef2b4 /routing | |
parent | 98a51d6c07614eb6bc35c94a2bf87ea8ca9f8916 (diff) |
Android. Initialization of TTS on the first switching on.
Diffstat (limited to 'routing')
-rw-r--r-- | routing/turns_tts_text.cpp | 9 | ||||
-rw-r--r-- | routing/turns_tts_text.hpp | 1 |
2 files changed, 6 insertions, 4 deletions
diff --git a/routing/turns_tts_text.cpp b/routing/turns_tts_text.cpp index e55ed3f47a..44caafbbae 100644 --- a/routing/turns_tts_text.cpp +++ b/routing/turns_tts_text.cpp @@ -48,13 +48,14 @@ void GetTtsText::SetLocaleWithJson(string const & jsonBuffer) string GetTtsText::operator()(Notification const & notification) const { - if (!m_getCurLang->IsValid()) - return string(); if (notification.m_distanceUnits == 0 && !notification.m_useThenInsteadOfDistance) return GetTextById(GetDirectionTextId(notification)); - return GetTextById(GetDistanceTextId(notification)) + " " + - GetTextById(GetDirectionTextId(notification)); + string const distStr = GetTextById(GetDistanceTextId(notification)); + string const dirStr = GetTextById(GetDirectionTextId(notification)); + if (distStr.empty() && dirStr.empty()) + return ""; + return distStr + " " + dirStr; } string GetTtsText::GetTextById(string const & textId) const diff --git a/routing/turns_tts_text.hpp b/routing/turns_tts_text.hpp index 9c54cce5e3..a160d27a05 100644 --- a/routing/turns_tts_text.hpp +++ b/routing/turns_tts_text.hpp @@ -22,6 +22,7 @@ class GetTtsText { public: string operator()(Notification const & notification) const; + /// TODO(vbykoianko) Check if locale is available. If not use default (en) locale. void SetLocale(string const & locale); inline string GetLocale() const { return m_locale; } /// SetLocaleWithJson is used for writing unit tests only. |