From 834017f6e539fd09a153a0a5c2cf1b7cea3862b1 Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Fri, 31 Jul 2015 11:30:26 +0200 Subject: [PATCH] translation: Always use the correct path to the Icinga library in the translation helper refs #9615 --- .../Translation/Util/GettextTranslationHelper.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/modules/translation/library/Translation/Util/GettextTranslationHelper.php b/modules/translation/library/Translation/Util/GettextTranslationHelper.php index c36d54aa2..c3a6d206e 100644 --- a/modules/translation/library/Translation/Util/GettextTranslationHelper.php +++ b/modules/translation/library/Translation/Util/GettextTranslationHelper.php @@ -79,6 +79,13 @@ class GettextTranslationHelper */ private $moduleDir; + /** + * Path to the Icinga library + * + * @var string + */ + protected $libDir; + /** * The path to the file catalog * @@ -110,6 +117,7 @@ class GettextTranslationHelper { $this->moduleMgr = $bootstrap->getModuleManager()->loadEnabledModules(); $this->appDir = $bootstrap->getApplicationDir(); + $this->libDir = $bootstrap->getLibraryDir('Icinga'); $this->locale = $locale; } @@ -396,7 +404,7 @@ class GettextTranslationHelper $this->getSourceFileNames($this->moduleDir, $catalog); } else { $this->getSourceFileNames($this->appDir, $catalog); - $this->getSourceFileNames(realpath($this->appDir . '/../library/Icinga'), $catalog); + $this->getSourceFileNames($this->libDir, $catalog); } } catch (Exception $error) { throw $error;