mirror of https://github.com/procxx/kepka.git
Save the default language after logging in.
We suggest an appropriate language in the intro if server has users system language langpack. But if user doesn't switch to it we save the default ("en") language so that he won't be bothered again.
This commit is contained in:
parent
665a1acfd8
commit
b6046d829f
|
@ -440,6 +440,15 @@ void Widget::Step::finish(const MTPUser &user, QImage photo) {
|
|||
return;
|
||||
}
|
||||
|
||||
// Save the default language if we've suggested some other and user ignored it.
|
||||
auto currentId = Lang::Current().id();
|
||||
auto defaultId = Lang::DefaultLanguageId();
|
||||
auto suggestedId = Lang::CurrentCloudManager().suggestedLanguage();
|
||||
if (currentId.isEmpty() && !suggestedId.isEmpty() && suggestedId != defaultId) {
|
||||
Lang::Current().switchToId(defaultId);
|
||||
Local::writeLangPack();
|
||||
}
|
||||
|
||||
Messenger::Instance().authSessionCreate(user.c_user().vid.v);
|
||||
Local::writeMtpData();
|
||||
App::wnd()->setupMain(&user);
|
||||
|
|
Loading…
Reference in New Issue