Skip to main content
14 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/...
Lafexlos's user avatar
  • 519
9 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 )...
RedDevil's user avatar
  • 7,861
8 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 ...
Torsten's user avatar
  • 96
8 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" ...
Shane Bird's user avatar
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.
Robin De Bondt's user avatar
7 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 ...
Renato Oliveira's user avatar
7 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 ...
Oleh Berehovskyi's user avatar
6 votes
Accepted

How to get translation of field label based on language and locale?

Here are 2 possible coding options to retrieve translated field label based on current user language In APEX Using Schema describe methods, the field label is translated based on user language Map<...
Shamina's user avatar
  • 4,632
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 ...
martin's user avatar
  • 12.7k
5 votes
Accepted

Retrieve custom translations for a custom label via the metadata API

I retrieved the details using the apex-mdapi. Example code below: List<String> labels = new List<String>{'Demo1'}; MetadataService.MetadataPort service = new MetadataService.MetadataPort()...
nica's user avatar
  • 1,450
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 ...
AvailableName's user avatar
4 votes

Get Label value for specified language

Summer '23 added such a feature: Label.translationExists(namespace, label, language) Label.get(namespace, label, language) This is based on this Idea.
Trang Oul's user avatar
  • 317
4 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 ...
Gard E.'s user avatar
  • 41
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 ...
mmm321321's user avatar
  • 689
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 ...
Vladimir Romanov's user avatar
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 ...
Mahmood's user avatar
  • 6,006
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 ...
RedDevil's user avatar
  • 7,861
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: ...
glls's user avatar
  • 20.3k
4 votes

Why does the LIKE SOQL operator implicitly translate picklist values?

I don't have a why for you, but if you have a scenario where LIKE needs to match the API name, you could create a formula field targeting the same picklist. FFs always return API name not label.
Charles T's user avatar
  • 11.1k
4 votes
Accepted

How to deploy Custom Label Translations

In order to deploy Custom Label translations, it is necessary to include Language Translation to changeset. Check the screenshot below:
kurunve's user avatar
  • 4,424
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.
Adrian Larson's user avatar
  • 151k
3 votes

lightning page custom tabs translation

From what I can tell, lightning tab translations are not directly supported in Translation Workbench, but there's a workaround. The code for a Lightning Tab looks something like this: <lightning:...
crmprogdev's user avatar
3 votes
Accepted

'No data to import' when importing .stf with Translation Workbench

OK, I think I've got it. From the help page explaining what 'No data to import' message means: The file you’re trying to import is empty or does not contain any translation changes. It turned ...
mmm321321's user avatar
  • 689
3 votes
Accepted

Deployment of translations of custom labels using ANT

This is how it happens: <?xml version="1.0" encoding="UTF-8"?> <Package xmlns="http://soap.sforce.com/2006/04/metadata"> <types> <members>en_US</members&...
Ashwani's user avatar
  • 22.7k
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 ...
Raphaël Fonrouge's user avatar
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
Gobinathan's user avatar
3 votes
Accepted

How do I translate RecordType descriptions?

Translation of RecordType Descriptions is by now possible in the Translation Workbench.
Christian Szandor Knapp's user avatar
3 votes

Retrieving Local Translations from Metadata API call

The Custom Label values coming from the managed package cannot be retrieved, but once they are overridden, they fall under the category of Local Translations / Overrides; now, by retrieving the ...
Mayur Thombe's user avatar
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 ...
Vladimir Romanov's user avatar
3 votes

Translate navigation menu in partner community

You could try adding another language to your community to see if this solves your problem. I recently had the same issue and contacted Salesforce support to get some help (to confirm if it's the ...
Nielsm's user avatar
  • 2,094

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