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

Use QString + Lang::Tag() instead of Lang::String.

This commit is contained in:
John Preston
2017-04-13 11:45:58 +03:00
parent 110e7c8074
commit 2334ba1fe1
20 changed files with 598 additions and 534 deletions

View File

@@ -64,8 +64,8 @@ Widget::Widget(QWidget *parent) : TWidget(parent)
if (cLang() == languageDefault) {
auto systemLangId = Sandbox::LangSystem();
if (systemLangId != languageDefault) {
LangLoaderPlain loader(qsl(":/langs/lang_") + LanguageCodes[systemLangId].c_str() + qsl(".strings"), { lng_switch_to_this });
QString text = loader.found().value(lng_switch_to_this);
Lang::FileParser loader(qsl(":/langs/lang_") + LanguageCodes[systemLangId].c_str() + qsl(".strings"), { lng_switch_to_this });
auto text = loader.found().value(lng_switch_to_this);
if (!text.isEmpty()) {
_changeLanguage.create(this, object_ptr<Ui::LinkButton>(this, text), st::introCoverDuration);
_changeLanguage->entity()->setClickedCallback([this, systemLangId] { changeLanguage(systemLangId); });