• Helge Kosuch
  • NEWBIE
  • 0 Points
  • Member since 2014
  • Software Developer

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies

Hi,

 

We are using Custom Labels for the translation of our application. In Apex Code, the method getLabel() retrieve the value of a given label in the language of the user. For example to retrieve the value of custom label we use: 

 

Schema.DescribeFieldResult F = Quote__c.Quote_Comment__c.getDescribe();

F.getLabel();

 

This getLabel() method returns the text label in the language of the user. However, we would like to get it in other languages. 

 

Let's illustrate this with an example. We've built a multi-langual quote engine (that can print quote in pdf thanks to a Visualforce page). As of now the Quoteis generated in the language of the user. However, we would like the user to be able to manually select in which language the Quote needs to be printed.

Therefore we need to be able to retrieve all CustomLabels translation in the Apex Code controller of the page to display thefields in the correct language (as chosen by the user).

 

It does not seem possible to do something like getLabel('Spanish') to retrieve the label translated in Spanish. Does anyone can confirm Apex Code do not support such a functionality? 

 

Thanks a lot in advance, 

 

Alexandre 

Message Edited by a_pitsaer on 08-31-2009 06:30 AM
Message Edited by a_pitsaer on 08-31-2009 06:31 AM
Message Edited by a_pitsaer on 08-31-2009 09:04 AM