diff options
author | Daria Volvenkova <d.volvenkova@corp.mail.ru> | 2017-04-17 14:56:46 +0300 |
---|---|---|
committer | Daria Volvenkova <d.volvenkova@corp.mail.ru> | 2017-04-17 15:06:31 +0300 |
commit | 6d2ca01e581889045ffc4333cccecd2cd7457c80 (patch) | |
tree | 2279642620c2b112d20a8a6355ece9180f97d9a8 /map | |
parent | 9046058f42d73db174acd6d6cda6fecc34b63c78 (diff) |
Into PP info added a wrapper for secondary feature name.
Diffstat (limited to 'map')
-rw-r--r-- | map/place_page_info.cpp | 25 | ||||
-rw-r--r-- | map/place_page_info.hpp | 2 |
2 files changed, 22 insertions, 5 deletions
diff --git a/map/place_page_info.cpp b/map/place_page_info.cpp index ac50114537..dbae446838 100644 --- a/map/place_page_info.cpp +++ b/map/place_page_info.cpp @@ -59,15 +59,30 @@ string Info::GetTitle() const if (!m_customName.empty()) return m_customName; - string name; - auto const deviceLang = StringUtf8Multilang::GetLangIndex(languages::GetCurrentNorm()); - auto const mwmInfo = GetID().m_mwmId.GetInfo(); + string primaryName; if (mwmInfo) - feature::GetReadableName(mwmInfo->GetRegionData(), m_name, deviceLang, true /* allowTranslit */, name); + { + auto const deviceLang = StringUtf8Multilang::GetLangIndex(languages::GetCurrentNorm()); + string secondaryName; + feature::GetPreferredNames(mwmInfo->GetRegionData(), m_name, deviceLang, true /* allowTranslit */, primaryName, secondaryName); + } + return primaryName; +} + +string Info::GetSecondaryTitle() const +{ + auto const mwmInfo = GetID().m_mwmId.GetInfo(); - return name; + string secondaryName; + if (mwmInfo) + { + auto const deviceLang = StringUtf8Multilang::GetLangIndex(languages::GetCurrentNorm()); + string primaryName; + feature::GetPreferredNames(mwmInfo->GetRegionData(), m_name, deviceLang, true /* allowTranslit */, primaryName, secondaryName); + } + return secondaryName; } string Info::GetSubtitle() const diff --git a/map/place_page_info.hpp b/map/place_page_info.hpp index f218cde93c..83098bfa5d 100644 --- a/map/place_page_info.hpp +++ b/map/place_page_info.hpp @@ -65,6 +65,8 @@ public: /// Convenient wrapper for feature's name and custom name. string GetTitle() const; + /// Convenient wrapper for secondary feature name. + string GetSecondaryTitle() const; /// Convenient wrapper for type, cuisines, elevation, stars, wifi etc. string GetSubtitle() const; /// @returns empty string or GetStars() count of ★ symbol. |