original_string: public function shortcodeLocale(Event $event, array $atts, $content, $tag)
      {
          $option = array_keys((array)$atts);
          $locale = I18n::locale();
          $languages = quickapps('languages');
          $out = '';
  
          if (!isset($languages[$locale])) {
              return $out;
          }
  
          if (empty($option)) {
              $option = 'code';
          } else {
              $option = $option[0];
          }
  
          if ($info = $languages[$locale]) {
              switch ($option) {
                  case 'code':
                      $out = $info['code'];
                      break;
  
                  case 'name':
                      $out = $info['name'];
                      break;
  
                  case 'direction':
                      $out = $info['direction'];
                      break;
              }
          }
  
          return $out;
      }
code: public function shortcodeLocale(Event $event, array $atts, $content, $tag)
      {
          $option = array_keys((array)$atts);
          $locale = I18n::locale();
          $languages = quickapps('languages');
          $out = '';
  
          if (!isset($languages[$locale])) {
              return $out;
          }
  
          if (empty($option)) {
              $option = 'code';
          } else {
              $option = $option[0];
          }
  
          if ($info = $languages[$locale]) {
              switch ($option) {
                  case 'code':
                      $out = $info['code'];
                      break;
  
                  case 'name':
                      $out = $info['name'];
                      break;
  
                  case 'direction':
                      $out = $info['direction'];
                      break;
              }
          }
  
          return $out;
      }
code_tokens: public function shortcodeLocale ( Event $ event , array $ atts , $ content , $ tag ) { $ option = array_keys ( ( array ) $ atts ) ; $ locale = I18n :: locale ( ) ; $ languages = quickapps ( 'languages' ) ; $ out = '' ; if ( ! isset ( $ languages [ $ locale ] ) ) { return $ out ; } if ( empty ( $ option ) ) { $ option = 'code' ; } else { $ option = $ option [ 0 ] ; } if ( $ info = $ languages [ $ locale ] ) { switch ( $ option ) { case 'code' : $ out = $ info [ 'code' ] ; break ; case 'name' : $ out = $ info [ 'name' ] ; break ; case 'direction' : $ out = $ info [ 'direction' ] ; break ; } } return $ out ; }
docstring: Implements the "locale" shortcode.
  
  {locale code /}
  {locale name /}
  {locale direction /}
  
  @param \Cake\Event\Event $event The event that was fired
  @param array $atts An associative array of attributes, or an empty string if
  no attributes are given
  @param string $content The enclosed content (if the shortcode is used in its
  enclosing form)
  @param string $tag The shortcode tag
  @return string
docstring_tokens: Implements the locale shortcode .