Locale::getDisplayVariant
locale_get_display_variant
(PHP 5 >= 5.3.0, PHP 7, PECL intl >= 1.0.0)
Locale::getDisplayVariant -- locale_get_display_variant — 入力ロケールの変化形の表示名を、適切に地域化して返す
説明
オブジェクト指向型
public
static
Locale::getDisplayVariant
( string $locale
[, string $in_locale
] ) : string
手続き型
locale_get_display_variant
( string $locale
[, string $in_locale
] ) : string
入力ロケールの変化形の表示名を、適切に地域化して返します。
null
の場合はデフォルトのロケールを使用します。
パラメータ
locale
- 表示変化形を返したいロケール。
in_locale
- オプションのフォーマットロケール。 変化形の表示に使用します。
返り値
$locale に対応する変化形の表示名を、 $in_locale にあわせた形式で返します。
例
例1 locale_get_display_variant() の例
<?phpecho locale_get_display_variant('sl-Latn-IT-nedis', 'en');echo ";\n";echo locale_get_display_variant('sl-Latn-IT-nedis', 'fr');echo ";\n";echo locale_get_display_variant('sl-Latn-IT-nedis', 'de');?>
例2 オブジェクト指向の例
<?phpecho Locale::getDisplayVariant('sl-Latn-IT-nedis', 'en');echo ";\n";echo Locale::getDisplayVariant('sl-Latn-IT-nedis', 'fr');echo ";\n";echo Locale::getDisplayVariant('sl-Latn-IT-nedis', 'de');?>
上の例の出力は以下となります。
Natisone dialect; dialecte de Natisone; NEDIS
参考
- locale_get_display_name() - 入力ロケールの表示名を、適切に地域化して返す
- locale_get_display_language() - 入力ロケールの言語の表示名を、適切に地域化して返す
- locale_get_display_script() - 入力ロケールの文字の表示名を、適切に地域化して返す
- locale_get_display_region() - 入力ロケールの地域の表示名を、適切に地域化して返す