You are here

function _potx_add_date_strings in Translation template extractor 5.2

Same name and namespace in other branches
  1. 8 potx.inc \_potx_add_date_strings()
  2. 5 potx.inc \_potx_add_date_strings()
  3. 6.3 potx.inc \_potx_add_date_strings()
  4. 6 potx.inc \_potx_add_date_strings()
  5. 6.2 potx.inc \_potx_add_date_strings()
  6. 7.3 potx.inc \_potx_add_date_strings()
  7. 7 potx.inc \_potx_add_date_strings()
  8. 7.2 potx.inc \_potx_add_date_strings()

Add date strings, which cannot be extracted otherwise. This is called for locale.module.

Parameters

$file: Name of the file parsed.

$save_callback: Callback function used to save strings.

$api_version: Drupal API version to work with.

1 call to _potx_add_date_strings()
_potx_process_file in ./potx.inc
Process a file and put extracted information to the given parameters.

File

./potx.inc, line 914
Extraction API used by the web and command line interface.

Code

function _potx_add_date_strings($file, $save_callback, $api_version = POTX_API_6) {
  for ($i = 1; $i <= 12; $i++) {
    $stamp = mktime(0, 0, 0, $i, 1, 1971);
    $save_callback(($api_version > POTX_API_5 ? '!long-month-name ' : '') . date("F", $stamp), $file);
    $save_callback(date("M", $stamp), $file);
  }
  for ($i = 0; $i <= 7; $i++) {
    $stamp = $i * 86400;
    $save_callback(date("D", $stamp), $file);
    $save_callback(date("l", $stamp), $file);
  }
  $save_callback('am', $file);
  $save_callback('pm', $file);
  $save_callback('AM', $file);
  $save_callback('PM', $file);
}