13 votes

Retrieve custom translations for a custom label via the metadata API

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/...
  • 489
11 votes
Accepted

Get Label value for specified language

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 ...
  • 131k
8 votes

Metadata API : How to get the translated values of picklists of my object

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 ...
8 votes
Accepted

Translation, Localization and Internationalization Best Practices

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 ...
7 votes
Accepted

APEX: how to get Custom Label's text dynamically?

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 )...
  • 7,655
7 votes
Accepted

Translate navigation menu in partner community

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.
7 votes
Accepted

Deployment error regarding translations when generating package version

There are two things you have to do: enable Translations in your Scratch-Org-Def (I guess, you already did). let package-version-create use this scratch org def (I guess, that you didn't) So you ...
  • 86
7 votes
Accepted

Where in the SFDX tree do translations of quick actions go?

The translations for QuickActions are included as part of the objectTranslation metadata. So for each object, you can include translations of quickActions as follows: <?xml version="1.0" ...
6 votes
Accepted

Why does the LIKE SOQL operator implicitly translate picklist values?

This is what I thought was the reason for the LIKE operator to automatically translate picklist values, and that has been confirmed on the documentation since Spring '21: The LIKE operator is used to ...
6 votes

Why does the LIKE SOQL operator implicitly translate picklist values?

UPDATE Since Spring 21 (API Version 51.0) the Translate Returned SOQL Results paragraph of Apex Docs was updated by adding the limitations: The LIKE operator can only query on the label of the ...
5 votes
Accepted

VisualForce: Google Website Translator Breaking Search

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 ...
5 votes

Get Label value for specified language

Unfortunately this is not possible currently in Apex. This is already posted on IdeaExchange and you can vote on this idea.
  • 3,098
5 votes
Accepted

Get ToLabel of old value in trigger

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 ...
  • 12.4k
5 votes
Accepted

CustomObjectTranslation invalid characters

Well, we figured it out. It turns out that the two objects in question (one of them actually a Custom Setting) had the _ character in their names. The display name, not the API name. My_Custom_Object ...
4 votes
Accepted

How to retrieve translations using Metadata API?

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&...
  • 1,159
4 votes

If I find a bad translation of a standard label in salesforce, how should I report it?

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 votes

Lightning components: Custom label translation not working in managed package

My current workaround for this is to add a server side action (custom labels work in apex) that would return a map of all the custom labels used in the component and then set it as an attribute of ...
4 votes
Accepted

How to remove all translations from Translation Workbench?

I just found an answer to this in the docs (Translation Files): Delete a translation by replacing the desired value in the TRANSLATION column in either section with a left and right angle bracket ...
  • 577
4 votes
Accepted

APEX: get a Custom Label translation in a certain language which is not equal to the current user's language?

In apex:page there is an attribute 'language' which you can set as the language of your choice/requirement to override the users language. Check this link language The language used to display ...
  • 7,655
4 votes
Accepted

How to retrieve languages in which a Knowledge Article is translated

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: ...
  • 19.6k
4 votes
Accepted

How to deploy translation

Following salesforce article says In order for translated terms to be migrated via change set, both the language translation and the component being translated must be included in the change ...
  • 5,727
4 votes

Apex Trigger error message working for all languages except for one

You should use getRecordTypeInfosByDeveloperName rather than getRecordTypeInfosByName. The latter would be affected by translations as well, but the DeveloperName does not change.
  • 145k
3 votes
Accepted

How to translate picklist items with Metadata API?

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 ...
  • 1,418
3 votes

toLabel() in aggregate query

SELECT toLabel(Equipment__r.technical_Platform__c) aliasTECPROB FROM Maintenance_Schedule__c GROUP BY Equipment__r.technical_Platform__c Use Alias it will work out
3 votes

How to set the language for API Rest or SOAP?

I know this is an old question. So I add this comment just to help others that are in my situation. I was struggling to find out how to get translated texts for picklists through the REST API. We ...
  • 31
3 votes

How to set the language for API Rest or SOAP?

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 ...
3 votes
Accepted

Custom Object missing from English translation in Translation Workbench but not other languages

For custom objects that are part of a Managed Package this is done slightly different, because you have to override the values provided in the package: Click Setup->Translation Workbench->Override In ...
3 votes
Accepted

How do I translate RecordType descriptions?

Translation of RecordType Descriptions is by now possible in the Translation Workbench.
3 votes
Accepted

Changing a Custom Labels Master language

Unfortunately, I think you're going to need to delete and then recreate it. You've already tried the methods that one would expected to be able to use to change it; particularly the metadata api.
  • 40.6k
3 votes

How to see Translation for Custom Label in Lightning Component?

Probably this is a Salesforce bug. I have a similar problem. I'm developing a component as part of managed package. Translations work when I'm inside the development org, but I get only English values ...

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