Salesforce provide functionality through which you can create single VF page and that can be translated in different languages based on language or locale preference of current logged in user.
You need to upload the translation of all custom fields which you are going to use in VF page and can utilize custom labels to display warning, error information on VF page.
In order to render the VF page in particular language, use Language attribute on <apex:page> tag. You can also bind this values with controller variable so that you can render VF page in different language.
<apex:page controller="SK_LocalizationTestController" language="{!selectedLang}">
I have created a very simple VF page to illustrate this functionality by displaying account information. I have dropdown on VF page through which user will select language and VF page will re render to display page in selected language.
Note:
DYNAMIC APEX IN SALESFORCE
SOQL INJECTION IN SOQL
CUSTOM METADATA AND CUSTOM SETTINGS IMPLEMENTATION TRICKS
SMART TABLE USING ANGULARJS IN VISUALFORCE PAGE
REST API TUTORIAL FOR SALESFORCE
VISUALFORCE COMPONENT FOR RECORD STATUS BAR
DYNAMICALLY CREATING AND DESTROYING LIGHTNING COMPONENTS
RAISING AND HANDLING CUSTOM EVENTS IN sALESFORCE lIGHTNING
WHY TO USE DESIGN RESOURCE AND HOW TO ADD DYNAMIC OPTION TO DATASOURCE
PASSING INNER WRAPPER CLASS TO LIGHTNING COMPONENT
LIGHTNING COMPONENT FOR RECORDTYPE SELECTION FOR ANY SOBJECT
FETCHING FILE FROM EXTERNAL/PUBLIC URL AND STORING IT IN SALESFORCE
You need to upload the translation of all custom fields which you are going to use in VF page and can utilize custom labels to display warning, error information on VF page.
In order to render the VF page in particular language, use Language attribute on <apex:page> tag. You can also bind this values with controller variable so that you can render VF page in different language.
<apex:page controller="SK_LocalizationTestController" language="{!selectedLang}">
I have created a very simple VF page to illustrate this functionality by displaying account information. I have dropdown on VF page through which user will select language and VF page will re render to display page in selected language.
Note:
- If you are displaying page message using <apex:pageMessages>, then use custom label on apex class to display message. Upload all translation for custom label in salesforce.
- For custom fields also you need to upload language translation. Please refer Translation Workbench under Set Up.
- The language attribute does accept ISO country codes plus an optional locale like en,en_US,de,de_DE etc.
- For displaying header or pageblock section title, use custom labels.
More Blogs>>:
USING DATABASE.UPSERT WITH EXTERNAL ID
DYNAMIC APEX IN SALESFORCE
SOQL INJECTION IN SOQL
CUSTOM METADATA AND CUSTOM SETTINGS IMPLEMENTATION TRICKS
SMART TABLE USING ANGULARJS IN VISUALFORCE PAGE
REST API TUTORIAL FOR SALESFORCE
VISUALFORCE COMPONENT FOR RECORD STATUS BAR
DYNAMICALLY CREATING AND DESTROYING LIGHTNING COMPONENTS
RAISING AND HANDLING CUSTOM EVENTS IN sALESFORCE lIGHTNING
WHY TO USE DESIGN RESOURCE AND HOW TO ADD DYNAMIC OPTION TO DATASOURCE
PASSING INNER WRAPPER CLASS TO LIGHTNING COMPONENT
LIGHTNING COMPONENT FOR RECORDTYPE SELECTION FOR ANY SOBJECT
FETCHING FILE FROM EXTERNAL/PUBLIC URL AND STORING IT IN SALESFORCE