Move search result count logic out of translations

Also fixes a problem pointed out by @Evolena whereby the advanced
search counts hadn’t been adjusted to remove `$:/temp/advancedsearch`
from the search.