Let’s discuss here how to use the Custom labels in the lightning web components. Custom labels are text values stored in Salesforce that can be translated into any language that Salesforce supports. Use custom labels to create multilingual applications that present information (for example, help text or error messages) in a user’s native language. To create custom labels, from Setup, enter Custom Labels in the Quick Find box, then select Custom Labels. To import a label in a Lightning Web Component JavaScript file, use @salesforce/label in an import statement.

1.Create custom labels

To create custom labels, from Setup, enter Custom Labels in the Quick Find box, then select Custom Labels. Here are the custom labels created. we will see how to use the lightning web components

 

 

2. Use Custom Labels in LWC 

To import a label in a Lightning Web Component JavaScript file, use @salesforce/label in an import statement.

The label-reference is the label name and must include a namespace in the format namespace.labelName.create a lightning web component using the following SFDX command

 

Use the below labelexamples.html.To use the labels in the template, use the same {property} syntax that you use to reference any JavaScript property.

 

Use the below labelexamples.js code.

 

 

Use the below labelexamples.js-meta.xml

 

 

 

Push changes and add this component to the page layout and you can able to see labels are coming from the custom label as shown below