Skip to content
Operator handbook
Static Words
Hygraph
Hygraph

Static Words in Hygraph

This article explains the function of "Static words" in Hygraph

A static word is a placeholder for text that can appear in various pages throughout the website which is not part of regular content that is for instance found on product pages or category pages. It's called "Static" because it remains in one static place on the website.

Here are some examples from Vitamin Express

In the Footer

In the Footer

In the Footer

On a product display page.

On a product display page.

On a product display page.

In Hygraph you can find the Static words in the Content sections, under Default views

In Hygraph you can find the Static words in the Content sections, under Default views

The easiest way to find a static word is to copy it from the website and paste it in the search bar on the static word page in Hygraph,

The keys of the static word in Hygraph should give a pretty clear indication of where they can be found.

Static Words in Hygraph

Changes to static words made in Hygraph require a build to be reflected on the website.

Fields

Unique Key (uniqueKey) — required. Development owns this. Do not invent colliding unique keys.

Value (value) — localized string shown in the shop. Empty locale falls back (usually English).

Override Value (overrideValue) — per-storefront replacement. Use only if your process says so.

Singular & Plural

When a static word is used which can exist in a Singular and Plural form, there is a specific expression used in Hygraph to reflect both forms on the website. This is referred to as ICU Message Format pluralization.

Singular & Plural

Breaking down the above example:

First, brackets are opened and everything pertaining to the word which has a singular and plural form must be contained in it. It tells Hygraph that everything within it is part of the same expression.

({count, plural, one {# review} other {# reviews}})

Second, the first curly brackets are opened directly after the first bracket this tells Hygraph that a placeholder is being referenced.

({count, plural, one {# review} other {# reviews}})

Third, the argument count is stated which tells Hygraph to interpret the text as an ICU Message Format pluralization.

({count, plural, one {# review} other {# reviews}})

Then, the first comma separator is used to end the argument.

({count, plural, one {# review} other {# reviews}})

Following the comma the format type, plural, is noted.

({count, plural, one {# review} other {# reviews}})

Afterwards, the first part of the argument, one {# review}, states the value for the singular form of the static word.

({count, plural, one {# review} other {# reviews}})

After this, the second part of the argument, other {# reviews}, states the value for the plural form of the static word.

({count, plural, one {# review} other {# reviews}})

Using this example, when there is a single value, the system will use the word: “review”.

If there are more than one, the system will instead use: “reviews”.

Angle brackets <0>

Some translations contains angle brackets with numbers, like <0>this</0>. All the angle brackets will later be replaced by HTML tags. Please leave the angle brackets as they are, and only translate the text. Example:

Angle brackets 0

{{curly brackets}}

Words in curly brackets are automatically replaced with another meaningful value. Please do not translate what is in between curly brackets.

See example below. On the website this sentence will look like: If there is an account associated with john@doe.com you will receive an email with a link to reset your password.

{{curly brackets}}

New Static Words

When a new static word is created by the development team, it will only have an English value, and all localized values must be entered manually.

Static words are announced by the dev team on a dedicated slack channel.

Static words are announced by the dev team on a dedicated slack channel.