6

I am having a VF page which I include using a page layout. I have also enabled label to show.

Now when you go to detail page, Salesforce automatically pulls the label from VF page label. So far everything work fine and expected but Now I want to define this VF page label in different languages.

Is there any way to do so? I tried Translation Workbench but option didn't show up for adding VF pages in different languages.

enter image description here

If you look at the screenshot. In the screenshot, "IP Rights" is actually VF page name that you define when you create VF page. I want this label in different language according to the logged in user locale.

  • Not sure it is possible? – Sergej Utko Mar 21 '13 at 7:52
  • 1
    I had similar req. in the past and gave up ;) I decided to use "display without label" and in the VF page itself I used <apex:pageBlockSectionItem> with outputLabel = my translated custom label (Yesss) and the other tag was my actual content you want to show. Far from ideal though, appears a bit shifted when viewed embedded in page layout. – eyescream Mar 21 '13 at 8:02
  • @eyescream will that give same UI? – doga Mar 21 '13 at 8:05
  • Not 100%. OutputLabel will be bold and look nice and stuff but because it's embedded it'll move a bit to right. You'd need some css tricks to reduce margin-left. It's something but far from great so I'm curious if techtrekker's thing works, that'd be cool. – eyescream Mar 21 '13 at 8:08
1

Use Labels to display all the text elements in the VF page. (While you can't translate a VF page name, you can store the name as a custom label and translate that)

Translation for Labels are input directly from the Label definition page. Navigate to the Label and you will see a button to add a translation. Choose language and enter translated value.

http://login.salesforce.com/help/doc/en/cl_translate_edit.htm

| improve this answer | |
  • Doga asks about VF page Name/Label translation, not about the content translation with custom labels. And the link to support took me to IP range whitelists ;) – eyescream Mar 21 '13 at 7:52
  • Probably easiest to add the name as a label too anyway if it needs to be translated? Not sure what happened with the link, thanks, corrected. – techtrekker Mar 21 '13 at 7:54
  • But if you "display with label" it appears as if it'd be a field on the page layout where the field "value" is the content of VF page. Are you saying that if I have MyVFPage and I'll add MyVFPage custom label & translate it - some magic will automatically happen? – eyescream Mar 21 '13 at 8:00
  • No :) that would indeed be magic. I pretty much meant what you've described in your comment, I.e use a 'field' to display the label which offsets the page a bit – techtrekker Mar 21 '13 at 8:24
  • Could you possibly do some JavaScript / Jquery sorcery to replace the value based on User – techtrekker Mar 21 '13 at 8:44
0

You can translate section label on the layout. If you have an option to have separate section for your included page, this might be a solution. You don't need VF page label in this case.

| improve this answer | |

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.