Commit a0669877 authored by Mark Hymers's avatar Mark Hymers

Tidy up string creation

Signed-off-by: Mark Hymers's avatarMark Hymers <mark.hymers@ynic.york.ac.uk>
parent 118925c4
......@@ -94,14 +94,15 @@ function detailsUpdate(tabs) {
function todoCountUpdate(data) {
const num_todos = document.querySelector("#todo-count");
txt = data.length + " current "
if (gitlab_label) {
txt += gitlab_label + " ";
}
txt += "TODO";
if (data.length != 1) {
txt += "s";
}
let label = gitlab_label ? gitlab_label + " " : "";
/* This isn't the right way to do pluralisation for i18n,
* but I can't find any documentation on it for web extensions
* right now and it's not like anyone has translated this
* small extension */
let plural = data.length == 1 ? "" : "s";
let txt = `${data.length} current ${label}TODO${plural}`
num_todos.textContent = txt;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment