diff --git a/config/vufind/Virtua.ini b/config/vufind/Virtua.ini index ff131fc5eb1c2d565e7ff87fea26e362955dabf2..6af4bdca53837a2cee4a3ce3302c787f4a6775c7 100644 --- a/config/vufind/Virtua.ini +++ b/config/vufind/Virtua.ini @@ -18,3 +18,5 @@ service = VTLS01 ; Login details user = username password = password +; System language (en -> English, pt -> Portuguese, fr -> French; default = en) +language = en \ No newline at end of file diff --git a/module/VuFind/src/VuFind/ILS/Driver/Virtua.php b/module/VuFind/src/VuFind/ILS/Driver/Virtua.php index 483be7d90e2b15f31a3f3a7df01cdcff8978adf7..eb62efdb5960d3fe82df56d635e8b6c139ce36cf 100644 --- a/module/VuFind/src/VuFind/ILS/Driver/Virtua.php +++ b/module/VuFind/src/VuFind/ILS/Driver/Virtua.php @@ -1690,7 +1690,7 @@ class Virtua extends AbstractBase implements \VuFindHttp\HttpServiceAwareInterfa "elementcount" => "1", "function" => "PATRONATTEMPT", "host" => $this->config['Catalog']['host_string'], - "lng" => "en", + "lng" => $this->getConfiguredLanguage(), "login" => "1", "pos" => "1", "rootsearch" => "KEYWORD", @@ -1768,7 +1768,7 @@ class Virtua extends AbstractBase implements \VuFindHttp\HttpServiceAwareInterfa $post_data .= "&search=" . "PATRON"; $post_data .= "&sessionid=" . "$session_id"; $post_data .= "&skin=" . "homepage"; - $post_data .= "&lng=" . "en"; + $post_data .= "&lng=" . $this->getConfiguredLanguage(); $post_data .= "&inst=" . "consortium"; $post_data .= "&conf=" . urlencode("./chameleon.conf"); $post_data .= "&u1=" . "12"; @@ -1852,6 +1852,17 @@ class Virtua extends AbstractBase implements \VuFindHttp\HttpServiceAwareInterfa return "http://{$host}/{$path}/chameleon"; } + /** + * Support method -- determine the language from the configuration. + * + * @return string + */ + protected function getConfiguredLanguage() + { + return isset($this->config['Catalog']['language']) + ? $this->config['Catalog']['language'] : 'en'; + } + /** * Support method -- perform an HTTP request. This will be a GET request unless * either $postParams or $rawPost is set to a non-null value.