You are here

function _calendar_jalali_t in Calendar Systems 6.2

Calendar translate helper.

Parameters

$type: Type of needed translation.

  • weekdays
  • months
  • meridiem_lower
  • meridiem_upper

$destination: Imply the destination string:

  • source
  • translation

Return value

An associative array of translations keyed by their sources.

1 call to _calendar_jalali_t()
calendar_jalali_formatter in calendars/calendar_jalali/calendar_jalali.module
Jalali calendar date formatter callback.

File

calendars/calendar_jalali/calendar_jalali.module, line 480
Implements necessary hooks & helpers to support Jalali Calendar.

Code

function _calendar_jalali_t($type, $destination = 'translation') {
  if ($destination == 'translation' && !function_exists('locale')) {
    $destination = 'source';
  }
  $source = array(
    'weekdays' => array(
      'Shanbeh',
      'Yekshanbeh',
      'Doshanbeh',
      'Sehshanbeh',
      'Chaharshanbeh',
      'Panjshanbeh',
      'Jomeh',
    ),
    'months' => array(
      'Farvardin',
      'Ordibehesht',
      'Khordad',
      'Tir',
      'Mordad',
      'Shahrivar',
      'Mehr',
      'Aban',
      'Azar',
      'Dey',
      'Bahman',
      'Esfand',
    ),
    'meridiem_lower' => array(
      'am',
      'pm',
    ),
    'meridiem_upper' => array(
      'AM',
      'PM',
    ),
  );
  return $destination == 'source' ? $source[$type] : array_combine($source[$type], array_map('locale', $source[$type], array_fill(0, count($source[$type]), 'fa')));
}