{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://lokalized.com/schema/lokalized-strings.schema.json",
  "title": "Lokalized Strings File",
  "description": "Schema for one Lokalized strings file, normally named with an IETF BCP 47 language tag such as en, en-US, or fr-CA.json.",
  "$comment": "Unicode letter, number, and mark membership in identifier patterns follows the Unicode tables used by the schema validator. Author identifiers for the oldest validator and JDK in the deployment fleet; [A-Za-z_][A-Za-z0-9_-]* is the portable ASCII subset.",
  "type": "object",
  "additionalProperties": {
    "$ref": "#/$defs/localizedString"
  },
  "$defs": {
    "localizedString": {
      "description": "A localized string may use the shorthand string form or the object form.",
      "oneOf": [
        {
          "type": "string"
        },
        {
          "$ref": "#/$defs/localizedStringObject"
        }
      ]
    },
    "localizedStringObject": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "translation": {
          "type": "string"
        },
        "commentary": {
          "type": "string"
        },
        "placeholders": {
          "$ref": "#/$defs/placeholdersMap"
        },
        "alternatives": {
          "$ref": "#/$defs/alternatives"
        }
      },
      "anyOf": [
        {
          "required": [
            "translation"
          ]
        },
        {
          "required": [
            "alternatives"
          ]
        }
      ]
    },
    "placeholdersMap": {
      "type": "object",
      "propertyNames": {
        "$ref": "#/$defs/placeholderName"
      },
      "additionalProperties": {
        "$ref": "#/$defs/placeholder"
      }
    },
    "placeholder": {
      "oneOf": [
        {
          "$ref": "#/$defs/simplePlaceholder"
        },
        {
          "$ref": "#/$defs/rangePlaceholder"
        },
        {
          "$ref": "#/$defs/templatePlaceholder"
        }
      ]
    },
    "simplePlaceholder": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "value",
        "translations"
      ],
      "properties": {
        "value": {
          "$ref": "#/$defs/placeholderName"
        },
        "translations": {
          "$ref": "#/$defs/singleAxisTranslationMap"
        }
      }
    },
    "rangePlaceholder": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "range",
        "translations"
      ],
      "properties": {
        "range": {
          "$ref": "#/$defs/range"
        },
        "translations": {
          "$ref": "#/$defs/cardinalityTranslationMap"
        }
      }
    },
    "templatePlaceholder": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "translation"
      ],
      "properties": {
        "translation": {
          "type": "string"
        },
        "alternatives": {
          "$ref": "#/$defs/fragmentAlternatives"
        }
      }
    },
    "range": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "start",
        "end"
      ],
      "properties": {
        "start": {
          "$ref": "#/$defs/placeholderName"
        },
        "end": {
          "$ref": "#/$defs/placeholderName"
        }
      }
    },
    "alternatives": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "minProperties": 1,
        "maxProperties": 1,
        "$comment": "Alternative object member names are Lokalized expressions. Expression syntax is validated by Lokalized itself.",
        "additionalProperties": {
          "$ref": "#/$defs/localizedString"
        }
      }
    },
    "fragmentAlternatives": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "minProperties": 1,
        "maxProperties": 1,
        "$comment": "Alternative object member names are Lokalized expressions. Expression syntax is validated by Lokalized itself.",
        "additionalProperties": {
          "type": "string"
        }
      }
    },
    "singleAxisTranslationMap": {
      "oneOf": [
        {
          "$ref": "#/$defs/cardinalityTranslationMap"
        },
        {
          "$ref": "#/$defs/ordinalityTranslationMap"
        },
        {
          "$ref": "#/$defs/genderTranslationMap"
        },
        {
          "$ref": "#/$defs/caseTranslationMap"
        },
        {
          "$ref": "#/$defs/definitenessTranslationMap"
        },
        {
          "$ref": "#/$defs/classifierTranslationMap"
        },
        {
          "$ref": "#/$defs/formalityTranslationMap"
        },
        {
          "$ref": "#/$defs/clusivityTranslationMap"
        },
        {
          "$ref": "#/$defs/animacyTranslationMap"
        },
        {
          "$ref": "#/$defs/phoneticTranslationMap"
        }
      ]
    },
    "cardinalityTranslationMap": {
      "type": "object",
      "minProperties": 1,
      "propertyNames": {
        "$ref": "#/$defs/cardinalityName"
      },
      "additionalProperties": {
        "type": "string"
      }
    },
    "ordinalityTranslationMap": {
      "type": "object",
      "minProperties": 1,
      "propertyNames": {
        "$ref": "#/$defs/ordinalityName"
      },
      "additionalProperties": {
        "type": "string"
      }
    },
    "genderTranslationMap": {
      "type": "object",
      "minProperties": 1,
      "propertyNames": {
        "$ref": "#/$defs/genderName"
      },
      "additionalProperties": {
        "type": "string"
      }
    },
    "caseTranslationMap": {
      "type": "object",
      "minProperties": 1,
      "propertyNames": {
        "$ref": "#/$defs/caseName"
      },
      "additionalProperties": {
        "type": "string"
      }
    },
    "definitenessTranslationMap": {
      "type": "object",
      "minProperties": 1,
      "propertyNames": {
        "$ref": "#/$defs/definitenessName"
      },
      "additionalProperties": {
        "type": "string"
      }
    },
    "classifierTranslationMap": {
      "type": "object",
      "minProperties": 1,
      "propertyNames": {
        "$ref": "#/$defs/classifierName"
      },
      "additionalProperties": {
        "type": "string"
      }
    },
    "formalityTranslationMap": {
      "type": "object",
      "minProperties": 1,
      "propertyNames": {
        "$ref": "#/$defs/formalityName"
      },
      "additionalProperties": {
        "type": "string"
      }
    },
    "clusivityTranslationMap": {
      "type": "object",
      "minProperties": 1,
      "propertyNames": {
        "$ref": "#/$defs/clusivityName"
      },
      "additionalProperties": {
        "type": "string"
      }
    },
    "animacyTranslationMap": {
      "type": "object",
      "minProperties": 1,
      "propertyNames": {
        "$ref": "#/$defs/animacyName"
      },
      "additionalProperties": {
        "type": "string"
      }
    },
    "phoneticTranslationMap": {
      "type": "object",
      "minProperties": 1,
      "propertyNames": {
        "$ref": "#/$defs/phoneticName"
      },
      "additionalProperties": {
        "type": "string"
      }
    },
    "placeholderName": {
      "type": "string",
      "description": "A placeholder or expression identifier. Unicode property membership follows the schema validator's Unicode tables.",
      "pattern": "^[\\p{L}_][\\p{L}\\p{N}\\p{M}_-]*$",
      "not": {
        "$ref": "#/$defs/languageFormName"
      }
    },
    "languageFormName": {
      "enum": [
        "CARDINALITY_ZERO",
        "CARDINALITY_ONE",
        "CARDINALITY_TWO",
        "CARDINALITY_FEW",
        "CARDINALITY_MANY",
        "CARDINALITY_OTHER",
        "ORDINALITY_ZERO",
        "ORDINALITY_ONE",
        "ORDINALITY_TWO",
        "ORDINALITY_FEW",
        "ORDINALITY_MANY",
        "ORDINALITY_OTHER",
        "GENDER_MASCULINE",
        "GENDER_FEMININE",
        "GENDER_COMMON",
        "GENDER_NEUTER",
        "CASE_NOMINATIVE",
        "CASE_ACCUSATIVE",
        "CASE_GENITIVE",
        "CASE_DATIVE",
        "CASE_INSTRUMENTAL",
        "CASE_LOCATIVE",
        "CASE_PREPOSITIONAL",
        "CASE_VOCATIVE",
        "CASE_ABLATIVE",
        "DEFINITENESS_DEFINITE",
        "DEFINITENESS_INDEFINITE",
        "DEFINITENESS_CONSTRUCT",
        "CLASSIFIER_GENERAL",
        "CLASSIFIER_PERSON",
        "CLASSIFIER_ANIMAL",
        "CLASSIFIER_LONG_THIN",
        "CLASSIFIER_FLAT",
        "CLASSIFIER_BOUND",
        "CLASSIFIER_MACHINE",
        "CLASSIFIER_VEHICLE",
        "FORMALITY_CASUAL",
        "FORMALITY_INFORMAL",
        "FORMALITY_FORMAL",
        "FORMALITY_HUMBLE",
        "FORMALITY_HONORIFIC",
        "CLUSIVITY_INCLUSIVE",
        "CLUSIVITY_EXCLUSIVE",
        "ANIMACY_ANIMATE",
        "ANIMACY_INANIMATE",
        "PHONETIC_VOWEL",
        "PHONETIC_CONSONANT",
        "PHONETIC_H_SILENT",
        "PHONETIC_H_ASPIRATED",
        "PHONETIC_S_IMPURE",
        "PHONETIC_Z",
        "PHONETIC_GN",
        "PHONETIC_PS",
        "PHONETIC_PN",
        "PHONETIC_X",
        "PHONETIC_GLIDE_Y",
        "PHONETIC_GLIDE_W",
        "PHONETIC_STRESSED_A",
        "PHONETIC_SOLAR",
        "PHONETIC_LUNAR",
        "PHONETIC_OTHER"
      ]
    },
    "cardinalityName": {
      "enum": [
        "CARDINALITY_ZERO",
        "CARDINALITY_ONE",
        "CARDINALITY_TWO",
        "CARDINALITY_FEW",
        "CARDINALITY_MANY",
        "CARDINALITY_OTHER"
      ]
    },
    "ordinalityName": {
      "enum": [
        "ORDINALITY_ZERO",
        "ORDINALITY_ONE",
        "ORDINALITY_TWO",
        "ORDINALITY_FEW",
        "ORDINALITY_MANY",
        "ORDINALITY_OTHER"
      ]
    },
    "genderName": {
      "enum": [
        "GENDER_MASCULINE",
        "GENDER_FEMININE",
        "GENDER_COMMON",
        "GENDER_NEUTER"
      ]
    },
    "caseName": {
      "enum": [
        "CASE_NOMINATIVE",
        "CASE_ACCUSATIVE",
        "CASE_GENITIVE",
        "CASE_DATIVE",
        "CASE_INSTRUMENTAL",
        "CASE_LOCATIVE",
        "CASE_PREPOSITIONAL",
        "CASE_VOCATIVE",
        "CASE_ABLATIVE"
      ]
    },
    "definitenessName": {
      "enum": [
        "DEFINITENESS_DEFINITE",
        "DEFINITENESS_INDEFINITE",
        "DEFINITENESS_CONSTRUCT"
      ]
    },
    "classifierName": {
      "enum": [
        "CLASSIFIER_GENERAL",
        "CLASSIFIER_PERSON",
        "CLASSIFIER_ANIMAL",
        "CLASSIFIER_LONG_THIN",
        "CLASSIFIER_FLAT",
        "CLASSIFIER_BOUND",
        "CLASSIFIER_MACHINE",
        "CLASSIFIER_VEHICLE"
      ]
    },
    "formalityName": {
      "enum": [
        "FORMALITY_CASUAL",
        "FORMALITY_INFORMAL",
        "FORMALITY_FORMAL",
        "FORMALITY_HUMBLE",
        "FORMALITY_HONORIFIC"
      ]
    },
    "clusivityName": {
      "enum": [
        "CLUSIVITY_INCLUSIVE",
        "CLUSIVITY_EXCLUSIVE"
      ]
    },
    "animacyName": {
      "enum": [
        "ANIMACY_ANIMATE",
        "ANIMACY_INANIMATE"
      ]
    },
    "phoneticName": {
      "enum": [
        "PHONETIC_VOWEL",
        "PHONETIC_CONSONANT",
        "PHONETIC_H_SILENT",
        "PHONETIC_H_ASPIRATED",
        "PHONETIC_S_IMPURE",
        "PHONETIC_Z",
        "PHONETIC_GN",
        "PHONETIC_PS",
        "PHONETIC_PN",
        "PHONETIC_X",
        "PHONETIC_GLIDE_Y",
        "PHONETIC_GLIDE_W",
        "PHONETIC_STRESSED_A",
        "PHONETIC_SOLAR",
        "PHONETIC_LUNAR",
        "PHONETIC_OTHER"
      ]
    }
  }
}
