I have a Lightning Community for different countries. Have components w/ custom labels(Language : English). Labels have a German Translations(German, active). I use labels in tags:


I see only English equivalent of a label, but I need to see this in German.

For VF SF has: And this translates labels.

Do we have something like this in Lightning? Or how can I apply Translations to Custom label?

Any help will be appreciated! Thank you!

  • It is possible to use Site.com preference: Languages->Default Site Language-> Choose German. But Is there another way to translate Custom labels (Change Community User data, change lightning components? Nov 1, 2016 at 12:04

6 Answers 6


Probably this is a Salesforce bug. I have a similar problem. I'm developing a component as part of managed package. Translations work when I'm inside the development org, but I get only English values when using the component in my test org.

My workaround for this is to add a server side action that would return a map of all the custom labels used in the component and then set it as an attribute of type "Map". (You need to reference in apex or visualforce all labels anyway in order to include them in a managed package)

I don't know if your problem is the same so I submitted another question and sample code for the workaround here https://salesforce.stackexchange.com/a/150840/27814


How about this?


If there is a translation already present in Salesforce, you can look it up with a describe function, which then translates it to your locale settings (or somebody else's, whoever is using it).

I'm going to be working with this as well, as I'm currently developing an app that supposedly should also have multi-language support (have to discuss with my supervisor if and which languages, but as a start he sent me this link).

(To be clear: this is APEX code, so you do need an APEX controller attached to your lightning component)


Options to translate community were applied:

  1. Translation Workbench was used to translate picklists values.
  2. Site.com default community language was switched to German.
  3. Optionally able to implement and use URL parameter.

In case Community builder Admin have to put Label value to component parameter/attribute section: 1. Have to use declaration:


Where to use
2. Component .js controller:

< design:attribute name="headerName" label="Header Name"/>
< aura:attribute name="headerName" type="String" />

On Init: 2.1 OR 2.2.


var headerName = cmp.get("v.headerName")
var labelRef = $A.getReference(headerName)
cmp.set("v.headerName", labelRef)

2.2 Commented label name is a must

cmp.set("v.headerName", $A.get(cmp.get("v.headerName")))

Takes time to load it.

Thanks a lot for the help and ideas!


If this is a custom lightning component, all labels can be custom attribtes

initTranslations:function(component, event, helper){
   //language dependent
      var i18n ={"my_expense": "my expense"};
   component.set("v.i18n", i18n)

<aura:attribute name="i18n" type="object"/>
<ui:inputText label="{v.i18n.my_expense}" required="true"/>


  • Thank you for your reply! However I needed translations from custom label. Please find answer on separate answer. Feb 3, 2018 at 19:21

This should work out of the box. If you go to your custom label, you can add a translation to it (there is a translation related list under your label). Then using {!$Label.c.labelName} in your Lightning Component will get the correct label according to the connected user language.


What worked for me: adding an explicit translation for the default language. I had a label in my default language with name and value 'XYZ' and an English translation 'ABC'. Even though I had selected my default language while using my LWC, I still got the English translation 'ABC' in my LWC.

I then added a translation for the default language, with value 'XYZ' (obviously). And now my LWC was displaying 'XYZ'.

So LWC seems to rely on explicit translations for all languages for which you want to see translated values.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .