Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Empty parenthesis is displayed when list views have more than one item, but only enough items for one page. #249
This is not a big issue, it's more an annoyance. I can fix it myself, but I wanted to discuss the best approach with you, since I'd like to create a pull request when I'm done.
The problem is that on search results, category pages, and tag pages (and possibly others as well), empty parenthesis is displayed whenever there are more than 1 post to be displayed, but not enough posts to fill more than one page. In other words, the pagination information
The reason for this is that the parenthesis enclose the pagination information in the translation string for multiple results:
Any thoughts on this?
I did a quick review of several of the translation files and all of them seem to have the parenthesis inside the
While I do try hard to avoid changing string translations with each release, when it involves fixing a bug, I don't worry too much about breaking the translations because it's up to each translation maintainer to keep the translation up-to-date with each new version of the theme. (I do consider the issue you brought up here to be a bug — I've noticed it on my own site and I kept forgetting to file a report here, so thank you!)
As for how to solve this issue, it is indeed a tricky one. :-) Thanks for breaking down the options.
I agree, this is definitely the easiest solution. It would only involve removing the conditional in three places in
I like this solution not only because it's the easiest, but because the more I think about it the more correct showing "(this is page 1 of 1)" feels. It feels like that maintains better consistency and helps clarify for the visitor viewing the page that there is, in fact, only 1 page here. It's one more hint that would help the reader know there's nothing else to see except what they see on that page. Hiding that information seems unnecessary to me.
Yes, that's true. Whenever possible, best practice is to keep markup elements out of the translated string, but that's not always possible and it's perfectly acceptable to include the markup when there's no way around it. The goal should always be to make translating the string as easy as possible and if you split a sentence up into two separate strings just to avoid markup, you make the translator's job much harder. Leaving in the markup and keeping the sentence together is always the better option. :-)
If you'd like to submit a PR for that change to remove the conditional around