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


PHP Translate::loadAllTranslations方法代码示例

本文整理汇总了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();
 }
开发者ID:dorelljames,项目名称:piwik,代码行数:7,代码来源:SegmentFormatterTest.php

示例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();
 }
开发者ID:ahdinosaur,项目名称:analytics.dinosaur.is,代码行数:7,代码来源:FormatterTest.php

示例3: setUp

 public function setUp()
 {
     parent::setUp();
     PiwikCache::flushAll();
     Translate::loadAllTranslations();
     $this->api = API::getInstance();
 }
开发者ID:dorelljames,项目名称:piwik,代码行数:7,代码来源:ApiTest.php

示例4: setUp

 public function setUp()
 {
     $this->sitesInfo = array(1 => array('idsite' => '1', 'currency' => 'EUR'));
     $this->formatter = new Html();
     Translate::loadAllTranslations();
     $this->setSiteManagerApiMock();
 }
开发者ID:FluentDevelopment,项目名称:piwik,代码行数:7,代码来源:HtmlTest.php

示例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();
 }
开发者ID:normimuc,项目名称:piwik,代码行数:9,代码来源:DashboardTest.php

示例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();
 }
开发者ID:andrzejewsky,项目名称:plugin-CustomAlerts,代码行数:12,代码来源:NotifierTest.php

示例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();
 }
开发者ID:andrzejewsky,项目名称:plugin-CustomAlerts,代码行数:15,代码来源:ControllerTest.php

示例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);
 }
开发者ID:FluentDevelopment,项目名称:piwik,代码行数:16,代码来源:AttributeHistoricalDataWithLocationsTest.php

示例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();
 }
开发者ID:dorelljames,项目名称:piwik,代码行数:13,代码来源:WidgetsListTest.php

示例10: test_getCategory_shouldReturnTranslatedCategory

 public function test_getCategory_shouldReturnTranslatedCategory()
 {
     Translate::loadAllTranslations();
     $this->assertEquals('Goals', $this->advancedReport->getCategory());
     Translate::reset();
 }
开发者ID:dorelljames,项目名称:piwik,代码行数:6,代码来源:ReportTest.php

示例11: setUp

 public function setUp()
 {
     Translate::loadAllTranslations();
 }
开发者ID:FluentDevelopment,项目名称:piwik,代码行数:4,代码来源:ArchiverTest.php

示例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();
 }
开发者ID:dorelljames,项目名称:piwik,代码行数:13,代码来源:DateTest.php

示例13: setUp

 public function setUp()
 {
     parent::setUp();
     Translate::loadAllTranslations();
 }
开发者ID:FluentDevelopment,项目名称:piwik,代码行数:5,代码来源:BasePeriodTest.php

示例14: setup

 protected function setup()
 {
     parent::setup();
     Translate::loadAllTranslations();
 }
开发者ID:FluentDevelopment,项目名称:piwik,代码行数:5,代码来源:ContentsTest.php

示例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));
         }
     }
 }
开发者ID:piwik,项目名称:piwik,代码行数:19,代码来源:LanguagesManagerTest.php


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