Relationship section label translation

A place for users and developers of the Xataface to discuss and receive support.

Relationship section label translation

Postby 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.
the_woz
 
Posts: 12
Joined: Fri Sep 16, 2011 11:37 am

Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 11 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved