0

I'm trying to understand how one can get static text on a custom template content translated to the chosen language while generating a Quote Document. I tried using custom labels with translations but it respects logged in User's language not the language chosen while generating document.

-Thanks.

1 Answer 1

1

There is a language parameter passed to the Visualforce page. You can use this to set the language.

The first line of your Visualforce page could look something like this to take advantage of this:

<apex:page language="{!$CurrentPage.parameters.language}" showHeader="false" sidebar="false" cache="false" contentType="text/xml">

Here's another post showing what parameters get passed to your page: https://salesforce.stackexchange.com/a/360947/87

1
  • Thanks a lot Daniel for pointing out this. This is what i'm going to try out - based on the chosen language(detect this on controller using getParameters() and then use the same to fetch the text stored on localization record, use the default value of a quote template field(say I have a custom field named From Title with default value From and german translation Von) when the chosen language is default or english otherwise use the text from localization record (match using chosen language & API name of the field like From__c on controller to relevant fields on Localization object).
    – Sagnik
    Oct 30, 2021 at 20:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.