[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/libraries/vendor/maximebf/debugbar/src/DebugBar/DataCollector/ -> LocalizationCollector.php (source)

   1  <?php
   2  /*
   3   * This file is part of the DebugBar package.
   4   *
   5   * (c) 2013 Maxime Bouroumeau-Fuseau
   6   *
   7   * For the full copyright and license information, please view the LICENSE
   8   * file that was distributed with this source code.
   9   */
  10  
  11  namespace DebugBar\DataCollector;
  12  
  13  /**
  14   * Collects info about the current localization state
  15   */
  16  class LocalizationCollector extends DataCollector implements Renderable
  17  {
  18      /**
  19       * Get the current locale
  20       *
  21       * @return string
  22       */
  23      public function getLocale()
  24      {
  25          return setlocale(LC_ALL, 0);
  26      }
  27  
  28      /**
  29       * Get the current translations domain
  30       *
  31       * @return string
  32       */
  33      public function getDomain()
  34      {
  35          return textdomain();
  36      }
  37  
  38      /**
  39       * @return array
  40       */
  41      public function collect()
  42      {
  43          return array(
  44            'locale' => $this->getLocale(),
  45            'domain' => $this->getDomain(),
  46          );
  47      }
  48  
  49      /**
  50       * @return string
  51       */
  52      public function getName()
  53      {
  54          return 'localization';
  55      }
  56  
  57      /**
  58       * @return array
  59       */
  60      public function getWidgets()
  61      {
  62          return array(
  63              'domain' => array(
  64                  'icon' => 'bookmark',
  65                  'map'  => 'localization.domain',
  66              ),
  67              'locale' => array(
  68                  'icon' => 'flag',
  69                  'map'  => 'localization.locale',
  70              )
  71          );
  72      }
  73  }


Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer