Skip to content

Search is only available in production builds. Try building and previewing the site to test it out locally.

Ratings and Reviews dictionary

The Ratings and Reviews dictionary contains labels and messages for the review list, page controls, and review form. These include the Reviews heading, status messages, and star labels for screen readers. Change dictionary values to translate the text or match your storefront’s wording without changing drop-in code.

Choose where to maintain the text:

  • Placeholders sheet: The initializer from the quick start loads placeholders/ratings-reviews.json. Add a row with a key such as Review.title in the Key column and your text in the Value column. See Labels and placeholders.
  • Initializer code: Pass langDefinitions to initialize with only the keys to change. The drop-in uses your values for those keys and keeps the defaults for the rest.

For code-based customization, update the initializer created in the quick start. This example changes the review heading, author label, and date format:

scripts/initializers/ratings-reviews.js
import { initializers } from '@dropins/tools/initializer.js';
import { initialize, setEndpoint } from '@dropins/storefront-ratings-reviews/api.js';
import { initializeDropin } from './index.js';
import { CORE_FETCH_GRAPHQL } from '../commerce.js';
await initializeDropin(async () => {
// Configure Commerce GraphQL before initialization loads the review settings.
setEndpoint(CORE_FETCH_GRAPHQL);
return initializers.mountImmediately(initialize, {
langDefinitions: {
default: {
Review: {
title: 'Customer reviews',
// {{nickname}} is replaced with the reviewer's name.
author: 'Reviewed by {{nickname}}',
// Formats review dates for British English.
dateLocale: 'en-GB',
},
},
},
});
})();
  • Review.title changes the heading to Customer reviews when the Review container has no totalCount value.
  • Review.author keeps {{nickname}} as a placeholder for the reviewer’s name. Change the surrounding text without changing the placeholder.
  • Review.dateLocale uses en-GB to format review dates for British English. It does not translate other labels.

For multiple languages, see Dictionaries.

The drop-in provides these default English (en_US) values:

en_US.json
{
"Pagination": {
"label": "Review pagination",
"loading": "Loading review pages...",
"outOfRange": "This review page is no longer available.",
"firstPage": "Return to the first page"
},
"Review": {
"title": "Reviews",
"oneReview": "1 review",
"reviews": "{{count}} reviews",
"author": "By {{nickname}}",
"unrated": "Not rated",
"dateLocale": "en-US",
"loading": "Loading reviews...",
"empty": "No reviews on this page.",
"unavailable": "Reviews are unavailable.",
"error": "Unable to load reviews.",
"retry": "Try again"
},
"StarRatingInput": {
"starLabel": "{{count}} out of {{max}} stars"
},
"WriteReview": {
"loadError": "We couldn't load the review form. Close this window and try again.",
"ratingLabel": "Give your rating",
"ratingRequired": "Select a rating.",
"title": "Title *",
"description": "Description *",
"nickname": "Name *",
"required": "This field is required.",
"submit": "Submit",
"submitting": "Submitting",
"submitErrorHeading": "We couldn't submit your review.",
"submitErrorFallback": "Please try again.",
"ratingUnavailable": "This rating isn't available for this product.",
"successHeading": "Thanks for your review!",
"successDescription": "Your review was submitted and is pending moderation. It will appear once approved.",
"signInHeading": "Sign in to write a review",
"signInDescription": "Only signed-in customers can write reviews.",
"signIn": "Sign in"
},
"Rating": {
"label": "{{rating}} out of 5 stars",
"symbolLabel": "{{rating}} out of 5",
"valueLabel": "{{rating}} out of 5",
"compactCount": "({{count}})",
"zeroReviews": "No reviews",
"oneReview": "1 review",
"reviews": "{{count}} reviews"
}
}

Each key identifies a value in the dictionary. For example, Review.author refers to the author value in the Review group.

KeyWhere it appears
Review.titleReview list heading when totalCount is not set.
Review.oneReview, Review.reviewsReview list heading when totalCount is set.
Review.authorReviewer name in each row. {{nickname}} is the reviewer’s name.
Review.unratedText for a review that has no rating votes.
Review.dateLocaleLanguage and region used to format review dates, such as en-US or fr-FR. This value is not displayed as text.
Review.loadingScreen reader message while reviews load.
Review.empty, Review.unavailable, Review.errorStatus messages for the empty, unavailable, and error states.
Review.retryButton that requests the page again after an error.
Pagination.labelAccessible name of the page navigation.
Pagination.loadingScreen reader message while the first page loads.
Pagination.outOfRange, Pagination.firstPageMessage and button when the requested page no longer exists.
Rating.labelScreen reader label for the stars in a review row, for example, 4 out of 5 stars.
StarRatingInput.starLabelScreen reader label for each star in the review form, for example, 4 out of 5 stars.
WriteReview.ratingLabelLabel for the row of stars when the store has one rating category. With several categories, each row shows its category name.
WriteReview.title, WriteReview.description, WriteReview.nicknameForm field labels. The defaults end with * to mark required fields.
WriteReview.ratingRequired, WriteReview.requiredMessages for a missing rating and an empty field.
WriteReview.submit, WriteReview.submittingSubmit button text before and during submission.
WriteReview.submitErrorHeading, WriteReview.submitErrorFallback, WriteReview.ratingUnavailableHeading and messages when a submission fails.
WriteReview.loadErrorMessage when the rating categories cannot load.
WriteReview.successHeading, WriteReview.successDescriptionHeading and message after a successful submission.
WriteReview.signInHeading, WriteReview.signInDescription, WriteReview.signInSign-in prompt for signed-out shoppers when guests cannot write reviews.