I am using a force.com site to show a visualforce page where I want the user to have the option to select a language. In the corresponding visualforce page I set the language. How do I get this into my controller extension?


<apex:page standardController="Lead" extensions="WebToObjAttachments" showHeader="false" language="nl_NL"  standardStylesheets="false" sidebar="false" applyHtmlTag="false" applyBodyTag="false" docType="html-5.0" rendered="{!Id=null}" action="{!addMore}" >

Tried in extension

public class WebToObjAttachments {
 language = Apexpages.currentPage().getparameters().get('language');

2 Answers 2


@sfdcfox is correct there is no way to get the page language from the page the way you have it set up, because its not a parameter. You can however dynamically set the page language by passing in the parameter. This question addresses this Assign language Value dynamically in Visualforce page


The language attribute isn't a "page parameter" (those are strictly the values found in the URL after the ?). As far as I'm aware, there's no way to get this information from the page. Similarly, there's no way to detect most of the other settings, such as determining if the page is being rendered as a PDF.

  • So should I add the parameter seperateley in the page as: <apex:param name="language" value="nl_NL" assignTo="{!language}"/>. ?
    – Thomas
    Mar 27, 2020 at 11:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .