JSON Format

Format

Simpleen supports JSON (JavaScript Object Notation) in different forms.

// Simple JSON Objects
{
    "key": "string to translate",
    "key2": "more to translate"
}

// Simple JSON Array
["string to translate", "more to translate"]

// Deep JSON strucutres
{
   "main": {
       "key": "string to tanslate",
       "key2": "more to tranlsate"
   }
}

// Combination of object and array
{
    "product": {
        "name": "Simpleen",
        "tags": ["translation", "simple", "saas"]
    }
}

By default all strings are getting translated.

The following data types are not getting translated. They are getting returned in the result unaltered:

  • numbers (1.5, 10)
  • null
  • boolean (false, true)

If you need to translate a part of your JSON data, see Selections below.

Selections

Selections are used to translate some specific parts of your JSON strucutre. They are defined as a JSON Path. This feature is optional and considered more advanced.

// Data
{
    "main": {
        "save": "Save",
        "delete": "Remove"
    },
    "meta": {
        "url": "https://simpleen.io",
        "slug": "documentation"
    }
}

// Selections to tranlsate only main
// $.main

The translation result is merged with the excluded data again.