The successful pattern: any user-facing string in code goes through a Custom Label. The cost is one Setup record per string; the benefit is updateable wording, multi-language support, and a single surface for translators.
- Identify the string in code that needs translation or governance
Error messages, button labels, dialog titles, email subjects emitted from Apex or LWC. Each candidate becomes a Label.
- Create the Custom Label
Setup, Custom Labels, New. Name per convention (org_prefix_purpose: SDR_INVALID_EMAIL, OPS_RECORD_NOT_FOUND). Enter the default value. Pick a category.
- Add translations via Translation Workbench
For each language the org supports, enter the translated string. Translators can do this without admin access to code.
- Reference the Label in code
Apex: System.Label.SDR_INVALID_EMAIL. LWC: import from @salesforce/label/c.SDR_INVALID_EMAIL. Replace the hardcoded string with the Label reference.
- Deploy and verify
Deploy through the normal pipeline. Verify in the UI that the Label serves correctly in each supported language.
- Document the Label in the inventory
Name, purpose, owner, code references. The inventory is what saves future developers from re-creating duplicate Labels for the same string.
- Audit unused Labels quarterly
Pull the Labels list. Identify those with no code references in the past year. Retire after confirming non-use.
The API identifier code references. Convention-based naming is essential at scale.
The string served when no translation matches the user's language.
Admin-defined grouping for organization and translator workflow.
Whether the Label is accessible from non-package code. Default false for org Labels; true for managed-package internals.
Per-language values configured in Translation Workbench.
- Custom Labels are not the right tool for validation rule error messages or picklist values. Use the construct-native fields, which have their own translation paths.
- Label names cannot be changed after deployment to a packaged context. Pick the name carefully at creation.
- Orphaned Labels accumulate. Quarterly cleanup is the discipline that keeps the surface manageable.
- Translation Workbench access is a separate permission. Translators need it explicitly; without it, only admins can update translations.
- Hardcoded strings in code bypass Custom Labels. The pattern only works if developers adopt the convention; without code-review enforcement, strings get hardcoded anyway.