Formats

JSON Translation Format

Using JSON files to store translation key-value pairs for web applications.

Definition

JSON (JavaScript Object Notation) is the most popular translation file format for modern web applications. Translations are stored as key-value pairs, often with nested structures for organization. JSON is native to JavaScript, easy to parse, and human-readable. Variations include flat JSON, nested JSON, and JSON with metadata (like i18next's structure with _context keys).

Examples

  • Flat: {"hello": "Hola", "goodbye": "Adios"}
  • Nested: {"nav": {"home": "Inicio", "about": "Acerca"}}
  • With metadata: {"key": "value", "key_context": "Button label"}
  • i18next style: {"key": "value", "key_plural": "values"}

Frequently Asked Questions

Should I use flat or nested JSON?

Nested is more organized and mirrors component structure. Flat is simpler and works better with some tools. Recommendation: use nested for larger projects (easier to find keys), flat for smaller projects. Consistency matters more than choice.

How do I handle plurals in JSON?

Depends on library. i18next: key, key_plural suffix. react-intl/FormatJS: ICU syntax within the value. vue-i18n: pipe syntax or linked messages. Check your library's documentation for the correct format.

Related Terms

Ready to simplify your i18n workflow?

Start managing translations with IntlPull.

    JSON Translation Format - Definition & Examples | IntlPull Glossary | IntlPull