Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

Interpolation allows dynamic values to be used within translations.

In the JSON file, we use {{ }} brackets to indicate where we will be using interpolation. This value will change depending on our provided value in the translation hook.

user_pet: "I have a pet {{animal}}"

Our code where the translation key is rendered:

t('user_pet', {animal: "cat"})

The code will now appear as:

"I have a pet cat"

  • No labels