translatable-dataobject
                                
                                 translatable-dataobject copied to clipboard
                                
                                    translatable-dataobject copied to clipboard
                            
                            
                            
                        How to get translations from within another controller?
Hi,
I want to get the translations of the dataobject from within another controller. Is it possible to do that:
Example:
$sms_data_s = DataObject::get_by_id('SMSTemplate', 1)->SMSContent;
I have translations for SMSContent, but don't know how to call them.
Have you tried using getLocalizedValue or the shortcut T?
Eg. Something like this:
$sms_data_s = DataObject::get_by_id('SMSTemplate', 1)->T('SMSContent');
Btw. If you're using SilverStripe 3.1 or newer, I suggest you use the newer syntax to get your DataObject:
$sms_data_s = SMSTemplate::get()->byID(1)->T('SMSContent');