Moved current interface language to top of list in translate box.
This commit is contained in:
parent
9e93ecc154
commit
0e93693856
|
@ -474,7 +474,15 @@ void ChooseLanguageBox(
|
||||||
box->setFocusCallback([=] { multiSelect->setInnerFocus(); });
|
box->setFocusCallback([=] { multiSelect->setInnerFocus(); });
|
||||||
|
|
||||||
const auto container = box->verticalLayout();
|
const auto container = box->verticalLayout();
|
||||||
const auto langs = Languages();
|
const auto langs = [&] {
|
||||||
|
auto langs = Languages();
|
||||||
|
const auto current = QLocale(
|
||||||
|
Lang::LanguageIdOrDefault(Lang::Id())).language();
|
||||||
|
if (const auto it = ranges::find(langs, current); it != end(langs)) {
|
||||||
|
base::reorder(langs, std::distance(begin(langs), it), 0);
|
||||||
|
}
|
||||||
|
return langs;
|
||||||
|
}();
|
||||||
auto rows = std::vector<not_null<Ui::SlideWrap<Row>*>>();
|
auto rows = std::vector<not_null<Ui::SlideWrap<Row>*>>();
|
||||||
rows.reserve(langs.size());
|
rows.reserve(langs.size());
|
||||||
for (const auto &lang : langs) {
|
for (const auto &lang : langs) {
|
||||||
|
|
Loading…
Reference in New Issue