Label Localization¶
Using Skuid SFX, it’s possible to create custom labels within the pages you create. Custom labels can be implemented in Apex classes, Visualforce pages, and Lightning components.
For the purposes of this documentation, we will focus on using custom labels and translations with Skuid. For specific information about custom labels, supported languages, and translation in Salesforce, check out their documentation on:
- Creating custom labels
- Enabling and disabling the Translation Workbench
- Creating translations in the Translation Workbench
Displaying Labels in Skuid¶
To display custom labels in Skuid:
- Click the Skuid Page container within the canvas to access Page Properties within the Properties pane.
- Click the Labels tab.
- Click Add Label.
- Click the newly created label.
- For Label Id, enter the name of the label you wish to include in your page.
- Click Save.
Repeat these steps for every label you want to use on this page.
Reference the Label with Merge Syntax¶
Once you have created references to your labels in the Skuid page, you can reference them in any field in that page that accepts merge syntax using the $Label global merge variable. This includes Page Title, fields, etc.
For example, if you want to include a custom label “label_test” in a Page Title, you would reference the label using {{$Label.label_test}}.
Displaying Other Translations¶
Using Salesforce’s Translation Workbench and the $Label merge variable, you can automatically translate your custom labels into your end users’ native languages. This is especially useful if your organization has multiple locations across the globe. Just ensure you are using $Label on all buttons.
If labels have an appropriate translation, users will see that translation based on their personal language setting.
Note
If you are setting a specific button action, such as like Save or Cancel, these labels will defer to the default Salesforce label as long as no other label is inserted. This means you do NOT need to include the $Label merge variable.
Additional Translations in Skuid Pages¶
The Translation Workbench can be used to display items beyond just labels and notes. However, these labels require double curly brackets to reflect translations for the user. This is because triple curly brackets tell Skuid to display only the raw (unformatted) data regardless of locale-specific settings.
Note
Using the field picker may automatically insert a field using triple curly brackets, which will not display locale-specific info. (This means the translation won’t display.) Remember to check—and correct for—double curly brackets when using the field picker.
For example, you would like the values of a picklist—such as the Stage field on the Opportunity object—to be translated. If you want to use the Stage field in a filter set, set the Option Label Template to {{stageName}}, not {{{stageName}}}. (Triple brackets will not translate the value.)
Troubleshooting¶
Having trouble with custom labels and translations? Make sure that:
- you have specified your labels in the Labels tab.
- your labels are not marked as protected components. Edit the custom label to unmark this property.