Proposal:Pluralization Of Count Tags
From Movable Type
Implemented in Cal (4.15) - Changeset 1976
Contents |
Abstract
This is a proposal for updating all MT *Count tags with attributes to assist in pluralization.
Examples written using <$mt:EntryCommentCount$> as an example
Usage
- no count is prepended to singular or none attribute by default.
- count and a space is prepended plural attribute.
<$mt:EntryCommentCount singular="a comment" plural="comments" none="no comments"$>
Sample Output:
1 = 1 entry
5 = 5 comments
0 = no comments
No None Attribute
- if plural attribute is defined and none attribute is not defined, then plural is used for none attribute.
<$mt:EntryCommentCount singular="comment" plural="comments"$>
Sample Output:
1 = 1 comment
5 = 5 comments
0 = 0 comments
Moving Variable
- variable can only be moved in plural case. Use a "#" to define location of variable.
<$mt:EntryCommentCount singular="comments (1)" plural="comments (#)" none="leave a comment"$>
Sample Output:
1 = comments (1)
5 = comments (5)
0 = leave a comment
Edge Cases
- only singular attribute
<$mt:EntryCommentCount singular="comment"$>
Sample Output:
1 = 1 comment
5 = 5
0 = 0
- plural defined and no text desired for none attribute
<$mt:EntryCommentCount plural="comments" none=""$>
Sample Output:
1 = 1
5 = 5 comments
0 = 0
- only none attribute
<$mt:EntryCommentCount none="no comments"$>
Sample Output:
1 = 1
5 = 5
0 = no comments
Tags Eligible For Pluralization
- ArchiveCount
- AssetCount
- AssetScoreCount
- AuthorScoreCount
- BlogCategoryCount
- BlogCommentCount
- BlogEntryCount
- BlogPageCount
- CategoryCommentCount
- CategoryCount
- CategoryTrackbackCount
- CommentScoreCount
- EntriesCount
- EntryCommentCount
- EntryScoreCount
- EntryTrackbackCount
- FolderCount
- PingScoreCount
- SearchResultCount
- TagCount