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
TomSnyderTomSnyder 

Translation does not seem to work property

I'm Trying force the pageblocks below to use 'en' as the translated language using the lang="en" attribute.  I tried using the attribute at all levels (pageblock, pageBlockSection, and below).  My person settings language is 'de' and its keeps render the labels in 'de', i would prefer not to hardcode the english labels unless neccessary.
Why does lang attribute not effect the labels?
 

<apex:pageBlock title="Section: Highlighted Call Reports" rendered="{!IF(sec5.selected==(2^16),'true','false')}" tabStyle="Call_Report__c" lang="en"> <apex:repeat value="{!callReportsHighlight}" var="crh" id="callReportsHighlight" > <apex:pageBlockSection columns="1" title="Section: {!crh.name} [{!crh.Channel__c}]" lang="en"> <apex:pageBlockSectionItem ><apex:outputLabel value="Name"/><apex:outputLink value="/{!crh.Id}" target="_blank">{!crh.Name}</apex:outputLink></apex:pageBlockSectionItem> <apex:outputField value="{!crh.Call_Date__c}" lang="en"/> <apex:pageBlockSectionItem ><apex:outputLabel value="Account Name"/><apex:outputLink value="/{!crh.Account__r.Id}" target="_blank">{!crh.Account__r.Name}</apex:outputLink></apex:pageBlockSectionItem> <apex:pageBlockSectionItem ><apex:outputLabel value="Related Initiative"/><apex:outputLink value="/{!crh.Related_Initiative__r.Id}" target="_blank">{!crh.Related_Initiative__r.Name}</apex:outputLink></apex:pageBlockSectionItem> <apex:outputField value="{!crh.Next_Steps__c}" lang="en"/> <apex:outputField value="{!crh.Summary__c}" lang="en"/> </apex:pageBlockSection> </apex:repeat> </apex:pageBlock> <apex:pageBlock title="Section: Summary Reports" rendered="{!IF(sec6.selected==(2^20),'true','false')}" tabStyle="Call_Report__c" lang="en"> <apex:repeat value="{!callReportsHighlight}" var="crh" id="callReportsSummary"> <apex:pageBlockSection columns="1" title="Section: {!crh.name} [{!crh.Status__c}]" lang="en"> <apex:pageBlockSectionItem ><apex:outputLabel value="Name"/><apex:outputLink value="/{!crh.Id}" target="_blank">{!crh.Name}</apex:outputLink></apex:pageBlockSectionItem> <apex:outputField value="{!crh.Type__c}" lang="en"/> <apex:outputField value="{!crh.Status__c}" lang="en"/> <apex:outputField value="{!crh.Call_Date__c}" lang="en"/> <apex:pageBlockSectionItem ><apex:outputLabel value="Account Name"/><apex:outputLink value="/{!crh.Account__r.Id}" target="_blank">{!crh.Account__r.Name}</apex:outputLink></apex:pageBlockSectionItem> <apex:outputField value="{!crh.Summary__c}" lang="en"/> <apex:outputField value="{!crh.Issues__c}" lang="en"/> <apex:outputField value="{!crh.Training_Update__c}" lang="en"/> <apex:outputField value="{!crh.Next_Steps__c}" lang="en"/> </apex:pageBlockSection> </apex:repeat> </apex:pageBlock>

 


Message Edited by tesii on 03-17-2009 06:14 AM
Best Answer chosen by Admin (Salesforce Developers) 
jwetzlerjwetzler

You're both correct.  The language attribute on apex: page is only for use with custom labels.  It will not affect any standard labels pulled in by salesforce.

 

When you use outputField/inputField inside of pageBlockSection to get the automatic label generation it will be localized to the language of the user viewing the page.  Log an idea on the IdeaExchange if you're interested in any added functionality. 

Message Edited by jwetzler on 03-17-2009 09:07 AM

All Answers

JimRaeJimRae
The way I read the instructions, once you create the translated labels, you need to reference them with the $Label merge field.
TomSnyderTomSnyder

Jim,

 

$Label is used for accessing 'Custom Labels' not the sobject fieldname labels which I'm referring to.

 

 

jwetzlerjwetzler

You're both correct.  The language attribute on apex: page is only for use with custom labels.  It will not affect any standard labels pulled in by salesforce.

 

When you use outputField/inputField inside of pageBlockSection to get the automatic label generation it will be localized to the language of the user viewing the page.  Log an idea on the IdeaExchange if you're interested in any added functionality. 

Message Edited by jwetzler on 03-17-2009 09:07 AM
This was selected as the best answer