本文整理汇总了PHP中Piwik\Translate::loadAllTranslations方法的典型用法代码示例。如果您正苦于以下问题:PHP Translate::loadAllTranslations方法的具体用法?PHP Translate::loadAllTranslations怎么用?PHP Translate::loadAllTranslations使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Piwik\Translate
的用法示例。
在下文中一共展示了Translate::loadAllTranslations方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUp
public function setUp()
{
parent::setUp();
$this->idSite = Fixture::createWebsite('2012-01-01 00:00:00');
$this->formatter = new SegmentFormatter(new SegmentList());
Translate::loadAllTranslations();
}
示例2: setUp
public function setUp()
{
$this->sitesInfo = array(1 => array('idsite' => '1', 'currency' => 'EUR'), 2 => array('idsite' => '2', 'currency' => 'DKK'), 3 => array('idsite' => '3', 'currency' => 'PLN'), 4 => array('idsite' => '4', 'currency' => 'NZD'), 5 => array('idsite' => '5', 'currency' => 'JPY'));
$this->formatter = new Formatter();
Translate::loadAllTranslations();
$this->setSiteManagerApiMock();
}
示例3: setUp
public function setUp()
{
parent::setUp();
PiwikCache::flushAll();
Translate::loadAllTranslations();
$this->api = API::getInstance();
}
示例4: setUp
public function setUp()
{
$this->sitesInfo = array(1 => array('idsite' => '1', 'currency' => 'EUR'));
$this->formatter = new Html();
Translate::loadAllTranslations();
$this->setSiteManagerApiMock();
}
示例5: setUp
public function setUp()
{
parent::setUp();
for ($i = 1; $i <= $this->numSitesToCreate; $i++) {
Fixture::createWebsite('2012-12-12 00:00:00', $ecommerce = 0, 'Site ' . $i);
}
Translate::loadAllTranslations();
$this->dashboard = $this->getMockBuilder('Piwik\\Plugins\\MultiSites\\Dashboard')->setMethods(null)->disableOriginalConstructor()->getMock();
}
示例6: setUp
public function setUp()
{
parent::setUp();
// make sure templates will be found
Plugin\Manager::getInstance()->loadPlugin('CustomAlerts');
Plugin\Manager::getInstance()->loadPlugin('Morpheus');
Translate::loadAllTranslations();
\Piwik\Plugins\UsersManager\API::getInstance()->addUser('login1', 'p2kK2msAw1', 'test1@example.com');
\Piwik\Plugins\UsersManager\API::getInstance()->addUser('login2', 'p2kK2msAw1', 'test2@example.com');
\Piwik\Plugins\UsersManager\API::getInstance()->addUser('login3', 'p2kK2msAw1', 'test3@example.com');
$this->notifier = new CustomNotifier();
}
示例7: setUp
public function setUp()
{
parent::setUp();
// make sure templates will be found
Plugin\Manager::getInstance()->loadPlugin('CustomAlerts');
Plugin\Manager::getInstance()->loadPlugin('Morpheus');
if (class_exists('\\Piwik\\Cache\\PluginAwareStaticCache')) {
\Piwik\Cache\PluginAwareStaticCache::clearAll();
// TODO remove this one
} else {
PiwikCache::flushAll();
}
Translate::loadAllTranslations();
$this->controller = new CustomController();
}
示例8: testExecute_ShouldReturnLogAfterWorkingWithSomeData
public function testExecute_ShouldReturnLogAfterWorkingWithSomeData()
{
$result = $this->executeCommand('2010-01-03,2010-06-03');
$this->assertContains('Re-attribution for date range: 2010-01-03 to 2010-06-03. 35 visits to process with provider "geoip_php".', $result);
$this->assertRegExp('/100% processed. Time elapsed: [0-9.]+s/', $result);
$queryParams = array('idSite' => self::$fixture->idSite, 'date' => self::$fixture->dateTime, 'period' => 'month');
// we need to manually reload the translations since they get reset for some reason in IntegrationTestCase::tearDown();
// if we do not load translations, a DataTable\Map containing multiple periods will contain only one DataTable having
// the label `General_DateRangeFromTo` instead of many like `From 2010-01-04 to 2010-01-11`, ' `From 2010-01-11 to 2010-01-18`
// As those data tables would all have the same prettyfied period label they would overwrite each other.
Translate::loadAllTranslations();
$this->assertApiResponseEqualsExpected("UserCountry.getCountry", $queryParams);
$this->assertApiResponseEqualsExpected("UserCountry.getContinent", $queryParams);
$this->assertApiResponseEqualsExpected("UserCountry.getRegion", $queryParams);
$this->assertApiResponseEqualsExpected("UserCountry.getCity", $queryParams);
}
示例9: testIsDefined
public function testIsDefined()
{
// setup the access layer
FakeAccess::$superUser = true;
Translate::loadAllTranslations();
Fixture::createWebsite('2009-01-04 00:11:42', true);
$_GET['idSite'] = 1;
WidgetsList::_reset();
WidgetsList::add('Actions', 'Pages', 'Actions', 'getPageUrls');
$this->assertTrue(WidgetsList::isDefined('Actions', 'getPageUrls'));
$this->assertFalse(WidgetsList::isDefined('Actions', 'inValiD'));
Translate::reset();
}
示例10: test_getCategory_shouldReturnTranslatedCategory
public function test_getCategory_shouldReturnTranslatedCategory()
{
Translate::loadAllTranslations();
$this->assertEquals('Goals', $this->advancedReport->getCategory());
Translate::reset();
}
示例11: setUp
public function setUp()
{
Translate::loadAllTranslations();
}
示例12: testGetLocalizedTimeFormats
/**
* @group Core
* @dataProvider getLocalizedLongStrings
*/
public function testGetLocalizedTimeFormats($language, $use12HourClock, $time, $shouldBe)
{
Translate::loadAllTranslations();
StaticContainer::get('Piwik\\Translation\\Translator')->setCurrentLanguage($language);
StaticContainer::get('Piwik\\Intl\\Data\\Provider\\DateTimeFormatProvider')->forceTimeFormat($use12HourClock);
$date = Date::factory($time);
$this->assertEquals($shouldBe, $date->getLocalized(Date::TIME_FORMAT));
Translate::reset();
}
示例13: setUp
public function setUp()
{
parent::setUp();
Translate::loadAllTranslations();
}
示例14: setup
protected function setup()
{
parent::setup();
Translate::loadAllTranslations();
}
示例15: testTranslationsUseNumberedPlaceholders
/**
* check all english translations do not contain more than one
*
* @group Plugins
* @group numbered
*/
function testTranslationsUseNumberedPlaceholders()
{
Cache::flushAll();
$translator = StaticContainer::get('Piwik\\Translation\\Translator');
$translator->reset();
Translate::loadAllTranslations();
$translations = $translator->getAllTranslations();
foreach ($translations as $plugin => $pluginTranslations) {
foreach ($pluginTranslations as $key => $pluginTranslation) {
$this->assertLessThanOrEqual(1, substr_count($pluginTranslation, '%s'), sprintf('%s.%s must use numbered placeholders instead of multiple %%s', $plugin, $key));
}
}
}