Révision e4c061ad
Ajouté par Assos Assos il y a plus de 9 ans
drupal7/sites/all/modules/i18n/tests/i18n_test.module | ||
---|---|---|
40 | 40 |
'title' => t('Test Cached Strings'), |
41 | 41 |
'description' => t('Translatable items of a textgroup with caching enabled.'), |
42 | 42 |
'format' => FALSE, // This group doesn't have strings with format |
43 |
'class' => 'i18n_string_textgroup_cached', |
|
43 |
'class' => 'i18n_string_textgroup_cached_logged',
|
|
44 | 44 |
); |
45 | 45 |
return $groups; |
46 | 46 |
} |
... | ... | |
89 | 89 |
'delivery callback' => 'drupal_json_output', |
90 | 90 |
); |
91 | 91 |
return $items; |
92 |
} |
|
93 |
|
|
94 |
class i18n_string_textgroup_cached_logged extends i18n_string_textgroup_cached { |
|
95 |
public static function load_translation($i18nstring, $langcode) { |
|
96 |
$strings = variable_get('i18n_loaded_translations', array()); |
|
97 |
$strings[$i18nstring->get_name()] = true; |
|
98 |
variable_set('i18n_loaded_translations', $strings); |
|
99 |
parent::load_translation($i18nstring, $langcode); |
|
100 |
} |
|
92 | 101 |
} |
Formats disponibles : Unified diff
Weekly update of contrib modules