How to – Translation Workbench in Salesforce.com
Overview
Salesforce.com provides Translation Workbench, a feature that can be turned on only by calling in Customer Support or logging a Case through your Org. When the translation workbench feature is available, you have to login to your org and enable the feature, add new languages that you want to support and then provide translations for the areas of your application that you control.
Steps to enable Translation Workbench
- Call Salesforce.com support or enter a case to activate a feature [this feature is non-reversible after it is turned on].
- When the customer support turns it on, login to your org and Enable the feature by going to Setup -> Translation Workbench
- Add languages that you want to support for you application
- Provide translation
- Update your code to use the translations if you haven’t already done designed for globalization
At what level the translations can be turned on?
- Org level by going into Setup -> Company Information -> Edit [Default Language]
- User level by going into Setup -> Manage Users -> Edit User [Language]
However, keep in mind changing the Default Language at org level doesn’t change every user’s default language. In order for user to start seeing the content in different language, either of two things need to happen:
- Admin has to set the language at user level
- User should use a browser with the locale for the language they want to see in Salesforce.com
What gets translated?
Salesforce.com documentation mentions three main areas that get translated or need to be addressed either by Salesforce.com or by yourself in your own customizations [code or admin changes]
- Main salesforce.com application content [this is your standard look and feel of salesforce.com, standard objects and their labels]
- Online help provided by Salesforce.com
- Your own customizations – things like labels for your custom objects/fields properties, Visualforce page content that you control, picklist values you control.
Very Simple Example to illustrate the implementation
Let’s make sure we have performed following steps before we start:
- The feature has been activated by Salesforce.com customer support
- You have logged in to the Salesforce.com org and Enabled the feature [even though customer service activates the feature you still have to turn it on by going to Setup -> Translation Workbench
- Add Spanish language as the new language we are going to support in our Salesforce.com Org and make sure you have checked the Active check box.
- Create a new Custom label named Field1Label to use in our Visualforce page. Set the value for it as “Value”. Also, add a spanish language translation for this custom label and set its value to to be “Valor”
At this point we are ready to get started on creating a very simple Visualforce page that will allow us to support two languages English and Spanish.
Here is our Sample page:
Save the following in a new Visualforce page named TestCustomLabelPage
<apex:page controller="TestTranslationController">
<apex:form >
<apex:pageBlock >
<apex:pageBlockSection >
<apex:pageBlockSectionItem >
<apex:outputLabel value="{!$Label.Field1Label}"></apex:outputLabel>
<apex:inputText />
</apex:pageBlockSectionItem>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
Assuming that your Salesforce.com user has the default language set to be English, let’s see how the Visualforce page will look like this at present.
Let’s go to Edit the user and set the Language to be Espanol.
Go back and refresh the Visualforce page and we should see following page [see the label is changed to Valor [Spanish for Value as we have entered in the translation for the custom label].
What is good about the translation workbench?
- Fairly straight forward implementation as long as you are supporting the language out of the languages that Salesforce.com supports
- Ability to add new languages over time and leverage the same code infrastructure you have setup when you supported two languages
- Earlier it was pretty tedious to enter all the values manually, but recently Salesforce.com has added support for translation import/export from both Apex Data loader as well as Force.com Eclipse IDE
What is not so good about it?
- Salesforce.com supports fairly good number of languages out of the box but the number is still pretty small so if you are supporting a language that is not part of their list you are out of luck and the only option you have at that point is to build your own code infrastructure in apex to support it
- Limit on maximum number of custom labels. This could be critical given that salesforce.com supports maximum 5000 for the whole org. I am interpreting this as all the code within the Salesforce.com org and the all the AppExchange packages installed in that org, all of them have to share that pool of 5000 custom labels. In my opinion, this is pretty sparse. In a fairly complex AppExchange application you will come pretty close to using at least a few thousand custom labels and if you have an Org where you have 4-5 of those AppExchange apps installed then you are going to run into this problem. Having said that, there is a possibility that Salesforce.com may not count the custom labels included in the AppExchange apps with Aloha status but not sure about this.
Further Reading
https://na9.salesforce.com/help/doc/en/customize_wbench.htm
https://na9.salesforce.com/help/doc/en/salesforce_ide_localization.pdf
https://na9.salesforce.com/help/doc/en/entering_translated_terms_in_packages.htm
https://na9.salesforce.com/help/doc/en/salesforce_workbench_cheatsheet.pdf








