3

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?

Uwe Heim
  • 28,350
  • 18
  • 115
  • 283
  • 1
    I believe this is answered here: http://salesforce.stackexchange.com/questions/70748/lightning-how-to-use-custom-labels-inside-components?rq=1 – Scott Morrison Nov 02 '15 at 15:34

1 Answers1

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")
Brian Miller
  • 5,212
  • 3
  • 31
  • 65
Himanshu
  • 10,486
  • 5
  • 20
  • 33