Loading
Salesforce Enforces New Security Requirements in Summer 2026Read More
Enhance Salesforce with Code
Custom Labels

Custom Labels

Custom labels enable developers to create multilingual applications by automatically presenting information (for example, help text or error messages) in a user’s native language. Custom labels are custom text values that can be accessed from Apex classes, Visualforce pages, Lightning pages, or Lightning components. The values can be translated into any language Salesforce supports.

Required Editions

Available in: both Salesforce Classic and Lightning Experience
Available in: Developer, Professional, Enterprise, Performance, and Unlimited Editions
User Permissions Needed
Create, edit, or delete custom labels: Customize Application
Create or override a translation:

Manage Translation

OR

View Setup and Configuration and be designated as a translator

You can create up to 5,000 custom labels for your organization, and they can be up to 1,000 characters in length. Custom labels from managed packages don’t count toward this limit.

To access custom labels, from Setup, enter Custom Labels in the Quick Find box, then select Custom Labels.

How you add a custom label to your application depends on the user interface. For more information on the following syntax, see the corresponding developer guides.

  • In Apex use the System.Label.Label_name syntax. You can also use methods in the System.Label class to check for and retrieve translated labels. To check if translation exists for a label and language in a namespace, use translationExists(namespace, label, language). To retrieve the label for a default language setting or for a language and namespace, use get(namespace, label, language).
  • In Flow Builder, use the $Label global variable.
  • In Visualforce, use the $Label global variable.
  • In Aura components, use the $Label.c.labelName syntax for the default namespace or $Label.namespace.labelName if your org has a namespace or to access a label in a managed package.
  • In Lightning web components, import the label using the @salesforce/label/namespace.Label_name syntax.
  • In Lightning App Builder component labels and attributes, use the {!$Label.customLabelName} expression.

Include the label in your application when you package it for the AppExchange.

Tip
Tip If a custom label has translations, include the translations in a package by explicitly packaging the desired languages.
  • Create and Edit Custom Labels
    Create custom labels that can be referenced from Apex classes, Visualforce pages, Lightning pages, or Lightning components to make an app multilingual.
  • Translate Custom Labels
    Translations for custom labels determine what text to display for the label’s value when a user’s default language is the translation language.
 
Loading
Salesforce Help | Article