本文整理汇总了PHP中localize函数的典型用法代码示例。如果您正苦于以下问题:PHP localize函数的具体用法?PHP localize怎么用?PHP localize使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了localize函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: isItalian
function isItalian()
{
if ("IT" == localize()) {
return true;
}
return false;
}
开发者ID:Gruppio,项目名称:Ocagiuliva,代码行数:7,代码来源:Localize.php
示例2: testLocalizeUnknown
public function testLocalizeUnknown()
{
$_SERVER['HTTP_ACCEPT_LANGUAGE'] = "aa";
$this->assertEquals("Authors", localize("authors.title", -1, true));
$_SERVER['HTTP_ACCEPT_LANGUAGE'] = "en";
localize("authors.title", -1, true);
}
开发者ID:ha-y,项目名称:cops,代码行数:7,代码来源:baseTest.php
示例3: echo_loc2
function echo_loc2($buf) {
// if ($_GET['test']!='1') {
// echo ($buf);
// } else {
echo (localize($buf));
// }
}
开发者ID:AragCF,项目名称:extmail2,代码行数:7,代码来源:localization.php
示例4: getAllAuthorsByFirstLetter
public static function getAllAuthorsByFirstLetter()
{
list(, $result) = parent::executeQuery("select {0}\nfrom authors\ngroup by substr (upper (sort), 1, 1)\norder by substr (upper (sort), 1, 1)", "substr (upper (sort), 1, 1) as title, count(*) as count", "", array(), -1);
$entryArray = array();
while ($post = $result->fetchObject()) {
array_push($entryArray, new Entry($post->title, Author::getEntryIdByLetter($post->title), str_format(localize("authorword", $post->count), $post->count), "text", array(new LinkNavigation("?page=" . parent::PAGE_AUTHORS_FIRST_LETTER . "&id=" . rawurlencode($post->title))), "", $post->count));
}
return $entryArray;
}
开发者ID:ha-y,项目名称:cops,代码行数:9,代码来源:author.php
示例5: getAllTagsByQuery
public static function getAllTagsByQuery($query, $n, $database = NULL, $numberPerPage = NULL)
{
$columns = "tags.id as id, tags.name as name, (select count(*) from books_tags_link where tags.id = tag) as count";
$sql = 'select {0} from tags where upper (tags.name) like ? {1} order by tags.name';
list($totalNumber, $result) = parent::executeQuery($sql, $columns, "", array('%' . $query . '%'), $n, $database, $numberPerPage);
$entryArray = array();
while ($post = $result->fetchObject()) {
$tag = new Tag($post);
array_push($entryArray, new Entry($tag->name, $tag->getEntryId(), str_format(localize("bookword", $post->count), $post->count), "text", array(new LinkNavigation($tag->getUri()))));
}
return array($entryArray, $totalNumber);
}
开发者ID:BreizhCat,项目名称:cops,代码行数:12,代码来源:tag.php
示例6: getEntryArray
public static function getEntryArray($query, $params)
{
list(, $result) = parent::executeQuery($query, self::RATING_COLUMNS, "", $params, -1);
$entryArray = array();
while ($post = $result->fetchObject()) {
$ratingObj = new Rating($post->id, $post->rating);
$rating = $post->rating / 2;
$rating = str_format(localize("ratingword", $rating), $rating);
array_push($entryArray, new Entry($rating, $ratingObj->getEntryId(), str_format(localize("bookword", $post->count), $post->count), "text", array(new LinkNavigation($ratingObj->getUri())), "", $post->count));
}
return $entryArray;
}
开发者ID:leader716,项目名称:cops,代码行数:12,代码来源:rating.php
示例7: getAllLanguages
public static function getAllLanguages()
{
$result = parent::getDb()->query('select languages.id as id, languages.lang_code as lang_code, count(*) as count
from languages, books_languages_link
where languages.id = books_languages_link.lang_code
group by languages.id, books_languages_link.lang_code
order by languages.lang_code');
$entryArray = array();
while ($post = $result->fetchObject()) {
$language = new Language($post->id, $post->lang_code);
array_push($entryArray, new Entry(Language::getLanguageString($language->lang_code), $language->getEntryId(), str_format(localize("bookword", $post->count), $post->count), "text", array(new LinkNavigation($language->getUri())), "", $post->count));
}
return $entryArray;
}
开发者ID:BreizhCat,项目名称:cops,代码行数:14,代码来源:language.php
示例8: foreach
}
$mail->SMTPAuth = !empty($config['cops_mail_configuration']["smtp.username"]);
if (!empty($config['cops_mail_configuration']["smtp.username"])) {
$mail->Username = $config['cops_mail_configuration']["smtp.username"];
}
if (!empty($config['cops_mail_configuration']["smtp.password"])) {
$mail->Password = $config['cops_mail_configuration']["smtp.password"];
}
if (!empty($config['cops_mail_configuration']["smtp.secure"])) {
$mail->SMTPSecure = $config['cops_mail_configuration']["smtp.secure"];
}
$mail->From = $config['cops_mail_configuration']["address.from"];
$mail->FromName = $config['cops_title_default'];
foreach (explode(";", $emailDest) as $emailAddress) {
if (empty($emailAddress)) {
continue;
}
$mail->AddAddress($emailAddress);
}
$mail->AddAttachment($data->getLocalPath());
$mail->IsHTML(true);
$mail->Subject = 'Sent by COPS : ' . $data->getUpdatedFilename();
$mail->Body = "<h1>" . $book->title . "</h1><h2>" . $book->getAuthorsName() . "</h2>" . $book->getComment();
$mail->AltBody = "Sent by COPS";
if (!$mail->Send()) {
echo localize("mail.messagenotsent");
echo 'Mailer Error: ' . $mail->ErrorInfo;
exit;
}
echo localize("mail.messagesent");
开发者ID:BreizhCat,项目名称:cops,代码行数:30,代码来源:sendtomail.php
示例9: testGetAcceptLanguages
/**
* @dataProvider providerGetAcceptLanguages
*/
public function testGetAcceptLanguages($acceptLanguage, $result)
{
$_SERVER['HTTP_ACCEPT_LANGUAGE'] = $acceptLanguage;
$langs = array_keys(GetAcceptLanguages());
$this->assertEquals($result, $langs[0]);
$_SERVER['HTTP_ACCEPT_LANGUAGE'] = "en";
localize("authors.title", -1, true);
}
开发者ID:renemarc,项目名称:cops,代码行数:11,代码来源:baseTest.php
示例10: getAllBooks
public static function getAllBooks()
{
list(, $result) = parent::executeQuery("select {0}\nfrom books\ngroup by substr (upper (sort), 1, 1)\norder by substr (upper (sort), 1, 1)", "substr (upper (sort), 1, 1) as title, count(*) as count", self::getFilterString(), array(), -1);
$entryArray = array();
while ($post = $result->fetchObject()) {
array_push($entryArray, new Entry($post->title, Book::getEntryIdByLetter($post->title), str_format(localize("bookword", $post->count), $post->count), "text", array(new LinkNavigation("?page=" . parent::PAGE_ALL_BOOKS_LETTER . "&id=" . rawurlencode($post->title))), "", $post->count));
}
return $entryArray;
}
开发者ID:ha-y,项目名称:cops,代码行数:9,代码来源:book.php
示例11: getCustomByBook
public function getCustomByBook($book)
{
$queryFormat = "SELECT {0}.id AS id, {0}.value AS value FROM {0} WHERE {0}.book = {1}";
$query = str_format($queryFormat, $this->getTableName(), $book->id);
$result = $this->getDb()->query($query);
if ($post = $result->fetchObject()) {
return new CustomColumn($post->id, $post->value, $this);
}
return new CustomColumn(NULL, localize("customcolumn.float.unknown"), $this);
}
开发者ID:horus68,项目名称:cops,代码行数:10,代码来源:customcolumn.php
示例12: startXmlDocument
private function startXmlDocument($page)
{
global $config;
self::getXmlStream()->startDocument('1.0', 'UTF-8');
self::getXmlStream()->startElement("feed");
self::getXmlStream()->writeAttribute("xmlns", "http://www.w3.org/2005/Atom");
self::getXmlStream()->writeAttribute("xmlns:xhtml", "http://www.w3.org/1999/xhtml");
self::getXmlStream()->writeAttribute("xmlns:opds", "http://opds-spec.org/2010/catalog");
self::getXmlStream()->writeAttribute("xmlns:opensearch", "http://a9.com/-/spec/opensearch/1.1/");
self::getXmlStream()->writeAttribute("xmlns:dcterms", "http://purl.org/dc/terms/");
self::getXmlStream()->startElement("title");
self::getXmlStream()->text($page->title);
self::getXmlStream()->endElement();
if ($page->subtitle != "") {
self::getXmlStream()->startElement("subtitle");
self::getXmlStream()->text($page->subtitle);
self::getXmlStream()->endElement();
}
self::getXmlStream()->startElement("id");
if ($page->idPage) {
$idPage = $page->idPage;
if (!is_null(GetUrlParam(DB))) {
$idPage = str_replace("cops:", "cops:" . GetUrlParam(DB) . ":", $idPage);
}
self::getXmlStream()->text($idPage);
} else {
self::getXmlStream()->text($_SERVER['REQUEST_URI']);
}
self::getXmlStream()->endElement();
self::getXmlStream()->startElement("updated");
self::getXmlStream()->text(self::getUpdatedTime());
self::getXmlStream()->endElement();
self::getXmlStream()->startElement("icon");
self::getXmlStream()->text($page->favicon);
self::getXmlStream()->endElement();
self::getXmlStream()->startElement("author");
self::getXmlStream()->startElement("name");
self::getXmlStream()->text($page->authorName);
self::getXmlStream()->endElement();
self::getXmlStream()->startElement("uri");
self::getXmlStream()->text($page->authorUri);
self::getXmlStream()->endElement();
self::getXmlStream()->startElement("email");
self::getXmlStream()->text($page->authorEmail);
self::getXmlStream()->endElement();
self::getXmlStream()->endElement();
$link = new LinkNavigation("", "start", "Home");
self::renderLink($link);
$link = new LinkNavigation("?" . getQueryString(), "self");
self::renderLink($link);
$urlparam = "?";
if (!is_null(GetUrlParam(DB))) {
$urlparam = addURLParameter($urlparam, DB, GetUrlParam(DB));
}
if ($config['cops_generate_invalid_opds_stream'] == 0 || preg_match("/(MantanoReader|FBReader)/", $_SERVER['HTTP_USER_AGENT'])) {
// Good and compliant way of handling search
$urlparam = addURLParameter($urlparam, "page", Base::PAGE_OPENSEARCH);
$link = new Link("feed.php" . $urlparam, "application/opensearchdescription+xml", "search", "Search here");
} else {
// Bad way, will be removed when OPDS client are fixed
$urlparam = addURLParameter($urlparam, "query", "{searchTerms}");
$urlparam = str_replace("%7B", "{", $urlparam);
$urlparam = str_replace("%7D", "}", $urlparam);
$link = new Link($config['cops_full_url'] . 'feed.php' . $urlparam, "application/atom+xml", "search", "Search here");
}
self::renderLink($link);
if ($page->containsBook() && !is_null($config['cops_books_filter']) && count($config['cops_books_filter']) > 0) {
$Urlfilter = getURLParam("tag", "");
foreach ($config['cops_books_filter'] as $lib => $filter) {
$link = new LinkFacet("?" . addURLParameter(getQueryString(), "tag", $filter), $lib, localize("tagword.title"), $filter == $Urlfilter);
self::renderLink($link);
}
}
}
开发者ID:horus68,项目名称:cops,代码行数:74,代码来源:OPDS_renderer.php
示例13: fillObjectDetails
function fillObjectDetails($loop, $rec) {
// ajax_echo_r ($rec);
$vars = $loop->getVariables();
// ajax_echo_r ($vars);
foreach ($vars as $var) {
if ($var) {
$loop->fill( "%".$var."%" , $rec->$var);
}
}
$loop->processfcb('');
$loop->fill( '%imgfolder%' , $this->imgfolder );
$loop->fill( '%viewroot%' , $this->viewroot );
return localize($loop->output());
}
开发者ID:serega011,项目名称:izumrud,代码行数:15,代码来源:Controller.php
示例14: elseif
$headerdirection = $textdir["tableheading"][$file];
} elseif ($strings["tablealias"][$file] != "") {
$heading = $strings["tablealias"][$file];
// Also used below for h2
$headerdirection = $textdir["tablealias"][$file];
} else {
localize(1);
$heading = $file;
// Also used below for h2
$headerdirection = $textdir["browserfile"];
$dontlocalizeagain = 1;
// Just spare the running of an extra function (since it was already (by necessity) run within this else)--see the "if" just below
}
// end else (if there is no heading or alias set for the specific table--having this option allows titles to appear with the table name (in some form at least), even if a localization was not set (or if it was not set because the name is intended to be the heading))
if (!$dontlocalizeagain) {
localize(1);
// Go back to the localization for the user's choice of language
}
// end if (if need to localize again)
}
// end else (if there is no heading or alias in the given language)
// This will be overwritten in browse9.php if there is a file defined
$title = $strings["browserfile"] . ": " . $heading;
// Call header function to add XHTML headers
// If no file is set, refer the user back to the main page.
if (!$file) {
headerAdd($charset, $defaultlanguage, $title, $headerdirection, "", $style);
delaytime(0, $browserfile);
}
// end if (if there is no file defined, redirect the user back to the main page)
// Get table metadata such as:
开发者ID:brettz9,项目名称:textbrowser,代码行数:31,代码来源:headerpreptoadd.php
示例15: getMessage
function getMessage($id) {
$tmp = new Template($this->viewroot,'messages.htt');
$tmp->loadloop("block_".$id);
$tmp->fill('%imgfolder%', getrootdir().$this->imgfolder);
return localize($tmp->output());
}
开发者ID:AragCF,项目名称:alchemy,代码行数:6,代码来源:Controller.php
示例16: __L
/**
* Retrieves the translated $phrase in $locale (when available),
* the original $phrase otherwise.
*/
function __L($phrase, $locale = null)
{
return localize($phrase, $locale);
}
开发者ID:asalce,项目名称:wp-ci,代码行数:8,代码来源:localization_helper.php
示例17: renderValueInContext
/**
* Converts any value to a string to become part of a rendered template. This
* means escaping, if required, and conversion to a unicode object. If value
* is a string, it is expected to have already been translated.
*
* @static
*
* @param $value
* @param $context
*
* @return SafeString|string
*/
public static function renderValueInContext($value, $context)
{
$value = dja_localtime($value, $context->use_tz);
$value = localize($value, $context->use_l10n);
if ($context->autoescape && !$value instanceof SafeData || $value instanceof EscapeData) {
return escape($value);
} else {
return $value;
}
}
开发者ID:idlesign,项目名称:dja,代码行数:22,代码来源:base.php
示例18: addCompleteArray
public static function addCompleteArray($in)
{
global $config;
$out = $in;
$out["c"] = array("version" => VERSION, "i18n" => array("coverAlt" => localize("i18n.coversection"), "authorsTitle" => localize("authors.title"), "bookwordTitle" => localize("bookword.title"), "tagsTitle" => localize("tags.title"), "seriesTitle" => localize("series.title"), "customizeTitle" => localize("customize.title"), "aboutTitle" => localize("about.title"), "previousAlt" => localize("paging.previous.alternate"), "nextAlt" => localize("paging.next.alternate"), "searchAlt" => localize("search.alternate"), "sortAlt" => localize("sort.alternate"), "homeAlt" => localize("home.alternate"), "cogAlt" => localize("cog.alternate"), "permalinkAlt" => localize("permalink.alternate"), "publisherName" => localize("publisher.name"), "pubdateTitle" => localize("pubdate.title"), "languagesTitle" => localize("language.title"), "contentTitle" => localize("content.summary"), "sortorderAsc" => localize("search.sortorder.asc"), "sortorderDesc" => localize("search.sortorder.desc"), "customizeEmail" => localize("customize.email")), "url" => array("detailUrl" => "index.php?page=13&id={0}&db={1}", "coverUrl" => "fetch.php?id={0}&db={1}", "thumbnailUrl" => "fetch.php?height=" . $config['cops_html_thumbnail_height'] . "&id={0}&db={1}"), "config" => array("use_fancyapps" => $config["cops_use_fancyapps"], "max_item_per_page" => $config['cops_max_item_per_page'], "kindleHack" => "", "server_side_rendering" => useServerSideRendering(), "html_tag_filter" => $config['cops_html_tag_filter']));
if ($config['cops_thumbnail_handling'] == "1") {
$out["c"]["url"]["thumbnailUrl"] = $out["c"]["url"]["coverUrl"];
} else {
if (!empty($config['cops_thumbnail_handling'])) {
$out["c"]["url"]["thumbnailUrl"] = $config['cops_thumbnail_handling'];
}
}
if (preg_match("/./", $_SERVER['HTTP_USER_AGENT'])) {
$out["c"]["config"]["kindleHack"] = 'style="text-decoration: none !important;"';
}
return $out;
}
开发者ID:horus68,项目名称:cops,代码行数:17,代码来源:JSON_renderer.php
示例19: elseif
if ($tablealias != '') {
$option_array[$tablelist_counter]['text'] = $tablealias;
$option_array[$tablelist_counter]['dir'] = $textdirec;
} // end elseif (if there is at least a specified heading for the table in the default language)
elseif ($tableheading != '') {
$option_array[$tablelist_counter]['text'] = $tableheading;
$option_array[$tablelist_counter]['dir'] = $textdirec;
} // end elseif (if there is at least a specified alias for the table in the default language)
else {
$option_array[$tablelist_counter]['text'] = $row2[0];
$option_array[$tablelist_counter]['dir'] = $default_lang_direction;
} // end else (if there is no table alias)
localize(1); // Go back to the localization for the user's choice of language
} // end else (if there is no table alias or table heading in the user's language)
$tablelist_counter++;
} // end if
} // end foreach (of all the tables being added to the drop-down menu)
// Run function to sort a multidimensional array (the 2nd dimension only) by a specified field
$option_mult_arr[] = fieldSort($option_array, 'text');
$advancedaccessno = $accesskeynobutton - 1;
$advancedaccess = chr($advancedaccessno);
if ($advancedaccessno >= 106) {
$advancedaccess = "accesskey=\"".$advancedaccess."\"";
} // end if (if the letters are still greater than the last possible ("j"), give an accesskey)
开发者ID:brettz9,项目名称:textbrowser,代码行数:31,代码来源:browsetest.php5
示例20: getEntryArrayWithBookNumber
public static function getEntryArrayWithBookNumber($query, $columns, $params, $category)
{
list(, $result) = self::executeQuery($query, $columns, "", $params, -1);
$entryArray = array();
while ($post = $result->fetchObject()) {
$instance = new $category($post);
if (property_exists($post, "sort")) {
$title = $post->sort;
} else {
$title = $post->name;
}
array_push($entryArray, new Entry($title, $instance->getEntryId(), str_format(localize("bookword", $post->count), $post->count), "text", array(new LinkNavigation($instance->getUri())), "", $post->count));
}
return $entryArray;
}
开发者ID:Klemart3D,项目名称:COPS,代码行数:15,代码来源:base.php
注:本文中的localize函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论