Translations API: Sample Flows

This article presents possible use cases and corresponding sample flows that you can support. It provides a useful starting point as you plan your implementation.

Label a component for screen readers

To label a component for screen readers, follow these steps:

  1. Retrieve a lookup function for your component's namespace:

    Copy
  2. Retrieve the label by its key. Specify an English fallback, so screen readers don't announce the key when the namespace has no string for it:

    Copy
  3. Set the label as the button's aria-label:

    Copy

Pass a set of labels to your own component

To pass a set of labels to your own component, follow these steps:

  1. Retrieve every string in your component's namespace:

    Copy
  2. Read each label by its key, with your own default for a key the namespace doesn't have. getTranslations() has no fallback, so a missing key is undefined:

    Copy
  3. Pass the labels to your own Carousel component, with your own products list:

    Copy

Last updated: 21 October 2026

Did this help?