forked from organicmaps/organicmaps
[core] Added lang to the onboarding tip url
This commit is contained in:
parent
9dc15fe2b8
commit
da83929bd8
1 changed files with 5 additions and 4 deletions
|
@ -3,6 +3,7 @@
|
|||
#include "partners_api/utm.hpp"
|
||||
|
||||
#include "platform/platform.hpp"
|
||||
#include "platform/preferred_languages.hpp"
|
||||
|
||||
#include "base/url_helpers.hpp"
|
||||
|
||||
|
@ -16,7 +17,7 @@ namespace
|
|||
{
|
||||
auto constexpr kTipsCount = static_cast<uint8_t>(onboarding::Tip::Type::Count);
|
||||
|
||||
std::string const kBaseUrl = "/en/v2/mobilefront/";
|
||||
std::string const kBaseUrl = "/v2/mobilefront/";
|
||||
std::array<std::string, kTipsCount> const kTipsLinks = {
|
||||
InjectUTM(kBaseUrl, UTM::DiscoverCatalogOnboarding),
|
||||
InjectUTM(kBaseUrl + "search/?tag=181", UTM::FreeSamplesOnboading),
|
||||
|
@ -28,10 +29,10 @@ namespace onboarding
|
|||
Tip GetTip()
|
||||
{
|
||||
auto const tipIndex = std::time(nullptr) % kTipsCount;
|
||||
auto const url = kTipsLinks[tipIndex];
|
||||
|
||||
auto const link = kTipsLinks[tipIndex];
|
||||
auto const catalogUrl = base::url::Join(BOOKMARKS_CATALOG_FRONT_URL, languages::GetCurrentNorm());
|
||||
return {static_cast<Tip::Type>(tipIndex),
|
||||
url.empty() ? url : base::url::Join(BOOKMARKS_CATALOG_FRONT_URL, url)};
|
||||
link.empty() ? link : base::url::Join(catalogUrl, link)};
|
||||
}
|
||||
|
||||
bool CanShowTipButton() { return GetPlatform().IsConnected(); }
|
||||
|
|
Loading…
Add table
Reference in a new issue