void PropertiesDialog::OnPluralFormsDefault(wxCommandEvent& event) { m_rememberedPluralForm = m_pluralFormsExpr->GetValue(); Language lang = m_language->GetLang(); if (lang.IsValid()) { wxString defaultForm = lang.DefaultPluralFormsExpr(); if (!defaultForm.empty()) m_pluralFormsExpr->SetValue(defaultForm); } event.Skip(); }
void PropertiesDialog::OnLanguageValueChanged(const wxString& langstr) { Language lang = Language::TryParse(langstr); wxString pluralForm = lang.DefaultPluralFormsExpr(); if (pluralForm.empty()) { m_pluralFormsDefault->Disable(); m_pluralFormsCustom->SetValue(true); } else { m_pluralFormsDefault->Enable(); if (m_pluralFormsExpr->GetValue().empty() || m_pluralFormsExpr->GetValue() == pluralForm) { m_pluralFormsDefault->SetValue(true); } } }