4

For Visualforce we are using custom labels as described here:

https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_variables_global_label.htm

The usage is very simple:

{!$Label.yourLabelName}

Labels are a very important building brick if it comes to I18n/L10n and translations using Translation Workbench.

Are they supported in Lightning Components yet?

6

Use custom labels in Lightning components with the $Label global value provider.

Use this syntax to access custom labels in Lightning components:

$Label.c.labelName for the default namespace

$Label.namespace.labelName if your org has a namespace Here are some examples.

Label in a markup expression using the default namespace
{!$Label.c.labelName}

Label in JavaScript code if your org has a namespace

$A.get("$Label.namespace.labelName")

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.