You are here

private function FullcalendarViewPreprocess::fullcalendar_view_map_langcodes in Fullcalendar View 5.x

Same name and namespace in other branches
  1. 6.x src/FullcalendarViewPreprocess.php \Drupal\fullcalendar_view\FullcalendarViewPreprocess::fullcalendar_view_map_langcodes()

Map Drupal language codes to those used by FullCalendar.

Parameters

string $langcode: Drupal language code.

Return value

string Returns the mapped langcode.

1 call to FullcalendarViewPreprocess::fullcalendar_view_map_langcodes()
FullcalendarViewPreprocess::process in src/FullcalendarViewPreprocess.php
Process the view variable array.

File

src/FullcalendarViewPreprocess.php, line 417

Class

FullcalendarViewPreprocess

Namespace

Drupal\fullcalendar_view

Code

private function fullcalendar_view_map_langcodes($langcode) {
  switch ($langcode) {
    case "en-x-simple":
      return "en";
    case "pt-pt":
      return "pt";
    case "zh-hans":
      return "zh-cn";
    case "zh-hant":
      return "zh-tw";
    default:
      return $langcode;
  }
}