本文整理匯總了PHP中AppLocale::setTranslations方法的典型用法代碼示例。如果您正苦於以下問題:PHP AppLocale::setTranslations方法的具體用法?PHP AppLocale::setTranslations怎麽用?PHP AppLocale::setTranslations使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類AppLocale
的用法示例。
在下文中一共展示了AppLocale::setTranslations方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: setUp
/**
* @see PKPTestCase::setUp()
*/
protected function setUp()
{
parent::setUp();
// We need a router for URL generation.
$application = PKPApplication::getApplication();
$_SERVER['REQUEST_METHOD'] = 'GET';
$request = $application->getRequest();
if (!is_a($request->getRouter(), 'PKPRouter')) {
$router = new PageRouter();
$router->setApplication($application);
$request->setRouter($router);
}
// Add the indexing state as setting.
HookRegistry::register('articledao::getAdditionalFieldNames', array($this, 'callbackAdditionalFieldNames'));
// Set translations. This must be done early
// as these translations will be saved statically
// during the first request.
AppLocale::setTranslations(array('search.operator.not' => 'nicht', 'search.operator.and' => 'und', 'search.operator.or' => 'oder'));
// Instantiate our web service for testing.
$this->solrWebService = new SolrWebService('http://localhost:8983/solr/ojs/search', 'admin', 'please change', 'test-inst');
}
示例2: testTitleCase
/**
* @covers String::titleCase
*/
public function testTitleCase()
{
AppLocale::setTranslations(array('common.titleSmallWords' => 'is a'));
$originalTitle = 'AND This IS A TEST title';
self::assertEquals('And This is a Test Title', String::titleCase($originalTitle));
}