From 89e8f0ccc34de36dc52caff39e2b2a3243223146 Mon Sep 17 00:00:00 2001 From: John Preston <johnprestonmail@gmail.com> Date: Mon, 17 Dec 2018 10:12:44 +0400 Subject: [PATCH] Fix pt-br FAQ link. --- Telegram/SourceFiles/boxes/about_box.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/Telegram/SourceFiles/boxes/about_box.cpp b/Telegram/SourceFiles/boxes/about_box.cpp index 67ae88823f..2551546f5b 100644 --- a/Telegram/SourceFiles/boxes/about_box.cpp +++ b/Telegram/SourceFiles/boxes/about_box.cpp @@ -87,13 +87,19 @@ void AboutBox::keyPressEvent(QKeyEvent *e) { } QString telegramFaqLink() { - auto result = qsl("https://telegram.org/faq"); - auto language = Lang::Current().id(); - for (auto faqLanguage : { "de", "es", "it", "ko", "br" }) { - if (language.startsWith(QLatin1String(faqLanguage))) { - result.append('/').append(faqLanguage); + const auto result = qsl("https://telegram.org/faq"); + const auto langpacked = [&](const char *language) { + return result + '/' + language; + }; + const auto current = Lang::Current().id(); + for (const auto language : { "de", "es", "it", "ko" }) { + if (current.startsWith(QLatin1String(language))) { + return langpacked(language); } } + if (current.startsWith(qstr("pt-br"))) { + return langpacked("br"); + } return result; }