diff options
author | Arsentiy Milchakov <milcars@mapswithme.com> | 2018-09-20 14:40:45 +0300 |
---|---|---|
committer | Aleksey Belousov <beloal@users.noreply.github.com> | 2018-09-25 11:56:55 +0300 |
commit | 0a254cf68ae046596dc19b41e377fa29f9b265af (patch) | |
tree | c1c04ba1067a5af85d550e35f6cf2e6189ed4eae /map | |
parent | dbf2f9868cbd9b3fdee8948309410a56a66b1187 (diff) |
[types_strings][bookmarks] bookmarks localization logic is moved to platforms
Diffstat (limited to 'map')
-rw-r--r-- | map/bookmark_helpers.cpp | 2 | ||||
-rw-r--r-- | map/place_page_info.cpp | 31 | ||||
-rw-r--r-- | map/place_page_info.hpp | 1 |
3 files changed, 15 insertions, 19 deletions
diff --git a/map/bookmark_helpers.cpp b/map/bookmark_helpers.cpp index 900ed27ae2..0636f61ce1 100644 --- a/map/bookmark_helpers.cpp +++ b/map/bookmark_helpers.cpp @@ -465,7 +465,7 @@ std::string GetPreferredBookmarkStr(kml::LocalizableString const & name, feature std::string GetLocalizedBookmarkType(std::vector<uint32_t> const & types) { - return kml::GetLocalizedBookmarkType(types, languages::GetCurrentOrig()); + return kml::GetLocalizedBookmarkType(types); } std::string GetPreferredBookmarkName(kml::BookmarkData const & bmData) diff --git a/map/place_page_info.cpp b/map/place_page_info.cpp index 33e834d4ca..9903eeaac6 100644 --- a/map/place_page_info.cpp +++ b/map/place_page_info.cpp @@ -162,19 +162,9 @@ std::string Info::GetBookmarkName() void Info::SetCustomName(std::string const & name) { if (IsBookmark()) - { - m_uiTitle = GetBookmarkName(); - - std::vector<std::string> subtitle; - subtitle.push_back(m_bookmarkCategoryName); - if (!m_bookmarkData.m_featureTypes.empty()) - subtitle.push_back(GetLocalizedBookmarkType(m_bookmarkData.m_featureTypes)); - m_uiSubtitle = strings::JoinStrings(subtitle, kSubtitleSeparator); - } + SetTitlesForBookmark(); else - { m_uiTitle = name; - } m_customName = name; } @@ -183,13 +173,7 @@ void Info::SetCustomNameWithCoordinates(m2::PointD const & mercator, std::string { if (IsBookmark()) { - m_uiTitle = GetBookmarkName(); - - std::vector<std::string> subtitle; - subtitle.push_back(m_bookmarkCategoryName); - if (!m_bookmarkData.m_featureTypes.empty()) - subtitle.push_back(GetLocalizedBookmarkType(m_bookmarkData.m_featureTypes)); - m_uiSubtitle = strings::JoinStrings(subtitle, kSubtitleSeparator); + SetTitlesForBookmark(); } else { @@ -255,6 +239,17 @@ string Info::FormatStars() const return stars; } +void Info::SetTitlesForBookmark() +{ + m_uiTitle = GetBookmarkName(); + + std::vector<std::string> subtitle; + subtitle.push_back(m_bookmarkCategoryName); + if (!m_bookmarkData.m_featureTypes.empty()) + subtitle.push_back(GetLocalizedBookmarkType(m_bookmarkData.m_featureTypes)); + m_uiSubtitle = strings::JoinStrings(subtitle, kSubtitleSeparator); +} + string Info::GetFormattedCoordinate(bool isDMS) const { auto const & ll = GetLatLon(); diff --git a/map/place_page_info.hpp b/map/place_page_info.hpp index a357d232a8..d9472a275d 100644 --- a/map/place_page_info.hpp +++ b/map/place_page_info.hpp @@ -226,6 +226,7 @@ private: std::string GetBookmarkName(); /// @returns empty string or GetStars() count of ★ symbol. std::string FormatStars() const; + void SetTitlesForBookmark(); /// UI std::string m_uiTitle; |