コード例 #1
0
ファイル: CULocale.php プロジェクト: nunodotferreira/Phred
 /**
  * Returns the variants of a locale after localizing them in the default or some other locale.
  *
  * @param  CULocale $inLocale **OPTIONAL. Default is** *the application's default locale*. The locale in which the
  * variants are to be localized.
  *
  * @return CUStringObject The locale's localized variants, as a single string.
  */
 public function dispVariants(CULocale $inLocale = null)
 {
     $strInLocale = isset($inLocale) ? $inLocale->m_name : self::defaultLocaleName();
     return Locale::getDisplayVariant($this->m_name, $strInLocale);
 }
コード例 #2
0
ファイル: LocaleFacade.php プロジェクト: ledgr/localefacade
 /**
  * Returns an appropriately localized display name for variants of the locale
  *
  * @param  string $inLocale Optional format locale to use to display the variant name
  * @return string           Name of the variant in the format appropriate for $inLocale
  */
 public function getDisplayVariant($inLocale = '')
 {
     if (!$inLocale) {
         $inLocale = $this->getLocale();
     }
     return IntlLocale::getDisplayVariant($this->getLocale(), $inLocale);
 }
コード例 #3
0
ファイル: Intl.php プロジェクト: bradley-holt/zf2
 /**
  * Returns detailed informations from the variant table
  * If no detail is given a complete table is returned
  *
  * @param string  $locale Normalized locale
  * @param boolean $invert Invert output of the data
  * @param string|array $detail Detail to return information for
  * @return array
  */
 public static function getDisplayVariant($locale, $invert = false, $detail = null)
 {
     if ($detail !== null) {
         return Locale::getDisplayVariant($locale);
     } else {
         $list = ZFLocale::getLocaleList();
         foreach ($list as $key => $value) {
             $list[$key] = Locale::getDisplayVariant($key);
         }
         if ($invert) {
             array_flip($list);
         }
         return $list;
     }
 }
コード例 #4
0
ファイル: Locale.php プロジェクト: brick/brick
 /**
  * Returns a name for the locale's variant code that is appropriate for display to the user.
  *
  * @param Locale|null $inLocale
  *
  * @return string
  */
 public function getDisplayVariant(Locale $inLocale = null)
 {
     return \Locale::getDisplayVariant($this->locale, $inLocale ? $inLocale->locale : null);
 }