question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ZeroDataMessage should not start string after colon with capital letter

See original GitHub issue

Bug Description

The code in https://github.com/google/site-kit-wp/blob/4c156b533f57135c49dc64ff1adf2c1e143906cb/assets/js/modules/analytics/components/common/ZeroDataMessage.js#L41-L53 has grammatical issues:

CleanShot 2022-03-29 at 23 34 32

There shouldn’t be a capital letter—essentially a “new sentence”, following the colon. Ideally, we should probably reformat this i18n string to have “page” or “site” be the %s part of the string, and not the entire sentence with the reasoning around it.

But given the logic of the component and the cost of that extra translation, we should instead change the prefix string to end with a full-stop/period instead of a colon.

Steps to reproduce

  1. Enable the zeroDataStates feature flag
  2. Connect an Analytics property with zero data, or use the tester plugin to simulate zero data for Analytics
  3. Visit the Site Kit dashboard and scroll to “Top Content over the last 28 days”.
  4. See text issue

Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

  • Translations for Search Console and Analytics zero data messages should contain correct English-language capitalisation.
  • Translations used should be more distinct/not combined as they are currently.

Implementation Brief

Change the string values and logic in ZeroDataMessage.js to be:

if (skipPrefix) {
  return url
    ? __("Your page hasn’t appeared in Search yet", "google-site-kit")
    : __("Your site hasn’t appeared in Search yet", "google-site-kit");
}

return url
  ? __(
      "No data to display: your page hasn’t appeared in Search yet",
      "google-site-kit"
    )
  : __(
      "No data to display: your site hasn’t appeared in Search yet",
      "google-site-kit"
    );

This should be done in both assets/js/modules/search-console/components/common/ZeroDataMessage.js and assets/js/modules/analytics/components/common/ZeroDataMessage.js, using the above text for Search Console and Your page hasn’t received any visitors yet in Analytics.

Note: the old Analytics text used “hasn’t gotten any visitors”, but I think “received” is a better verb to use here, so let’s go with that. 😅

Test Coverage

  • No tests needed; VRTs might need updating.

QA Brief

  • Visit the Site Kit dashboard with a site with zero data for both Search Console and Analytics. (This can be forced by using the Tester Plugin and setting Analytics and Search Console to return zero data reports.)
  • The main dashboard should show this in a zero state table view: CleanShot 2022-04-06 at 22 54 35
  • The page-specific dashboard should show this in a table view: CleanShot 2022-04-06 at 22 53 25

Changelog entry

  • Fix zero data state message formatting issues.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
marrrmarrrcommented, May 4, 2022

@aaemnnosttv @wpdarren indeed when referring to the product (“Google Search” or “Search” for short), the word is capitalised. Here’s an example from a help article: “If you still can’t find your site or page in Search results…”

1reaction
aaemnnosttvcommented, Apr 8, 2022

@tofumatt I’ve passed this based on the QAB, but should ‘Search’ be capitalised? 🤔

@wpdarren I wondered the same, but it’s used that way in several places so it seems to be intentional. My guess is that it’s short for Search Console. @marrrmarrr ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Should You Capitalize After Using A Colon?
Capitalizing the first word is almost always correct if a complete sentence follows the colon. Many writers will avoid colons in their work ......
Read more >
When to Capitalize after a Colon - CMOS Shop Talk
Always cap after a colon. This is the easiest plan. It eliminates dithering, has rare exceptions,* and should require no explanation. It also ......
Read more >
Capitalization After Colons
Rule: Do not capitalize the first word of a list after a colon. ... numbered points are complete sentences, capital letters and periods...
Read more >
Do You Capitalize after a Colon? - The Writing Cooperative
There are various rules about when to capitalize the word after a colon in a sentence, depending on which style guide you use....
Read more >
Capitalization: First Word After a Colon - Grammarly
Not sure whether to capitalize after colons? Read this brief article to find out when capitalization with colons is necessary and when it's...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found