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
suresh.csksuresh.csk 

How to use Translation Workbench in VF

Hi.

 

I need to create a English and a Japanese Site.

Also added English translation for Custom Field.

The above translation setting works fine with the native Saleforce UI.

 

For example:

If I change the language setting to English ,English iLabels are displayed,.

If I change the language settigng to Japanese Japanese Labels are displayed.

 

How to implment this in the Sites.I mean how to set the language settings for Sites.

 

cheers

suresh

 

 

Shilpa_SFShilpa_SF

Hi,

 

Multi Language Support:


In order to translate labels that appear in your Visualforce pages, the translation workbench must be enabled for your organization. You will need to use the translation workbench to translate the standard and custom object labels. And you can use the custom labels feature to create translated labels for any type of text you want to use in your Visualforce pages. The following example shows a copyright label that is translated into the Spanish. Create a Custom Label for Copyright  and add the corresponding translations for the Label.

 

You can use these labels in Visualforce pages using the following syntax:

{!$Label.copyright}

The label will be rendered based on the user's language or the page language. You can set the Site level language via Site Details | Public Access Settings | Show Users | Edit user details.

You can also set the page language by passing a parameter to the page via the URL as follows:

  • Define the language parameter for your page
<apex:page language="{!$CurrentPage.parameters.lang}">

 

 

suresh.csksuresh.csk

Hi Shilpa

 

I greatly appreciate your time for me.

I also figured it out ,but  waited to update this thread because is there any  good ideas.

In my case I need to access the Custom Field Labels.

 

To access the Field Labels we can use like

<apex:page language="{!userlang}">
<apex:outputLabel value="{!$ObjectType.MyObject__c.fields.Name__c.label}"  />
</apex:page>

 

 

MyObject__c- Your custome object.

Name__c - Your custome field Label of MyObject__c

 

Shilpa I tired your way but not able to create translation text for the Custom Label

 

Created a  Custom Label "Hello" and able to access the Label.

<apex:outputLabel value="{!$Label.Hello}"  />

 

But how to translate the above Label into some other Languages.

 

cheers

suresh

 

LalitLalit

We have a requirement to translate the same visual force e-mail template in 14 different European language.

 

Translation workbench is not auto-translating the content of E-mail template, which in our case have a table coming from a custom controller inside.

Writing the New custom LABEL for all the content and changing template to use custom label will be tedious and clumsy tasks. Moreover I am not sure if label are dynamic and can change the content of table(say customer name and address) when a template is called for different customer or sales form.

If there a way Translation workbench can do the auto-translation completely based on language selected.

 

Other solution is to have 14 different template and based on language on account appropriate template will be called. Appreciate any suggestion or solution

Maurizio BellaMaurizio Bella

Hi,

someone have fix this problem?

I'm looking for some documentation about Translation Workbench and VF without success. Someone can tell me where I can find it?

Thanks for any suggest.

Kind regards,

Mauri

Christian SchüttChristian Schütt
Hi,

To use translation workbench, make sure to set desired target languages to active under Administration Setup -> Translation Workbench -> Translation Settings. If languages are set to active, field labe translations in VF site pages can be referenced using syntax "<apex:outputLabel value="{!$ObjectType.MyObject__c.fields.Name__c.label}"  />" and the site will translate them correctly to the current site users' language.