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
chris.noechris.noe 

Record Type Name Not Translated in outputText

I've got a visualforce page the is outputting a data table with a list of accounts in the account hierarchy.  One of the columns displayed is the account record type.  We have translated the record type values in the translation workbench and they display correctly translated on the standard acccount page layout.  However, when we try to render them in a dataTable, they show the English values when a non-English user is logged in.  Anyone have any good workarounds for this?  Here is the code we are using:

 

<apex:column >
    <apex:facet name="header">{!$ObjectType.Account.Fields.Type.Label</apex:facet>
    <apex:outputText style="{!IF(pos.currentNode,'font-weight: bold;','')}" value="{!pos.account.RecordType.Name}" />
</apex:column>

 

Best Answer chosen by Admin (Salesforce Developers) 
chris.noechris.noe

Ok, here is how we were able to resolve this issue.  To clarify, our solution is using a Visualforce component to render a list of accounts with their record type values in a tree view within a Visualforce page.

 

Within the controller class that retrieves the Account data for the Visualforce component, we wrapped a toLabel() around the RecordType.Name field within our SOQL query:

 

SELECT Name, toLabel(RecordType.Name) FROM Account

 

This is documented in the API developer guide toLabel.  Record type values now display translated for our non-English speaking end users.

All Answers

backupbackup

Hi,

To change Record Type Name you have to goto App Setup --> Customize --> Tab Names and Labels --> Rename Tabs and Labels..

Here Select the Language you want to translate and then select the object from the list. Click on edit and there you can see the record name, translate this field with the appropriate value and save.

chris.noechris.noe

The solution you propose is for changing the Record Type field label.  I am referring to the actual record type values themselves, which are translated in the translation workbench.

chris.noechris.noe

Ok, here is how we were able to resolve this issue.  To clarify, our solution is using a Visualforce component to render a list of accounts with their record type values in a tree view within a Visualforce page.

 

Within the controller class that retrieves the Account data for the Visualforce component, we wrapped a toLabel() around the RecordType.Name field within our SOQL query:

 

SELECT Name, toLabel(RecordType.Name) FROM Account

 

This is documented in the API developer guide toLabel.  Record type values now display translated for our non-English speaking end users.

This was selected as the best answer
pranav.sanvatsarkarpranav.sanvatsarkar
Hello Chris,

Thanks for the solution. However, I tried it but I don't know why it is not working out for me. It is displaying the translation for the default language only i.e. English.

Any guesses for this issue?

Thanks in advance.
kalyan d 4kalyan d 4
HI Chris,can you please what is translation workbench.I am trying to convertaccount names of different languages into english.Can you please help me out