PPROLint

Labels

Word a field's value per language, or add an optional part to a sentence.

A placeholder shows a field's value as it is: {marker.type} shows Comment, in every language. When a value must be worded per language, declare a label: a field, and for each of its values a localized template. {labels.<name>} in a message shows the template of the current value.

"labels": {
  "markerType": {
    "field": "marker.type",
    "values": {
      "Comment": { "en_US": "Comment", "fr_FR": "Commentaire" },
      "Chapter": { "en_US": "Chapter", "fr_FR": "Chapitre" }
    }
  },
  "marker": {
    "field": "marker.named",
    "values": {
      "true": { "en_US": "Marker \"{marker.name}\" ({labels.markerType})", "fr_FR": "Marque « {marker.name} » ({labels.markerType})" },
      "false": { "en_US": "Unnamed marker ({labels.markerType})", "fr_FR": "Marque sans nom ({labels.markerType})" }
    }
  }
},
"checks": [
  {
    "condition": { "field": "marker.start", "operator": "greaterThan", "value": { "field": "sequence.end" } },
    "message": "{labels.marker} at {marker.startTimecode} is after the end of the sequence."
  }
]

How a label is chosen:

  • Values are matched as text: a boolean field's values are "true" and "false".
  • A locale with no template falls back to English, and a value with no entry shows the value itself.
  • Templates may use placeholders, other labels and plural forms.

A template may be empty. A label then adds an optional part to a sentence: the built-in Required markers rule builds "Chapter" marker named "Start" from four labels, each empty when the requirement does not set it.