mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-26 08:27:12 -07:00
Fix plurals.
This commit is contained in:
parent
9ff5b52a7d
commit
3dc039e956
4 changed files with 7 additions and 6 deletions
|
@ -69,7 +69,7 @@ public class TaskManager @Inject constructor(val args: Args, val incrementalMana
|
|||
log(2, "Marking project ${project.name} as skipped")
|
||||
failedProjects.add(project.name)
|
||||
kobaltError("Not building project ${project.name} since it depends on failed "
|
||||
+ Strings.pluralize("project", fp.size)
|
||||
+ Strings.pluralize(fp.size, "project")
|
||||
+ " " + fp.joinToString(","))
|
||||
} else {
|
||||
val projectName = project.name
|
||||
|
|
|
@ -4,8 +4,8 @@ import com.google.common.base.CharMatcher
|
|||
|
||||
class Strings {
|
||||
companion object {
|
||||
fun pluralize(s: String, n: Int) = s + (if (n != 1) "s" else "")
|
||||
fun pluralizeAll(s: String, n: Int) = "$n " + pluralize(s, n)
|
||||
fun pluralize(n:Int, s: String, plural: String = s) = plural + (if (n != 1) "s" else "")
|
||||
fun pluralizeAll(n:Int, s: String, plural: String = s) = "$n " + pluralize(n, s, plural)
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue