Translation with custom Label

Custom Labels are custom text values, up to 1,000 characters, that can be accessed from Apex Classes or Visualforce Pages. If Translation Workbench has been enabled for your organization, these labels can then be translated into any of the languages salesforce.com supports. This allows developers to create true multilingual apps by presenting information to users - for example, help text or error messages - in their native language. You can create up to 5,000 custom labels.
Note:We can traslate custom label on VF page by setting language varible as a hardcode value.If we want  transalate on behalf of user language then no need to set language attribute in vf page.
<apex:page language="fr" >
  {!$Label.test}<!-- will always give french translation  since language attribute is being  set in page-->
</apex:page>

Limitations:
1.Can not get formatted text as in rich field using output text by setting escape false
2.Limit of 1000 characters while in rich field of object allows 131,072 characters .
3.we can create max 5,000 custom labels only



To See the Translation

In Salesforce, if user's personal language setting specifies a language and the text has a value for that language, then the translated value is displayed. Otherwise, Salesforce displays a master/default value or an overridden value if you have provided one.
To see translations that you enter in Translation Workbench, specify the desired Language in your personal settings.
To change the personal language setting:
  1. Navigate to user name > Setup > Personal Setup > My Personal Information > Personal Information.
  2. Click Edit.
  3. In the Locale Settings section, change the Language setting.
  4. Click Save.

Enable Translation in Salesforce


To use the Translation Workbench, enable Translation Workbench in your Salesforce org.
To enable Translation Workbench:
  1. Navigate to user name > Setup > Administration Setup > Translation Workbench > Translation Settings.
  2. Click Enable.
    Enable_Translation.png
  3. Click Add to add English and any other language(s) that you will be using.
  4. For each language that you intend to customize or translate:
    1. Mark the language as Active.
    2. Specify one or more translators who have a permission to enter the translations.
      NewLanguage.png
  5. Click Save.
If you need additional details on configuring the Translation Workbench, refer to the Salesforce documentation.

Translate in the Salesforce UI

Translate and Customize Labels



Custom labels are used for page titles and other page text, some button labels, and error messages. For these items, Salesforce supports:
  • A default value
  • Optional translated values for multiple languages
To view and edit the existing custom labels used in Zuora for Salesforce:
  1. Navigate to user name > Setup > Create > Custom Labels. A list of custom labels appears. Since you may have multiple applications in your org, you may see custom labels that are not related to Zuora for Salesforce.
    Custom_Labels.png
  2. Clicking on a Name you want to translate.
  3. On the Custom Label page, click New Local Translations / Overrides.
  4. On the New Translation page, select the language in the Language field.
  5. In the Translation Text field, enter the translated text. 
    NewTranslation.png
  6. Click Save.
  7. On the Translation Detail page, you see the new translation text you just entered.
    Translated.png



$Label

A global merge field type to use when referencing a custom label.

Usage

Use this expression in a Visualforce page to access a custom label. The returned value depends on the language setting of the contextual user.​ The value returned is one of the following, in order of precedence:
  1. The local translation’s text
  2. The packaged translation’s text
  3. The master label’s text

Example

1<apex:page>
2   <apex:pageMessage severity="info"
3   strength="1"
4   summary="{!$Label.firstrun_helptext}"
5   />
6</apex:page>

Counters