13

Yes, you can do this natively by leveraging Salesforce's Translation Workbench. Translation Workbench allows you to provide translations of (almost) all of the public-facing text that users of your package will see, including Field Labels Validation Rule Error Messages Record Type labels Page Layout section titles and more... Through Translation Workbench, ...


11

<apex:page sidebar="true" showHeader="false" language="ru"> The language parameter of the page decides language. Make a getter setter variable in the controller and use userinfo to get the language or through the query and populate on the language parameter. http://www.salesforce.com/us/developer/docs/pages/Content/pages_compref_page.htm This ...


10

You can use a SOQL function toLabel() to get translated picklist values: SELECT toLabel(your_field__c) FROM YourObject__c Here is the official documentation: A client application can have results from a query returned that are translated into the user’s language, using toLabel()


9

You can set the language for your preview apex:page. This documentation says that the language attribute determines: The language used to display labels that have associated translations in Salesforce. This value overrides the language of the user viewing the page. Possible values for this attribute include any language keys for languages supported ...


7

One way to do this is use custom labels to store all your text .And enable translation workbench. https://login.salesforce.com/help/doc/en/customize_wbench.htm The portal will be automatically changed to the language as per the locale of the user and the translation of labels will display . At run time if you want to change the language of the portal as ...


7

Yes, you can do that in your apex:page tag, by using the attribute language, then dynamically bind it to a value in your controller or extension: <apex:page Controller="PageController" language="{!code}"> From the documentation: The language used to display labels that have associated translations in Salesforce. This value overrides the language of ...


7

In the Metadata API CustomFieldTranslation has a picklistValues field of type PicklistValueTranslation[]. It has a masterLabel and translation string. So your package.xml for the retrieve call would be something like: <types> <members>*</members> <name>CustomObjectTranslation</name> </types> You will get ...


7

This is a community wiki. Feel free to add to it! Please excuse the overly Americentric examples here. Overriding Principals Do not require the programmer to know the details of every language or locale that you plan to support. Make the system flexible enough to allow an admin with fluency in the domain and any given locale* to provide a meaningful ...


6

There is currently no supported Custom Labels / Translations API from Apex, the Web Services API, or SOQL that you could use to achieve what you're after (the Map<String,List<String>> with the master language value as the key). Click here to get this on the Product Management top priorities list!!! (NOTE: there IS a very much insane way that you ...


6

If you want all that to be in 1 single transaction and 1 callout, you might need to write APEX REST Webservice that will get the all the data in a single call and store it as account, contact and any other object. In this particular scenario let's assume your JSON looks something like this: { "account" : { "name" : "test account name", "...


6

You could use the language attribute of the VF page: <apex:page language="es"> <apex:outputText value="{!$Label.Foo}"> <apex:pageBlock> <apex:pageBlockSection> <apex:outputField value="{!Account.BillingStreet}"/> </apex:pageBlockSection> </apex:pageBlock> </apex:page> ...


6

Translation Workbench is most useful feature of salesforce to provide multiple language support. It is available under Administration Setup | Translation Workbench. It is not enable by default you need to enable it from Administration Setup | Translation Workbench > Translation settings It can be set to two levels: Org level User level By translation ...


6

There is a known issue stating that the translation should be updated in the community 24 hours after you've updated the translation and published your community.


6

You need to use both CustomLabel and Translations. <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <Package xmlns="http://soap.sforce.com/2006/04/metadata"> <types> <members>*</members> <name>CustomLabels</name> </types> <types> ...


5

Translations sound suspiciously close to Metadata API which means it's not accessible from Apex (at least not without some callout-like hacks). Can't you just use standard Translation Workbench? Export to Excel, let users translate, import back... sure beats crafting XML files. Besides even if you had such possibility to modify translations from Apex - how ...


5

You can find a full list of site labels available here: https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_variables_global_labelsite.htm


5

Unfortunately this is not possible currently in Apex. This is already posted on IdeaExchange and you can vote on this idea.


5

The way to tell Google not to translate any specific items is to use the <span class="e;notranslate"e;> </span> tag for that particular element. This is documented here and there's an example for it here as well.


5

In Apex, picklist fields on objects are just plain strings, and lack a method to get the label. You also can't query the previous state of the database. You will have to use the system describe methods to get the Schema.PicklistEntry values for your field, and use them to associate the api values in the trigger context variables with the labels from the ...


4

You have to use labels or translation workbench. There are some options to display translated picklists on the visualforce. A salesforce standard way to is to use apex:inputField tag with assigned sobject field of type picklist. In this case a picklist will be generated automatically with respect to the current user language. All you need to do is ...


4

Case.Type side In Apex & API the picklist will always be in the organization's master language. I'm writing it 3rd time ;) I've flipped my user's lang to German: and this query still returns data in English: SELECT Type FROM Case GROUP BY Type LIMIT 5 You'd have to flip to TOLABEL syntax (and ditch the GROUP BY) to get translated versions: So ...


4

Profile names can change, but profile ID's don't. I recommend you use the ID instead of the name for that very reason. Its not unusual with various licenses for someone to clone and rename them. I've encountered this especially with portal user licenses. Regardless of how they rename it when that happens, the license ID still doesn't change. The same ...


4

This is where String.format comes in play. For example, you could write this: String errorLine = String.format(Label.error_on_line_x, new string[] { String.valueof(linenumber) }); This way, label might be 'Error on line {0}' in English, and '{0}行目' in Japanese, and it will format correctly in both languages (use the label translation system...).


4

Open a case with Salesforce and report it as a bug. I mean, that's what I would do if there was a misspelling in the English terms.


4

You cant get dynamic custom labels in Apex: Check out this idea check out this link has a workaround solution which you can try in VF context: public static String getLabelString(String labelName ){ Component.Apex.OutputText output = new Component.Apex.OutputText(); output.expressions.value = '{!$Label.' + labelName + '}'; return String....


4

A way to fetch what other languages it has been translated to is to filter on the knowledgearticleid or Id in your soql. As per the SOAP API Developer Guide documentation on KnowledgeArticleVersion: Always filter on a single value of Language. However, in SOQL, you can filter on more than one Language if there is a filter on Id or KnowledgeArticleId. ...


4

This is what I think is the reason for the LIKE operator to automatically translate picklist values: The LIKE operator is used to match strings. The picklist value is translated, probably because of situations when the end-user searches for text in his own language. Consider the following situation: a custom search component for a multinational company that ...


3

With SOAP API, you can set LocaleOptions in the request header. LocaleOptions Specifies the language of the labels returned. Note that it will only work for certain 'describe' calls. I haven't found a corresponding option for REST.


3

Results are returned, by default, in the organization's language. Using the toLabel function returns localized values; this is required to support multi-language organizations. In neither case can you specify the translation language to perform transactions in. You would have to update the user's language key before running the transaction.


3

Include your objects in that package.xml and you will be golden. Here is what your package.xml should look like: <Package xmlns="http://soap.sforce.com/2006/04/metadata"> <types> <members>Account</members> <members>AccountContactRole</members> <members>Activity</members> <...


Only top voted, non community-wiki answers of a minimum length are eligible