本文整理汇总了PHP中locales::display_name方法的典型用法代码示例。如果您正苦于以下问题:PHP locales::display_name方法的具体用法?PHP locales::display_name怎么用?PHP locales::display_name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类locales
的用法示例。
在下文中一共展示了locales::display_name方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: show_user_profile
static function show_user_profile($data)
{
$v = new View("user_profile_info.html");
$fields = array("name" => t("Name"), "locale" => t("Language Preference"), "email" => t("Email"), "full_name" => t("Full name"), "url" => "Web site");
if (!$data->user->guest) {
$fields = array("name" => t("Name"), "full_name" => t("Full name"), "url" => "Web site");
}
$v->user_profile_data = array();
foreach ($fields as $field => $label) {
if (!empty($data->user->{$field})) {
$value = $data->user->{$field};
if ($field == "locale") {
$value = locales::display_name($value);
}
$v->user_profile_data[(string) $label] = $value;
}
}
$data->content[] = (object) array("title" => t("User information"), "view" => $v);
}
示例2: if
<? if (!Input::instance()->get('show_all_l10n_messages')): ?>
<a style="background-color:#fff" href="<?php
echo url::site("admin/languages?show_all_l10n_messages=1");
?>
"><?php
echo t("(Show all)");
?>
</a>
<? endif; ?>
</h2></div>
<div class="label source"><h2><?php
echo t("Source");
?>
</div>
<div class="label translation"><h2><?php
echo t("Translation to %language", array("language" => locales::display_name()));
?>
</h2></div>
</div>
<div id="l10n-client-string-select">
<ul class="string-list">
<? foreach ($string_list as $string): ?>
<li class="<?php
echo $string["translation"] === "" ? "untranslated" : "translated";
?>
">
<? if (is_array($string["source"])): ?>
[one] - <?php
echo $string["source"]["one"];
?>
<br/>
示例3: t
echo t("Translating Gallery");
?>
</h3>
<p><?php
echo t("Follow these steps to begin translating Gallery.");
?>
</p>
<ul>
<li><?php
echo t("Make sure the target language is installed and up to date (check above).");
?>
</li>
<li><?php
echo t("Make sure you have selected the right target language (currently %default_locale).", array("default_locale" => locales::display_name()));
?>
</li>
<li><?php
echo t("Start the translation mode and the translation interface will appear at the bottom of each Gallery page.");
?>
</li>
</ul>
<a href="<?php
echo url::site("l10n_client/toggle_l10n_mode?csrf=" . access::csrf_token());
?>
"
class="g-button ui-state-default ui-corner-all ui-icon-left">
<span class="ui-icon ui-icon-power"></span>
<?php
if (Session::instance()->get("l10n_mode", false)) {