public function testUpdateFieldLabels()
 {
     // Add custom translation for testing
     i18n::get_translator('core')->getAdapter()->addTranslation(array('SiteTree.METATITLE' => 'TRANS-EN Meta Title'), 'en');
     $siteTree = new SiteTree();
     $labels = $siteTree->fieldLabels();
     $this->assertArrayHasKey('MetaTitle', $labels);
     $this->assertEquals('TRANS-EN Meta Title', $labels['MetaTitle']);
     // Set different locale, clear field label cache
     i18n::set_locale('de_DE');
     DataObject::reset();
     // Add custom translation for testing
     i18n::get_translator('core')->getAdapter()->addTranslation(array('SiteTree.METATITLE' => 'TRANS-DE Meta Title'), 'de_DE');
     $labels = $siteTree->fieldLabels();
     $this->assertEquals('TRANS-DE Meta Title', $labels['MetaTitle']);
 }
 /**
  * Field labels for display in tables.
  *
  * @param boolean $includerelations A boolean value to indicate if the labels returned include relation fields
  *
  * @return array
  *
  * @author Sebastian Diel <*****@*****.**>,
  *         Sascha Koehler <*****@*****.**>
  * @since 06.10.2014
  */
 public function fieldLabels($includerelations = true)
 {
     $fieldLabels = array_merge(parent::fieldLabels($includerelations), array('UseAsRootForMainNavigation' => _t('SilvercartPage.UseAsRootForMainNavigation')));
     $this->extend('updateFieldLabels', $fieldLabels);
     return $fieldLabels;
 }