# Label XML: Custom Labels and translation metadata shapes This covers the two metadata XML files you author: the English base labels and the per-language translations. --- ## Custom Labels: `force-app/main/default/labels/CustomLabels.labels-meta.xml` This holds the **English base labels**: the source of truth for label content. ### Structure ```xml Welcome_Text en_US false Welcome banner heading Welcome Save_Button en_US false Save button label Save ``` ### Fields | Field | Purpose | Notes | |---|---|---| | `` | The label's API name | Used in `t("Key")` calls and the manifest (`"c:Welcome_Text"`). PascalCase, descriptive, unique. | | `` | Language code | Always `en_US` for the base label file. | | `` | Managed package protection | Always `false` for custom labels in your org (you can edit them). | | `` | Internal description | For translators/developers, not shown to users. Describe what the label is for. | | `` | The English text | What the user sees. Can include `{0}`, `{1}` placeholders for interpolation. | ### Key naming conventions Choose keys that are: - **Descriptive**: `Welcome_Text` is better than `Label1` - **Context-aware**: `Save_Button` vs `Save_Failed_Message` (same verb, different role) - **Unique**: two labels shouldn't share a key even if the current text happens to match Format: `_` in PascalCase with underscores between parts. **Examples:** - `"Welcome"` → `Welcome_Text` or `Welcome_Heading` - `"Save"` → `Save_Button` - `"Failed to save {0}: {1}"` → `Save_Failed_Message` - `"Showing {0} of {1} records"` → `Record_Count_Display` --- ## Translations: `force-app/main/default/translations/.translation-meta.xml` One file per translated language (e.g., `es.translation-meta.xml` for Spanish, `fr.translation-meta.xml` for French, `ja.translation-meta.xml` for Japanese). ### Structure ```xml Welcome_Text Save_Button ``` ### Fields | Field | Purpose | Notes | |---|---|---| | `` | The label's API name | Must exactly match the `` in `CustomLabels.labels-meta.xml`. | | `