2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-30 22:16:14 +00:00

Improve non-authed language switch.

This commit is contained in:
John Preston
2019-06-19 13:22:25 +02:00
parent a7c8feaecb
commit 52e40cbc6e
9 changed files with 61 additions and 10 deletions

View File

@@ -35,7 +35,11 @@ void SetupLanguageButton(
const auto button = AddButtonWithLabel(
container,
tr::lng_settings_language(),
rpl::single(Lang::Current().nativeName()),
rpl::single(
Lang::Current().id()
) | rpl::then(
Lang::Current().idChanges()
) | rpl::map([] { return Lang::Current().nativeName(); }),
icon ? st::settingsSectionButton : st::settingsButton,
icon ? &st::settingsIconLanguage : nullptr);
const auto guard = Ui::CreateChild<base::binary_guard>(button.get());