I'm developing a lightning 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 where I install the beta of my package.
In visualforce translations always work.
I'm using the standard lightning component syntax to access custom labels like below.

<lightning:button  label="{!$Label.namespace.myCustomLabel}" onclick="{!c.myFunction}"/>
  • did you package the translation components? Dec 4, 2016 at 8:03
  • @Itai yes. "Language Translation" component is listed in my package. Custom label translations work everywhere except the lightning component.. Dec 5, 2016 at 8:18
  • 2
    I struck what was superficially the same problem recently. When translating strings the changes did not appear in the lightning components in the UI, although I could see them in Apex. I found that logging out and logging in again (or opening a session in another browser) resulted in the translated strings appearing, suggesting they're fairly aggressively cached in the UI. Potentially not the same issue as you were experiencing 2 years ago, but maybe this will be useful to someone
    – James
    Dec 17, 2018 at 16:49

2 Answers 2


My current workaround for this is to add a server side action (custom labels work in apex) 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 all custom labels anyway in order to include them in a managed package)

bottleneck: You have to make sure you load labels before doing anything else. If you have nested structure of your components and you load labels only once in the root component -> you have to manage loading of custom labels to insure the labels attribute is accessed only when it's populated.

Apex controller:

public static Map<String,String> getCustomLabelMap(){
    Map<String,String> customLabelMap = new Map<String, String>();
    return customLabelMap;

Lightning Component:

<aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
<aura:attribute name="LABEL" type="Map" access="private"/>

<lightning:button label="{!v.LABEL.MyCustomLabel1}" onclick="{!c.myFunction}" />

Lightning Component Controller:

    doInit: function (component, event, helper) {
        var action = component.get("c.getCustomLabelMap");
        action.setCallback(this, function (response) {
                var LABEL = response.getReturnValue();
    myFunction: function () {

Enabling the Translation Workbench in the Subscriber Org fixed the issue for us.

Please not that Labels returned from Apex work without Translation workbench - so I assume, there is something off.

You must log in to answer this question.

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