You need to sign in to do that
Don't have an account?
How to use standard labels for multilingual apps?
I am creating a multilingual app and I'm trying to keep the number of hard coded labels to an absolute minimum. I am using the following markup whenever possible:
{!$ObjectType.Account.Fields.Name.Label}
But what about standard labels like "Save" and "Cancel"? Is there anyway to make these dynamic so that I don't need to create custom labels for these common values?
I also think Global Variables are still one of the most poorly documented areas of salesforce.com. For example, you can do this to get the plural label for an object:
{!$ObjectType.Product2.LabelPlural}
but it isn't documented anywhere in the "Understand Global Variables" help section. I figured it out by guessing.
As far as i know there's no way to accomplish that, but if you do find anything please share it ! :)
I can see for 'Submit' but not for 'save or cancel'.
here is the link
http://www.salesforce.com/us/developer/docs/pages/Content/pages_variables_global.htm
you might be familiar with this already. But i have not explored much on this, if you get the answer, do post it here. Even if I get something useful for you definitely do that.
Thanks
Visualforce supports $ObjectType by performing a describe for you, take a look at this apex code
compare with
and you can see the pattern
So, now you can reference this page :
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_dynamic_describe_objects_understanding.htm
and
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_methods_system_sobject_describe.htm
So understanding this , you can try many of the methods shown there, by my logic and a quick test, these are valid :
I just tried the following code:
<apex:commandButton action="{!save}" value="{!$label.site.save}"/>
<apex:commandButton action="{!cancel}" value="{!$label.site.cancel}"/>
And it does the trick!