1

We need to store messages in the database. We could store the English text, but this could be less friendly if a French user wanted to review the messages.

Is there a way I could look up a Custom Label text dynamically in Apex (not using VisualForce) so that I can store the key and arguments in the database and late translate on display?

0

1 Answer 1

0

If the messages are known upfront (for example situation where "there are multiple things wrong with this record, integration cannot proceed / record cannot be approved until they're all fixed") you could look into making a multiselect picklist on the record and simply translate the picklist values. Then use describe calls to fetch picklist value & label.

You could create custom labels with error codes or something and fetch them in Apex. There's no nice way to do it dynamically in pure Apex though (workaround by creating dynamic VF component is not really "pure"): possible to access custom labels dynamically?

1
  • Thanks. We may need to look at something like that. I'll ask how important late translation is. I'd also wondered if I could get VF to output the required labels in a way our Javascript client can read. Not pure, but may be a way. Jul 31, 2014 at 9:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .