diff options
author | Matthieu Napoli <matthieu@mnapoli.fr> | 2015-02-02 06:41:18 +0300 |
---|---|---|
committer | Matthieu Napoli <matthieu@mnapoli.fr> | 2015-02-02 06:41:18 +0300 |
commit | 6539a73aa94ed84a302213f035e2429133edf1c7 (patch) | |
tree | 5f52e39874ca3b8577acc330051d8a157ab8ceb2 /plugins/LanguagesManager | |
parent | e9197cbd6e150822d0943ac096a1a6c6e2565938 (diff) |
Removed calls to deprecated Piwik\Common::getLanguagesList()
Diffstat (limited to 'plugins/LanguagesManager')
-rwxr-xr-x | plugins/LanguagesManager/Test/Integration/LanguagesManagerTest.php | 8 | ||||
-rw-r--r-- | plugins/LanguagesManager/TranslationWriter/Validate/CoreTranslations.php | 6 |
2 files changed, 9 insertions, 5 deletions
diff --git a/plugins/LanguagesManager/Test/Integration/LanguagesManagerTest.php b/plugins/LanguagesManager/Test/Integration/LanguagesManagerTest.php index cb48cd5211..1573d4ec37 100755 --- a/plugins/LanguagesManager/Test/Integration/LanguagesManagerTest.php +++ b/plugins/LanguagesManager/Test/Integration/LanguagesManagerTest.php @@ -8,7 +8,6 @@ namespace Piwik\Plugins\LanguagesManager\Test\Integration; -use Piwik\Common; use Piwik\Container\StaticContainer; use Piwik\Intl\Data\Provider\LanguageDataProvider; use Piwik\Plugins\LanguagesManager\API; @@ -173,9 +172,12 @@ class LanguagesManagerTest extends \PHPUnit_Framework_TestCase * * @group Plugins */ - function testGetLanguagesList() + public function testGetLanguagesList() { - $languages = Common::getLanguagesList(); + /** @var LanguageDataProvider $languageDataProvider */ + $languageDataProvider = StaticContainer::get('Piwik\Intl\Data\Provider\LanguageDataProvider'); + + $languages = $languageDataProvider->getLanguageList(); $this->assertTrue(count($languages) > 0); foreach ($languages as $langCode => $langs) { $this->assertTrue(strlen($langCode) == 2, "$langCode length = 2"); diff --git a/plugins/LanguagesManager/TranslationWriter/Validate/CoreTranslations.php b/plugins/LanguagesManager/TranslationWriter/Validate/CoreTranslations.php index 8499f57850..5da73db3f1 100644 --- a/plugins/LanguagesManager/TranslationWriter/Validate/CoreTranslations.php +++ b/plugins/LanguagesManager/TranslationWriter/Validate/CoreTranslations.php @@ -9,8 +9,8 @@ namespace Piwik\Plugins\LanguagesManager\TranslationWriter\Validate; -use Piwik\Common; use Piwik\Container\StaticContainer; +use Piwik\Intl\Data\Provider\LanguageDataProvider; use Piwik\Intl\Data\Provider\RegionDataProvider; class CoreTranslations extends ValidateAbstract @@ -75,10 +75,12 @@ class CoreTranslations extends ValidateAbstract return false; } + /** @var LanguageDataProvider $languageDataProvider */ + $languageDataProvider = StaticContainer::get('Piwik\Intl\Data\Provider\LanguageDataProvider'); /** @var RegionDataProvider $regionDataProvider */ $regionDataProvider = StaticContainer::get('Piwik\Intl\Data\Provider\RegionDataProvider'); - $allLanguages = Common::getLanguagesList(); + $allLanguages = $languageDataProvider->getLanguageList(); $allCountries = $regionDataProvider->getCountryList(); if (!preg_match('/^([a-z]{2})_([A-Z]{2})\.UTF-8$/', $translations['General']['Locale'], $matches)) { |