Skip to content

Commit

Permalink
Support partial language name in languageBox selection
Browse files Browse the repository at this point in the history
  • Loading branch information
CoBC committed Aug 16, 2024
1 parent 372fd5f commit 9c6970f
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Client/qtTeamTalk/preferencesdlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,19 @@ void PreferencesDlg::initDisplayTab()
}
QString lang = ttSettings->value(SETTINGS_DISPLAY_LANGUAGE, SETTINGS_DISPLAY_LANGUAGE_DEFAULT).toString();
int index = ui.languageBox->findData(lang);
if (index < 0)
{
QString langPrefix = lang.section('_', 0, 0);
for (int i = 0; i < ui.languageBox->count(); ++i)
{
QString itemData = ui.languageBox->itemData(i).toString();
if (itemData == langPrefix)
{
index = i;
break;
}
}
}
if (index >= 0)
ui.languageBox->setCurrentIndex(index);

Expand Down

0 comments on commit 9c6970f

Please sign in to comment.