yuzu: Port translation support from Citra

Co-Authored-By: Weiyi Wang <wwylele@gmail.com>
This commit is contained in:
FearlessTobi
2020-01-26 00:26:07 +01:00
parent 4a8cb9a706
commit 347b50ad43
17 changed files with 261 additions and 92 deletions

View File

@ -23,6 +23,7 @@ ConfigureDialog::ConfigureDialog(QWidget* parent, HotkeyRegistry& registry)
SetConfiguration();
PopulateSelectionList();
connect(ui->uiTab, &ConfigureUi::LanguageChanged, this, &ConfigureDialog::OnLanguageChanged);
connect(ui->selectorList, &QListWidget::itemSelectionChanged, this,
&ConfigureDialog::UpdateVisibleTabs);
@ -98,6 +99,14 @@ void ConfigureDialog::PopulateSelectionList() {
}
}
void ConfigureDialog::OnLanguageChanged(const QString& locale) {
emit LanguageChanged(locale);
// first apply the configuration, and then restore the display
ApplyConfiguration();
RetranslateUI();
SetConfiguration();
}
void ConfigureDialog::UpdateVisibleTabs() {
const auto items = ui->selectorList->selectedItems();
if (items.isEmpty()) {