Into PP info added a wrapper for secondary feature name.

This commit is contained in:
Daria Volvenkova 2017-04-17 14:56:46 +03:00
parent 9046058f42
commit 6d2ca01e58
2 changed files with 22 additions and 5 deletions

View file

@ -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;
}
return name;
string Info::GetSecondaryTitle() const
{
auto const mwmInfo = GetID().m_mwmId.GetInfo();
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

View file

@ -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.