function _potx_add_format_interval_strings in Translation template extractor 5
Same name and namespace in other branches
- 8 potx.inc \_potx_add_format_interval_strings()
- 5.2 potx.inc \_potx_add_format_interval_strings()
- 6.3 potx.inc \_potx_add_format_interval_strings()
- 6 potx.inc \_potx_add_format_interval_strings()
- 6.2 potx.inc \_potx_add_format_interval_strings()
- 7.3 potx.inc \_potx_add_format_interval_strings()
- 7 potx.inc \_potx_add_format_interval_strings()
- 7.2 potx.inc \_potx_add_format_interval_strings()
Add format_interval special strings, which cannot be extracted otherwise. This is called for common.inc
Parameters
$file: Name of the file parsed.
$save_callback: Callback function used to save strings.
1 call to _potx_add_format_interval_strings()
- _potx_process_file in ./
potx.inc - Process a file and put extracted information to the given parameters.
File
- ./
potx.inc, line 940 - Extraction API used by the web and command line interface.
Code
function _potx_add_format_interval_strings($file, $save_callback) {
$components = array(
'1 year' => '@count years',
'1 week' => '@count weeks',
'1 day' => '@count days',
'1 hour' => '@count hours',
'1 min' => '@count min',
'1 sec' => '@count sec',
);
foreach ($components as $singular => $plural) {
$save_callback($singular . "\0" . $plural, $file);
}
}