function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Vijay BirsinghVijay Birsingh 

Translate Custom Label values

Hello,
          I have to display the name of the object on a visualforce page. I am actually using a custom label to display the name of the standard object. But, this name of the standard object must be displayed in English and French as well, may I know if it is possible to display the name of the object through the use of Translation? Or is there any other way other than If..Else, constructs.

I thank you.

Kind Regards,
Vijay.
Best Answer chosen by Vijay Birsingh
hitesh90hitesh90
Hello Vijay,

We can fulfill your requirement with the use of one of the salesforce feature "Translation Workbench (https://help.salesforce.com/apex/HTViewHelpDoc?id=customize_wbench.htm)".


First setup your Custom Label as per below screenshot.

User-added image

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".

Visualforce Page: English
<apex:page language="en_US">
    {!$Label.Account}
</apex:page>

Visualforce Page: French
<apex:page language="fr-ch">
    {!$Label.Account}
</apex:page>
Let me know if you have any question on this.

Thank You,
Hitesh Patel
Email :- hiteshpatel.aspl@gmail.com
http://mrjavascript.blogspot.in/

All Answers

hitesh90hitesh90
Hello Vijay,

We can fulfill your requirement with the use of one of the salesforce feature "Translation Workbench (https://help.salesforce.com/apex/HTViewHelpDoc?id=customize_wbench.htm)".


First setup your Custom Label as per below screenshot.

User-added image

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".

Visualforce Page: English
<apex:page language="en_US">
    {!$Label.Account}
</apex:page>

Visualforce Page: French
<apex:page language="fr-ch">
    {!$Label.Account}
</apex:page>
Let me know if you have any question on this.

Thank You,
Hitesh Patel
Email :- hiteshpatel.aspl@gmail.com
http://mrjavascript.blogspot.in/
This was selected as the best answer
Vijay BirsinghVijay Birsingh
Hello,

               Thank you.

Regards,
Vijay.