From a24b190afdefc97c18641415fcd32becf00c3402 Mon Sep 17 00:00:00 2001 From: Demian Katz <demian.katz@villanova.edu> Date: Mon, 6 Nov 2017 13:49:11 -0500 Subject: [PATCH] Update to use zend-mvc-i18n. --- module/VuFind/src/VuFind/Bootstrapper.php | 2 +- module/VuFind/src/VuFind/Service/Factory.php | 4 ++-- .../src/VuFind/View/Helper/Root/DisplayLanguageOption.php | 2 +- module/VuFind/src/VuFindTest/Unit/TestCase.php | 2 +- module/VuFindTheme/src/VuFindTheme/Initializer.php | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/module/VuFind/src/VuFind/Bootstrapper.php b/module/VuFind/src/VuFind/Bootstrapper.php index d886c694e00..e31eb774755 100644 --- a/module/VuFind/src/VuFind/Bootstrapper.php +++ b/module/VuFind/src/VuFind/Bootstrapper.php @@ -343,7 +343,7 @@ class Bootstrapper 'ExtendedIni', $domain, $domain, $language ); } - } catch (\Zend\Mvc\Exception\BadMethodCallException $e) { + } catch (\Zend\Mvc\I18n\Exception\BadMethodCallException $e) { if (!extension_loaded('intl')) { throw new \Exception( 'Translation broken due to missing PHP intl extension.' diff --git a/module/VuFind/src/VuFind/Service/Factory.php b/module/VuFind/src/VuFind/Service/Factory.php index ee9adec780d..f374db17914 100644 --- a/module/VuFind/src/VuFind/Service/Factory.php +++ b/module/VuFind/src/VuFind/Service/Factory.php @@ -927,7 +927,7 @@ class Factory */ public static function getTranslator(ServiceManager $sm) { - $factory = new \Zend\Mvc\Service\TranslatorServiceFactory(); + $factory = new \Zend\Mvc\I18n\TranslatorFactory(); $translator = $factory->createService($sm); // Set up the ExtendedIni plugin: @@ -941,7 +941,7 @@ class Factory : [$config->Site->language, 'en']; try { $pm = $translator->getPluginManager(); - } catch (\Zend\Mvc\Exception\BadMethodCallException $ex) { + } catch (\Zend\Mvc\I18n\Exception\BadMethodCallException $ex) { // If getPluginManager is missing, this means that the user has // disabled translation in module.config.php or PHP's intl extension // is missing. We can do no further configuration of the object. diff --git a/module/VuFind/src/VuFind/View/Helper/Root/DisplayLanguageOption.php b/module/VuFind/src/VuFind/View/Helper/Root/DisplayLanguageOption.php index 9eccca46156..1ce8b531f5d 100644 --- a/module/VuFind/src/VuFind/View/Helper/Root/DisplayLanguageOption.php +++ b/module/VuFind/src/VuFind/View/Helper/Root/DisplayLanguageOption.php @@ -60,7 +60,7 @@ class DisplayLanguageOption extends \Zend\View\Helper\AbstractHelper 'ExtendedIni', null, 'default', 'native' ); $this->translator->setLocale('native'); - } catch (\Zend\Mvc\Exception\BadMethodCallException $e) { + } catch (\Zend\Mvc\I18n\Exception\BadMethodCallException $e) { if (!extension_loaded('intl')) { throw new \Exception( 'Translation broken due to missing PHP intl extension.' diff --git a/module/VuFind/src/VuFindTest/Unit/TestCase.php b/module/VuFind/src/VuFindTest/Unit/TestCase.php index d758182f105..8e91e9fc3c1 100644 --- a/module/VuFind/src/VuFindTest/Unit/TestCase.php +++ b/module/VuFind/src/VuFindTest/Unit/TestCase.php @@ -205,7 +205,7 @@ abstract class TestCase extends \PHPUnit_Framework_TestCase ) ); $this->serviceManager->setService('Config', []); - $factory = new \Zend\Mvc\Service\TranslatorServiceFactory(); + $factory = new \Zend\Mvc\I18n\TranslatorFactory(); $this->serviceManager->setService( 'VuFind\Translator', $factory->createService($this->serviceManager) ); diff --git a/module/VuFindTheme/src/VuFindTheme/Initializer.php b/module/VuFindTheme/src/VuFindTheme/Initializer.php index 871acc55507..34b3b94895d 100644 --- a/module/VuFindTheme/src/VuFindTheme/Initializer.php +++ b/module/VuFindTheme/src/VuFindTheme/Initializer.php @@ -416,7 +416,7 @@ class Initializer $pm = $translator->getPluginManager(); $pm->get('ExtendedIni')->addToPathStack($pathStack); - } catch (\Zend\Mvc\Exception\BadMethodCallException $e) { + } catch (\Zend\Mvc\I18n\Exception\BadMethodCallException $e) { // This exception likely indicates that translation is disabled, // so we can't proceed. return; -- GitLab