1 |
85ad3d82
|
Assos Assos
|
<?php
|
2 |
|
|
|
3 |
|
|
/**
|
4 |
|
|
* @file
|
5 |
|
|
* Helper module for testing i18n
|
6 |
|
|
*/
|
7 |
|
|
|
8 |
|
|
// Add some multilingual variables, override existing ones from settings so
|
9 |
|
|
// we have a known list and we don't need any addition to the settings file for testing i18n
|
10 |
|
|
_i18n_test_variable_init();
|
11 |
|
|
|
12 |
|
|
/**
|
13 |
|
|
* Implements hook_init()
|
14 |
|
|
*/
|
15 |
|
|
function i18n_test_init() {
|
16 |
|
|
// We just implement this hook so this one is loaded always on bootstap
|
17 |
|
|
}
|
18 |
|
|
|
19 |
|
|
/**
|
20 |
|
|
* Set default multilingual variables and add any others defined by testing scripts
|
21 |
|
|
*
|
22 |
|
|
* More variables can be added using 'i18n_variables_test';
|
23 |
|
|
*/
|
24 |
|
|
function _i18n_test_variable_init() {
|
25 |
|
|
global $conf;
|
26 |
|
|
$conf['i18n_variables'] = array_merge(array('site_name', 'site_frontpage'), variable_get('i18n_variables_test', array()));
|
27 |
|
|
}
|
28 |
|
|
|
29 |
|
|
/**
|
30 |
|
|
* Implements hook_i18n_string_info()
|
31 |
|
|
*/
|
32 |
|
|
function i18n_test_i18n_string_info() {
|
33 |
|
|
$groups['test'] = array(
|
34 |
|
|
'title' => t('Test'),
|
35 |
|
|
'description' => t('Translatable menu items: title and description.'),
|
36 |
|
|
'format' => FALSE, // This group doesn't have strings with format
|
37 |
|
|
'refresh callback' => 'i18n_test_i18n_string_refresh',
|
38 |
|
|
);
|
39 |
|
|
return $groups;
|
40 |
|
|
}
|
41 |
|
|
/**
|
42 |
|
|
* Locale refresh
|
43 |
|
|
*/
|
44 |
|
|
function i18n_test_i18n_string_refresh() {
|
45 |
|
|
return TRUE;
|
46 |
|
|
} |