[SalesForce] Deployment error regarding translations when generating package version

In a scratch org where the translation workbench is enabled, I added English as a supported language (the language for the organization is Japanese) and ran the command sfdx force:source:pull, which adds force-app/main/default/translations/en_US.translation-meta.xml to my project. However, when running package:version:create I get the following error:

en_US: Not available for deploy for this organization

Has anyone else encountered this error or know how to fix it?

Best Answer

There are two things you have to do:

  1. enable Translations in your Scratch-Org-Def (I guess, you already did).
  2. let package-version-create use this scratch org def (I guess, that you didn't)

So you scratch org def should looklike this:

{
  "edition": "Enterprise",
  "language": "en_US",
  "features": [],
  "settings": {
    "languageSettings": {
      "enableTranslationWorkbench":  true,
      "enableEndUserLanguages": true
    }
  }
}

And your package-Version-create like this:

$ sfdx force:package:version:create  -f config/<your scratch-org-def>.json
Related Topic