当前位置: 首页>>代码示例>>PHP>>正文


PHP localize函数代码示例

本文整理汇总了PHP中localize函数的典型用法代码示例。如果您正苦于以下问题:PHP localize函数的具体用法?PHP localize怎么用?PHP localize使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了localize函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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


注:本文中的localize函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。