Add labels with translations to migrations. Use for ANY UI text - titles, buttons, messages, placeholders, etc.
MANDATORY: Validate with AskUserQuestion BEFORE writing to migration.
Add translation labels to migrations for all UI text.
Format: <feature>_<context>_<element>
| Part | Examples |
|---|---|
| feature | engagement, event, cohort |
| context |
confirm_done, edit, list |
| element | title, btn, placeholder |
Prefix js_ for keys only used in JavaScript.
$this->addLabelFO('key', ['FR' => '...', 'EN' => '...']); // Front office
$this->addLabelBO('key', ['FR' => '...', 'EN' => '...']); // Back office
sk_language table{
"questions": [{
"question": "Label proposé :\n• Clé : feature_action_title\n• Cible : labelFO\n\nTraductions :\n• FR : Titre\n• EN : Title\n\nCorrect ?",
"header": "Label",
"options": [
{"label": "Oui, valider", "description": "Correct"},
{"label": "Modifier", "description": "Changer"}
],
"multiSelect": false
}]
}
<feature>_<context>_<element> convention