Custom Label : These are custom text value that can be accessed from Apex classes or Visualforce pages. These values can be translated into any language Salesforce supports. Custom labels enable developers to create multilingual applications by automatically presenting information (for example, help text or error messages) in a user’s native language. You can create up to 5,000 custom labels for your organization, and they can be up to 1,000 characters in length.
Access custom labels
- Go To Setup — Create — Custom Labels
- Click on New Custom Labels.
- Enter value for name, value and description
- We can use custom label name to access custom label value in visualforce page using $Label global variable.
- After creating custom label we can use following code to use custom label in visualforce page
<
apex:page
>
<
apex:form
>
<
apex:pageblock
>
<
apex:outputText
value
=
"Value stored in Demo custom label is: "
/>
<
apex:outputText
value
=
"{!$Label.
Demo_Label}"
/>
</
apex:pageblock
>
</
apex:form
>
</
apex:page
>
Enable the Translation Workbench
The Translation Workbench lets you specify languages you want to translate, assign translators to languages, create translations for customizations you’ve made to your Salesforce organization, and override labels and translations from managed packages. Everything from custom picklist values to custom fields can be translated so your global users can use all of Salesforce in their language.
- Go to Setup, enter Translations Settings,select Translations Settings .
- Click Enable.( The “Manage Translation” permission is enabled by default in the System Administrator profile. )
- Click Add, to add English and any other language(s) that you will be using.
- For each language that you intend to customize or translate:
- Mark the language as Active.
- Specify one or more translators who have a permission to enter the translations.
- Save it.
- Repeat the process for all the labels you want to translate.
Translate Custom Label values
- First setup your Custom Label and Add translation for it.
- Fill Translation Information
-
Now, Based on “language” attribute of <apex:page> we can define the whole page language. we can bind any othe variable also there instead of “en_US” and “fr-ch”.
-
<apex:page language="fr-ch"> {!$Label.demo_label} </apex:page>
SUPPORT
- To view the applications in Appexchange, go to Webkul Appexchnage Applications .
- For further any query : Create Ticket Now