Loading file_entity.field.inc +8 −1 Original line number Diff line number Diff line Loading @@ -437,10 +437,17 @@ function file_entity_field_formatter_view($entity_type, $entity, $field, $instan if (isset($item['description'])) { $file->description = $item['description']; } $text = $settings['text']; if (module_exists('i18n_string')) { $key = 'file_entity:file_download_link:' . $entity_type . ':' . $instance['bundle'] . ':link_text:' . $text; $text = i18n_string($key, $text); } $element[$delta] = array( '#theme' => 'file_entity_download_link', '#file' => $file, '#text' => $settings['text'], '#text' => $text, ); } } Loading file_entity.i18n.inc 0 → 100644 +40 −0 Original line number Diff line number Diff line <?php /** * Implements hook_i18n_string_info(). */ function file_entity_i18n_string_info() { $groups['file_entity'] = array( 'title' => t('File Entity'), 'format' => FALSE, ); return $groups; } /** * Implements hook_i18n_string_list(). */ function file_entity_i18n_string_list($group) { if ($group == 'file_entity') { $fields = field_info_instances(); $strings = array(); foreach ($fields as $entity_type => $bundles) { foreach ($bundles as $bundle => $fields) { foreach ($fields as $field_key => $field_settings) { foreach ($field_settings['display'] as $view_mode => $view_mode_settings) { if (!empty($view_mode_settings['type']) && $view_mode_settings['type'] == 'file_download_link') { $text = $view_mode_settings['settings']['text']; $key = $entity_type . ':' . $bundle . ':' . 'link_text'; $strings['file_entity']['file_download_link'][$key][$text] = $text; } } } } } return $strings; } } Loading
file_entity.field.inc +8 −1 Original line number Diff line number Diff line Loading @@ -437,10 +437,17 @@ function file_entity_field_formatter_view($entity_type, $entity, $field, $instan if (isset($item['description'])) { $file->description = $item['description']; } $text = $settings['text']; if (module_exists('i18n_string')) { $key = 'file_entity:file_download_link:' . $entity_type . ':' . $instance['bundle'] . ':link_text:' . $text; $text = i18n_string($key, $text); } $element[$delta] = array( '#theme' => 'file_entity_download_link', '#file' => $file, '#text' => $settings['text'], '#text' => $text, ); } } Loading
file_entity.i18n.inc 0 → 100644 +40 −0 Original line number Diff line number Diff line <?php /** * Implements hook_i18n_string_info(). */ function file_entity_i18n_string_info() { $groups['file_entity'] = array( 'title' => t('File Entity'), 'format' => FALSE, ); return $groups; } /** * Implements hook_i18n_string_list(). */ function file_entity_i18n_string_list($group) { if ($group == 'file_entity') { $fields = field_info_instances(); $strings = array(); foreach ($fields as $entity_type => $bundles) { foreach ($bundles as $bundle => $fields) { foreach ($fields as $field_key => $field_settings) { foreach ($field_settings['display'] as $view_mode => $view_mode_settings) { if (!empty($view_mode_settings['type']) && $view_mode_settings['type'] == 'file_download_link') { $text = $view_mode_settings['settings']['text']; $key = $entity_type . ':' . $bundle . ':' . 'link_text'; $strings['file_entity']['file_download_link'][$key][$text] = $text; } } } } } return $strings; } }