Project

General

Profile

« Previous | Next » 

Revision 7cc085da

Added by Andreas Kohlbecker almost 8 years ago

#5912 fixing wrong usages of dynamic strings, using placeholders and avoiding concatination

View differences:

modules/cdm_dataportal/settings.php
151 151
function get_taxon_options_list() {
152 152
  $taxon_tab_options = array_flip(get_taxon_tabs_list());
153 153
  foreach ($taxon_tab_options as $key => $value) {
154
    $taxon_tab_options[$key] = t($key);
154
    $taxon_tab_options[$key] = t('@key', array('@key' => $key));
155 155
  }
156 156
  return $taxon_tab_options;
157 157

  
......
1050 1050
  if (isset($portNumberMatch[1]) && $portNumberMatch[1] != '80') {
1051 1051
    $form['cdm_webservice']['freetext_index']['message'] = array(
1052 1052
      '#markup' => "<div class=\"description\">"
1053
      . t("The CDM web service URL contains a portnumber other than standart HTTP port 80: '!port'."
1054
      . " Due to this the reindex and purge fuctions may not be working if there is a firewall in between you and the CDM Server."
1055
      . " You may want to contact the maintainer of the according CDM Server in order to solve this problem.", array('!port' => $portNumberMatch[1][0]))
1053
      . t("The CDM web service URL contains a portnumber other than standart HTTP port 80: '!port'
1054
           Due to this the reindex and purge fuctions may not be working if there is a firewall in between you and the CDM Server.
1055
           You may want to contact the maintainer of the according CDM Server in order to solve this problem.",
1056
          array('!port' => $portNumberMatch[1][0])
1057
        )
1056 1058
      . "</div>",
1057 1059
    );
1058 1060
  };
......
1477 1479
      '#title' => t('Taxon name display'),
1478 1480
      '#collapsible' => TRUE,
1479 1481
      '#collapsed' => TRUE,
1480
      '#description' => t('The display of taxon names is configured by two parts.'
1481
          . 'The <srong>name render templates</strong> define the parts of the name to be displayed in the different areas of the data portal pages.'
1482
          . 'The name parts are defined in the <stong>part definitions</strong>'),
1482
      '#description' => t('The display of taxon names is configured by two parts.
1483
          The <srong>name render templates</strong> define the parts of the name to be displayed in the different areas of the data portal pages.
1484
          The name parts are defined in the <stong>part definitions</strong>'),
1483 1485
  );
1484 1486

  
1485 1487
  $default_part_definitions = unserialize(CDM_PART_DEFINITIONS_DEFAULT);
......
1681 1683
function cdm_dataportal_create_gallery_settings_form($form_name, $form_title, $collapsed, $form_description = '') {
1682 1684
  $form[$form_name] = array(
1683 1685
    '#type' => 'fieldset',
1684
    '#title' => t($form_title),
1686
    '#title' => t('@form-title', array('@form-title' => $form_title)),
1685 1687
    '#collapsible' => TRUE,
1686 1688
    '#collapsed' => $collapsed,
1687 1689
    '#tree' => TRUE,
1688
    '#description' => t($form_description),
1690
    '#description' => t('@$form-description', array('@$form-description' => $form_description)),
1689 1691
  );
1690 1692

  
1691 1693
  $default_values = unserialize(CDM_DATAPORTAL_GALLERY_SETTINGS);
......
1881 1883
      '#field_suffix' => 'px',
1882 1884
      '#maxlength' => 4,
1883 1885
      '#size' => 4,
1884
      '#description' => t('The maximum extend in either dimension, width or height, of the profil picture in pixels.')
1886
      '#description' => t('The maximum extend in either dimension, width or height, of the profile picture in pixels.')
1885 1887
  );
1886 1888

  
1887 1889
  $form['taxon_profile'][CDM_TAXON_PROFILE_IMAGE]['media_uri_query'] = array(
......
1891 1893
      '#default_value' =>  $taxon_profile_image_settings['media_uri_query'],
1892 1894
      '#maxlength' => 1024,
1893 1895
      '#size' => 60,
1894
      '#description' => t('Additional query parameters to be used when requesting for the '
1895
          . 'profile image. E.g.: <code>width=400&height=300&quality=95&format=jpeg</code>.'
1896
          . 'The query parameters will be appended to the uri of the media representation part'
1897
          . ' as stored in the cdm. The query parameter string must not start with a \'&\' or  \'?\'')
1896
      '#description' => t('Additional query parameters to be used when requesting for the  
1897
            profile image. E.g.: <code>width=400&height=300&quality=95&format=jpeg</code>.
1898
            The query parameters will be appended to the uri of the media representation part
1899
            as stored in the cdm. The query parameter string must not start with a \'&\' or  \'?\'')
1898 1900
  );
1899 1901

  
1900 1902
  $form['taxon_profile'][CDM_TAXON_PROFILE_IMAGE]['custom_placeholder_enabled'] = array(
......
2228 2230
    $form['taxon_profile']['distribution_layout'][DISTRIBUTION_HIERARCHY_STYLE][$level] = array(
2229 2231
      '#type' => 'fieldset',
2230 2232
      '#tree' => true,
2231
      '#title' => t(drupal_ucfirst((str_replace('_', ' ', $level)))),
2233
      '#title' => t('@area-level', array('@area-level' => drupal_ucfirst((str_replace('_', ' ', $level))))),
2232 2234
      '#attributes' => array('class' => array('fieldset-float'))
2233 2235
    );
2234 2236
    foreach ($hierarchy_styles[$level] as $key => $value) {
2235 2237
      $form['taxon_profile']['distribution_layout'][DISTRIBUTION_HIERARCHY_STYLE][$level][$key] = array(
2236 2238
        '#type' => 'textfield',
2237
        '#title' => t(drupal_ucfirst((str_replace('_', ' ', $key)))),
2239
        '#title' => t('@area-level-style', array('@area-level-style' => drupal_ucfirst((str_replace('_', ' ', $key))))),
2238 2240
        '#default_value' => $hierarchy_styles[$level][$key],
2239 2241
        '#maxlength' => 4,
2240 2242
        '#size' => 4
......
2753 2755
  );
2754 2756
  $edit_mapserver_version = get_edit_map_service_version_number();
2755 2757
  if ($edit_mapserver_version < 1.1) {
2756
    $form[CDM_MAP_DISTRIBUTION]['image_map']['#description'] = '<div class="messages warning">' . t("The chosen EDIT map service version ($edit_mapserver_version) is too low, it must be at least 1.1") . '</div>'
2758
    $form[CDM_MAP_DISTRIBUTION]['image_map']['#description'] = '<div class="messages warning">'
2759
      . t("The chosen EDIT map service version (@edit-mapserver-version) is too low, it must be at least 1.1",
2760
        array('@edit_mapserver_version' => '$edit_mapserver_version')) . '</div>'
2757 2761
      . $form[CDM_MAP_DISTRIBUTION]['image_map']['#description'];
2758 2762
  }
2759 2763

  
......
3336 3340
  foreach ($children as $key) {
3337 3341
    $odd_even = $weight % 4 == 0 ? 'odd' : 'even';
3338 3342
    $element[$key]['#weight'] = $weight;
3339
    $element[$key]['#prefix'] = '<tr class="' . $odd_even . '"><td>' . t($element['#options'][$key]) . '</td><td>';
3343
    $element[$key]['#prefix'] = '<tr class="' . $odd_even . '"><td>' . t('@row-label', array('@row-label' => $element['#options'][$key])) . '</td><td>';
3340 3344
    $element[$key]['#suffix'] = '</td>';
3341 3345
    unset($element[$key]['#title']);
3342 3346
    $weight += 2;
......
3483 3487
   if (!empty($element['#value'])) {
3484 3488
     json_decode($element['#value']);
3485 3489
     if(json_last_error() != JSON_ERROR_NONE){
3486
       form_error($element, t('The form element %title contains invalid JSON. You can check the syntax with ', array('%title' => $element['#title'])) . l('JSONLint', 'http://jsonlint.com/'));
3490
       form_error($element,
3491
         t('The form element %title contains invalid JSON. You can check the syntax with ', array('%title' => $element['#title']))
3492
         . l('JSONLint', 'http://jsonlint.com/')
3493
       );
3487 3494
     }
3488 3495
   }
3489 3496
}

Also available in: Unified diff