Projet

Général

Profil

Révision 5d12d676

Ajouté par Assos Assos il y a environ 6 ans

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/views/plugins/views_plugin_localization_core.inc
2 2

  
3 3
/**
4 4
 * @file
5
 * Contains the Drupal core localization plugin.
5
 * Definition of views_plugin_localization_core.
6 6
 */
7 7

  
8 8
/**
......
15 15
  /**
16 16
   * Translate a string.
17 17
   *
18
   * @param $string
18
   * @param string $string
19 19
   *   The string to be translated.
20
   * @param $keys
20
   * @param array $keys
21 21
   *   An array of keys to identify the string. Generally constructed from
22 22
   *   view name, display_id, and a property, e.g., 'header'.
23
   * @param $format
23
   * @param string $format
24 24
   *   The input format of the string. This is optional.
25 25
   */
26
  function translate_string($string, $keys = array(), $format = '') {
26
  public function translate_string($string, $keys = array(), $format = '') {
27 27
    return t($string);
28 28
  }
29 29

  
30 30
  /**
31 31
   * Save a string for translation.
32 32
   *
33
   * @param $string
33
   * @param string $string
34 34
   *   The string to be translated.
35
   * @param $keys
35
   * @param array $keys
36 36
   *   An array of keys to identify the string. Generally constructed from
37 37
   *   view name, display_id, and a property, e.g., 'header'.
38
   * @param $format
38
   * @param string $format
39 39
   *   The input format of the string. This is optional.
40 40
   */
41
  function save_string($string, $keys = array(), $format = '') {
41
  public function save_string($string, $keys = array(), $format = '') {
42 42
    global $language;
43 43

  
44 44
    // If the current language is 'en', we need to reset the language
45 45
    // in order to trigger an update.
46
    // TODO: add test for number of languages.
46
    // @todo add test for number of languages.
47 47
    if ($language->language == 'en') {
48 48
      $changed = TRUE;
49 49
      $languages = language_list();
......
67 67
   *
68 68
   * Deletion is not supported.
69 69
   *
70
   * @param $source
70
   * @param mixed $source
71 71
   *   Full data for the string to be translated.
72 72
   */
73
  function delete($source) {
73
  public function delete($source) {
74 74
    return FALSE;
75 75
  }
76 76

  
77 77
  /**
78 78
   * Collect strings to be exported to code.
79 79
   *
80
   * String identifiers are not supported so strings are anonymously in an array.
80
   * String identifiers are not supported so strings are anonymously in an
81
   * array.
81 82
   *
82
   * @param $source
83
   * @param array $source
83 84
   *   Full data for the string to be translated.
84 85
   */
85
  function export($source) {
86
  public function export($source) {
86 87
    if (!empty($source['value'])) {
87 88
      $this->export_strings[] = $source['value'];
88 89
    }
......
91 92
  /**
92 93
   * Render any collected exported strings to code.
93 94
   *
94
   * @param $indent
95
   * @param string $indent
95 96
   *   An optional indentation for prettifying nested code.
96 97
   */
97
  function export_render($indent = '  ') {
98
  public function export_render($indent = '  ') {
98 99
    $output = '';
99 100
    if (!empty($this->export_strings)) {
100 101
      $this->export_strings = array_unique($this->export_strings);
......
106 107
    }
107 108
    return $output;
108 109
  }
110

  
109 111
}

Formats disponibles : Unified diff