translate site

  • 2
  • Problem
  • Updated 2 years ago
  • Solved
I have a multilingual skuid form that has been made using translated custom labels and translation workbench. The form adopts the language correctly when switching the running user language. However I want to send out this form to external users using force.com sites. This means that the Sites Guest User will be the running user and the locale settings of that user will control language. Is it possible for me to somehow override this so that my force.com sites Skuid page can be translated. I  can think of four different approaches to get the language code and either one of them would be ok for me

1: Using an URL-parameter
2: Using a hidden field on the record edited (so language would be pre-filled before sending out a link to the form
3: Using a picklist so that the user can change language themselves
4: Using the Browser language setting 

Can this be done using any of the above approaches?
Photo of Peter Baeza

Peter Baeza

  • 2,868 Points 2k badge 2x thumb

Posted 4 years ago

  • 2
Photo of Zach McElrath

Zach McElrath, Employee

  • 49,056 Points 20k badge 2x thumb
Official Response
There are two approaches to get Labels within Skuid Pages to be translated in a Force.com Site environment (all of this was available as of the Superbank release, released in early 2015):

(a) Pass in the "language" URL Parameter into your pages, e.g.

/apex/skuid__UI?page=MySiteHomePage&language=en-US
/SiteHome?language=en-US

(b) Populate the language attribute on all <skuid:page> component(s) in the Visualforce Page(s) you're using in the Force.com Site page

<apex:page title="My Site Home Page" readonly="true" doctype="html-5.0" language="en-US">
   <skuid:page page="MySiteHomePage" language="en-US"/>
</apex:page>