0

I am using a custom label whose value is "Create Account : {0}" where {0} is replaced with account's record type. I have added translation for "Create Account" part and that is working fine. But the parameterised part is not getting translated when user's language is changed.

Is there any possible solution so that parameterised part also gets translated on language changes?

0

Assuming that the Account's record type was retrieved from SOQL, you need to adjust your SOQL query. For example:

SELECT Id, Name, RecordType.Name FROM Account

Will always return the untranslated record type name. But you could instead query:

SELECT Id, Name, toLabel(RecordType.Name) FROM Account

And that will return the translated label. Note that if you have any logic in the page that is based on record type, you should also query RecordType.DeveloperName and use that for all decisions since it is language-invariant.

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.