Skip to content

Instantly share code, notes, and snippets.

@sukima
Created July 8, 2013 14:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save sukima/5949206 to your computer and use it in GitHub Desktop.
Save sukima/5949206 to your computer and use it in GitHub Desktop.
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