When retrieving Translations
the docs say, the returned Metadata
only include translations for the other metadata types referenced in package.xml
Source: Translations | Metadata API Developer Guide
This behavior seems to be true for Sandboxes, Production Orgs and Developer Editions.
However there seems to be another behavior for Scratch Orgs:
We get the full content of the Translations
regardless if we
- request the
Translations
alone (sfdx force:source:retrieve -m Translations:en_US
) - or in combination with other Metadata such as
CustomLabel
(sfdx force:source:retrieve -m Translations:en_US,CustomLabel:VAT_Number
).
For Profiles
(with CustomField
s) the behavior is similar.
I created a minimum reproduction to compare the retrieval from a Scratch Org vs. a Developer Edition: https://github.com/mdapi-issues/retrieve-behavior-scratch-org.
Further I've retrieved using a package.xml and the Salesforce Workbench, leading to the same result.
Is this behavior documented somewhere or is there any trick to make it work in Scratch Orgs as documented?
Best Answer
Found the answer in the Salesforce DX Developer Guide Retrieve and Pull Changes to Profiles with Source Tracking: