• eoates
  • NEWBIE
  • 0 Points
  • Member since 2009

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 3
    Replies

I have a visualforce page which is being rendered as a PDF.  I have set the language to "utf-8" , when I do this it causes only the english field labels to be displayed even if the user has their language set to something else.  If I do not set the language of the page to "utf-8"  Chinese Characters do not render.   Any suggestions.

 

 

   ...the page tag...

 

<apex:page standardController="SFDC_Channel_Account_Plan__c" extensions="ext_Objective,revenueDetails,MDFCalculate,goalInfo" showHeader="false" renderAs="pdf" language="utf-8">

 

 ....example field label...

<apex:outputLabel value="{!$ObjectType.SFDC_Channel_Account_Plan__c.Fields.Name.label}"/>

 

 

I have a VF page that uses custom labels, which are translated, and are properly localized when setting the page language via a URL param.  I also have a custom radio button list that uses labels for some of the values, which is created on the fly in the controller.  I'm running into an issue where the VF-included labels are properly grabbing the correct language translation, but the Apex-included labels are not.

 

So...howdo I override the controller itself to be using a specific language, rather than just the VF page?

 

In Apex, you can only call a label via System.Label.labelname , so it seems like it's completely dependent on the user's browsing/set language.  I need this for Sites, so I would like to ensure that the language param passed to the VF page overrides any SF magic/automation on language detection/setting.