本文整理汇总了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));
}