diff --git a/routing/turns_tts_text.cpp b/routing/turns_tts_text.cpp index 1c8b50978e..904290f278 100644 --- a/routing/turns_tts_text.cpp +++ b/routing/turns_tts_text.cpp @@ -100,6 +100,49 @@ string GetDistanceTextId(Notification const & notification) return string(); } +string GetRoundaboutTextId(Notification const & notification) +{ + if (notification.m_turnDir != TurnDirection::LeaveRoundAbout) + { + ASSERT(false, ()); + return string(); + } + if (!notification.m_useThenInsteadOfDistance) + return "leave_the_roundabout"; // Notification just before leaving a roundabout. + + uint8_t const maxTranslatedExit = 11; + if (notification.m_exitNum == 0 || notification.m_exitNum > maxTranslatedExit) + return "leave_the_roundabout"; + + switch (notification.m_exitNum) + { + case 1: + return "take_the_1st_exit"; + case 2: + return "take_the_2nd_exit"; + case 3: + return "take_the_3rd_exit"; + case 4: + return "take_the_4th_exit"; + case 5: + return "take_the_5th_exit"; + case 6: + return "take_the_6th_exit"; + case 7: + return "take_the_7th_exit"; + case 8: + return "take_the_8th_exit"; + case 9: + return "take_the_9th_exit"; + case 10: + return "take_the_10th_exit"; + case 11: + return "take_the_11th_exit"; + } + ASSERT(false, ()); + return string(); +} + string GetDirectionTextId(Notification const & notification) { switch (notification.m_turnDir) @@ -123,7 +166,7 @@ string GetDirectionTextId(Notification const & notification) case TurnDirection::EnterRoundAbout: return "enter_the_roundabout"; case TurnDirection::LeaveRoundAbout: - return "leave_the_roundabout"; + return GetRoundaboutTextId(notification); case TurnDirection::ReachedYourDestination: return "you_have_reached_the_destination"; case TurnDirection::StayOnRoundAbout: diff --git a/routing/turns_tts_text.hpp b/routing/turns_tts_text.hpp index 26a4df1a54..7c1922936f 100644 --- a/routing/turns_tts_text.hpp +++ b/routing/turns_tts_text.hpp @@ -36,6 +36,9 @@ private: /// Generates text message id about the distance of the notification. For example: In 300 meters. string GetDistanceTextId(Notification const & notification); +/// Generates text message id for roundabouts. +/// For example: "Leave the roundabout." or "Take the third exit." +string GetRoundaboutTextId(Notification const & notification); /// Generates text message id about the direction of the notification. For example: Make a right /// turn. string GetDirectionTextId(Notification const & notification);