Merge pull request #7146 from weirddan455/target-text-fix

Targeting interface now says "Select up to one..." when the target is optional (bug #7046).
This commit is contained in:
Oleg Agafonov 2020-11-01 10:30:47 +01:00 committed by GitHub
commit 2f5a8659b6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -117,7 +117,11 @@ public abstract class TargetImpl implements Target {
|| targetName.startsWith("an ")
|| targetName.startsWith("any ")) {
return "Select " + targetName + suffix;
} else if (targetName.startsWith("a") || targetName.startsWith("e") || targetName.startsWith("i") || targetName.startsWith("o") || targetName.startsWith("u")) {
}
if (getMinNumberOfTargets() == 0 && getMaxNumberOfTargets() == 1) {
return "Select up to one " + targetName + suffix;
}
if (targetName.startsWith("a") || targetName.startsWith("e") || targetName.startsWith("i") || targetName.startsWith("o") || targetName.startsWith("u")) {
return "Select an " + targetName + suffix;
}
return "Select a " + targetName + suffix;