You are here

function _calendar_systems_add_strings in Calendar Systems 7

Same name and namespace in other branches
  1. 8 calendar_systems.admin.inc \_calendar_systems_add_strings()
  2. 7.2 calendar_systems.admin.inc \_calendar_systems_add_strings()
1 call to _calendar_systems_add_strings()
calendar_systems_profile_overview in ./calendar_systems.admin.inc
Form callback for calendar systems profiles.

File

./calendar_systems.admin.inc, line 199
Contains Calendar Systems administration form callbacks.

Code

function _calendar_systems_add_strings() {
  _calendar_systems_load_dependencies();
  $calendar = cmfcCalendar::factory('v1', array());
  $stringGroups = $calendar
    ->getAllStrings();
  foreach ($stringGroups as $stringGroupName => $stringGroup) {
    foreach ($stringGroup as $langcode => $strings) {
      foreach ($strings as $string) {
        $options = array(
          'langcode' => $langcode,
        );
        if ($stringGroupName == 'monthsName') {
          $options['context'] = 'Long month name';
        }
        if ($stringGroupName == 'weeksShortName') {
          $options['context'] = 'Week short name';
        }
        $val = t($string, array(), $options);
      }
    }
  }
}