2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Switched default language for skip translation to application language.

This commit is contained in:
23rd
2022-11-23 03:12:07 +03:00
committed by John Preston
parent 4b2d8b0c53
commit 551bf4f9a7
3 changed files with 32 additions and 7 deletions

View File

@@ -1123,13 +1123,27 @@ void LanguageBox::prepare() {
tr::lng_translate_settings_choose(),
label->events() | rpl::map(Ui::LanguageName),
st::settingsButtonNoIcon);
label->fire(QLocale(Core::App().settings().skipTranslationForLanguage()));
{
const auto settingsLang =
Core::App().settings().skipTranslationForLanguage();
const auto locale = (settingsLang == QLocale::English)
? QLocale(Lang::LanguageIdOrDefault(Lang::Id()))
: (settingsLang == QLocale::C)
? QLocale(QLocale::English)
: QLocale(settingsLang);
label->fire_copy(locale);
}
translateSkip->setClickedCallback([=] {
Ui::BoxShow(this).showBox(
Box(Ui::ChooseLanguageBox, [=](QLocale locale) {
label->fire(QLocale(locale));
label->fire_copy(locale);
const auto result = (locale.language() == QLocale::English)
? QLocale::c()
: locale;
Core::App().settings().setSkipTranslationForLanguage(
locale.language());
result.language());
Core::App().saveSettingsDelayed();
}),
Ui::LayerOption::KeepOther);
});