Relationship section label translation
Archived from the Xataface Users forum.
the_woz — Sat Oct 15, 2011 7:02 am
Hi, I found that the section labels for relationships were not being translated and used the default language label instead, ie:
If you declared a label in the relationships.ini file, and then un your language .ini defined a translated action label this way:
TABLENAME.relationships.RELATIONSHIPNAME.action.label = “yourlabel”
“yourlabel” will be used correctly for the action tab, but not for the section title in the record details view, the label defined in relationships.ini being used instead.
I traced the problem to line 274 of file /Dataface/RecordView.php :
- Code: Select all
$sec = array( 'name'=>$relname.'__relationship', 'label'=>$label, 'url'=>$this->record->getURL('-action=related_records_list&-relationship='.$relname), 'content'=>$glanceList->toHtml(), 'order'=>$order, 'class'=>$class, 'display'=>'expanded'
Replace line 274 (the label declaration) with:
- Code: Select all
'label'=>df_translate('tables.'.$tablename.'.relationships.'.$relname.'.label',$label),
That will display the section label in the correct language, or fallback to the default language if no translation is defined.