-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jonathan Hunt
committed
Jan 20, 2022
1 parent
89dd04f
commit ccd501e
Showing
6 changed files
with
83 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
docroot/sites/all/modules/contrib/file_entity/file_entity.i18n.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters