Created
July 8, 2013 14:17
-
-
Save sukima/5949206 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ratingText = { | |
singular: { | |
"Closed": L("1_person_voted_to_get_this_issue_fixed", "1 person voted to get this issue fixed"), | |
"Archived": L("1_person_voted_to_get_this_issue_fixed", "1 person voted to get this issue fixed"), | |
default: L("1_person_wants_this_fixed", "1 person wants this fixed") | |
}, | |
plural: { | |
"Closed": L("people_voted_to_get_this_issue_fixed", "%s people voted to get this issue fixed"), | |
"Archived": L("people_voted_to_get_this_issue_fixed", "%s people voted to get this issue fixed"), | |
default: L("people_want_this_fixed", "%s people want this fixed") | |
} | |
}; | |
function getRatingText(rating, status) { | |
if (Number(rating) === 1) { | |
return ratingText.singular[status] || ratingText.singular.default; | |
} | |
else { | |
return String.format( | |
ratingText.plural[status] || ratingText.plural.default, | |
rating | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment