How to deal with placeholders and interpolation in JSON strings?

Placeholders are essential in dynamic texts — for example, messages like "Welcome, {username}!" or "You have {count} new notifications." In JSON translations, these variables must stay intact across all languages to prevent runtime errors or formatting issues.

Localazy automatically recognizes common placeholder patterns such as {variable}, %s, or ${value}. During translation, it protects them so translators can’t accidentally modify or delete them. Each placeholder appears clearly highlighted in the editor, making it easy to understand where and how it will appear in the final text.

To keep translations accurate, you can also:

  • Add notes or descriptions to explain what each variable means (e.g., {count} = number of items).
  • Use plural rules to adapt messages based on variable values (like “1 message” vs. “3 messages”).
  • Validate placeholders automatically with Localazy’s built-in QA checks, ensuring translations always contain the source variables.

This approach keeps your JSON translations both developer-friendly and safe for dynamic, variable-rich content across multiple languages.

Was this article helpful?

Please help us with improving our documentation.
We appreciate all your feedback.

Category

Last updated

27/10/2025