You are here

function localize_fields_help in Localize Fields 7

Implements hook_help().

File

./localize_fields.module, line 46
Drupal Localize Fields module

Code

function localize_fields_help($path, $arg) {
  switch ($path) {
    case 'admin/help#localize_fields':
      module_load_include('inc', 'localize_fields', 'localize_fields.drush');
      $drush = localize_fields_drush_command();
      $drush = $drush['localize-fields'];
      $drush_description = $drush['description'] . '<ul><b>' . t('Arguments', array(), array(
        'context' => 'module:localize_fields',
      )) . '</b>';
      foreach ($drush['arguments'] as $name => $desc) {
        $drush_description .= '<li>' . $name . ': ' . t($desc, array(), array(
          'context' => 'module:localize_fields',
        )) . '</li>';
      }
      $drush_description .= '</ul>';
      $drush_description .= '<ul><b>' . t('Options', array(), array(
        'context' => 'module:localize_fields',
      )) . '</b>';
      foreach ($drush['options'] as $name => $desc) {
        $drush_description .= '<li>' . $name . ': ' . t($desc, array(), array(
          'context' => 'module:localize_fields',
        )) . '</li>';
      }
      $drush_description .= '</ul>';
      $drush_description .= '<ul><b>' . t('Examples', array(), array(
        'context' => 'module:localize_fields',
      )) . '</b>';
      foreach (array_keys($drush['examples']) as $desc) {
        $drush_description .= '<li>' . $desc . '</li>';
      }
      $drush_description .= '</ul>';
      return '<h3>' . t('About') . '</h3>' . '<p>' . t('Localize Fields provides translation of field labels, descriptions and list options for most field types and widgets.', array(), array(
        'context' => 'module:localize_fields',
      )) . '</p>' . '<h5>' . t('Optional Localize Fields UI module', array(), array(
        'context' => 'module:localize_fields',
      )) . '</h5>' . '<p>' . t('Localize Fields UI adds translation to field settings GUIs.<br>Gets installed automatically if the Field UI module is enabled.', array(
        '',
      ), array(
        'context' => 'module:localize_fields',
      )) . '</p>' . '<h5>' . t('drush localize-fields', array(), array(
        'context' => 'module:localize_fields',
      )) . '</h5>' . '<p>' . $drush_description . '</p>' . '<h5>' . t('Optional Localize Fields Test module', array(), array(
        'context' => 'module:localize_fields',
      )) . '</h5>' . '<p>' . t('Localize Fields Test is a Features module which provides a content type for testing field label etc. translation for various field types and widgets, via \'!add_content\' -> \'Localize Fields test\'.!nlIt also adds a taxonomy \'lclzflds\', and a role \'localize_fields_test_editor\'.!_para!paraThe module tests translation from English (en) to Danish (da), thus:!ul!lilanguages English (en) and Danish (da) must be installed and enabled !em(and will be when enabling the module, if missing/disabled)!_em!_li!lithe content type\'s fields have been created - and may be edited - by a user whose language is English (en)!_li!litest user language must be Danish (da)!_li!_ul', array(
        '!para' => '<p>',
        '!_para' => '</p>',
        '!nl' => '<br>',
        '!em' => '<em>',
        '!_em' => '</em>',
        '!ul' => '<ul>',
        '!_ul' => '</ul>',
        '!li' => '<li>',
        '!_li' => '</li>',
        '!add_content' => t('Add content'),
      ), array(
        'context' => 'module:localize_fields',
      )) . '</p>';
    case 'admin/config/regional/localize_fields/copy_i18n_field':
      return '<h3>' . t('Copy translations from/to the 118n_field module', array(), array(
        'context' => 'module:localize_fields',
      )) . '</h3>' . '<p>' . t('If this site previously used the i18n_field (\'!i18n_field\') module, there may exist usable translations created via that module.!breakThose translations are not a accessible by Localize Fields because they use \'!textgroup\' and a different translation context.', array(
        '!break' => '<br/>',
        '!i18n_field' => t('Field translation', array(), array(
          'context' => 'module:localize_fields:module:i18n_field',
        )),
        '!textgroup' => l('textgroup', 'https://drupal.org/node/1188430', array(
          'attributes' => array(
            'target' => '_blank',
          ),
        )),
      ), array(
        'context' => 'module:localize_fields',
      )) . '</p>';
  }
}