Ensure True/False and Yes/No parameter have a valid value even with i18n

This commit is contained in:
Florian Rival
2015-09-05 11:50:02 +02:00
parent 4fcd817a06
commit b56c1114f2

View File

@@ -207,16 +207,30 @@ void ParameterEditorLauncher::LaunchEditor(wxWindow * parent, gd::Project & proj
}
else if ( metadata.GetType() == "trueorfalse" )
{
TrueOrFalse dialog(parent, _("Choose True or False to fill the parameter"), _("True or False"));
TrueOrFalse dialog(parent, _("Choose True or False for this parameter"), _("True or False"));
if ( dialog.ShowModal() == 1 )
editCtrl->ChangeValue(_("True"));
{
gd::String result = _("True");
if (result != "True" && result != "Vrai") {
result = "True";
}
editCtrl->ChangeValue(result);
}
else
editCtrl->ChangeValue(_("False"));
}
else if ( metadata.GetType() == "yesorno" )
{
if (wxMessageBox(_("Choose yes or no to fullfil parent parameter:"), _("Yes or no") ,wxYES_NO ) == wxYES)
editCtrl->ChangeValue(_("yes"));
if (wxMessageBox(_("Choose yes or no for this parameter:"), _("Yes or no") ,wxYES_NO ) == wxYES)
{
gd::String result = _("yes");
if (result != "yes" && result != "oui") {
result = "yes";
}
editCtrl->ChangeValue(result);
}
else
editCtrl->ChangeValue(_("no"));