mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-06 05:25:50 +01:00
Add helper which convert singular and plural.
This commit is contained in:
@@ -18,6 +18,13 @@ object helpers {
|
||||
*/
|
||||
def date(date: Date): String = new SimpleDateFormat("yyyy-MM-dd").format(date)
|
||||
|
||||
/**
|
||||
* Returns singular if count is 1, otherwise plural.
|
||||
* If plural is not specified, returns singular + "s" as plural.
|
||||
*/
|
||||
def plural(count: Int, singular: String, plural: String = ""): String =
|
||||
if(count == 1) singular else if(plural.isEmpty) singular + "s" else plural
|
||||
|
||||
/**
|
||||
* Converts Markdown of Wiki pages to HTML.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user