I have a custom object on which I have few fields and I successfully uploaded managed package which includes the custom object. Now I want to have the field labels for this object's fields appear in different languages. Is there any way to do so?


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, you can select the Language(s) that you want to provide Translations for, and then Translation Workbench provides a single location where you can define all of these Translations - you can even mass import/export translations for one or multiple languages. Pretty nice, honestly.

THEN, where Salesforce really helps out Managed Package developers, is that you can take all of these Translations and easily include them in your Managed Package! Just go to Setup > Create > Packages, select your package, "Add Components", and select "Language Translation". This will then let you choose the Languages whose Translations you'd like to include in your Package. enter image description here

To be clear, what you are doing here is including all translations you have done for a particular Language in your package --- as opposed to manually adding each of the individual component translations (which would be a tedious nightmare). (In addition, any translations you have provided of any of the Custom Labels included in your package will also be included when you select to add a translation).

So, jumping forward --- say that you've included Spanish Translations in your package, including a translation of the Label of one of your Custom Object's custom fields, say the field is Company_Number__c and the field label, in English, is "Company Number". Now, in one of your customer's orgs, one of the users changes their Language (from their User preferences) from English to Spanish.

enter image description here

Now, when they go to the Tab, Page Layout, or other locations where they might go to interact with your custom object, they'll see translated text for the field labels that you have included translations for in your package, such as the Company Number field. That is, they'll see something like "Número de Negocio".


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.