2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Improve languages box and language local storing.

Use current language native name instead of lng_language_name value.
This commit is contained in:
John Preston
2018-11-13 13:14:22 +04:00
parent cf5bd31203
commit 26b8515cb5
9 changed files with 375 additions and 304 deletions

View File

@@ -33,14 +33,14 @@ void SetupLanguageButton(
const auto button = AddButtonWithLabel(
container,
lng_settings_language,
Lang::Viewer(lng_language_name),
rpl::single(Lang::Current().nativeName()),
icon ? st::settingsSectionButton : st::settingsButton,
icon ? &st::settingsIconLanguage : nullptr);
const auto guard = Ui::AttachAsChild(button, base::binary_guard());
button->addClickHandler([=] {
const auto m = button->clickModifiers();
if ((m & Qt::ShiftModifier) && (m & Qt::AltModifier)) {
Lang::CurrentCloudManager().switchToLanguage(qsl("#custom"));
Lang::CurrentCloudManager().switchToLanguage({ qsl("#custom") });
} else {
*guard = LanguageBox::Show();
}