From c355c625f9bab93e550e9e91748f2fa9337a1b81 Mon Sep 17 00:00:00 2001 From: Olli-Antti Kivilahti Date: Thu, 29 Oct 2015 15:40:50 +0200 Subject: [PATCH] Bug 15080 - ./translate tool should tell if xgettext executable is missing Just upgraded our Koha container to 14.04 and noticing the misc/translator/translate doesn't work. This is because of a missing package gettext. This patch makes ./translate die with a helpful suggestion to install gettext if xgettext-program is missing. Signed-off-by: Frederic Demians I can reproduce the bug by desinstalling 'gettext' package on a Debian box. I confirm that without this patch, 'translate' command fails miserably. Suggesting to install gettext package is welcomed. --- misc/translator/LangInstaller.pm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/misc/translator/LangInstaller.pm b/misc/translator/LangInstaller.pm index ad814dd..5244945 100644 --- a/misc/translator/LangInstaller.pm +++ b/misc/translator/LangInstaller.pm @@ -76,6 +76,10 @@ sub new { chomp $self->{xgettext}; chomp $self->{sed}; + unless ($self->{xgettext}) { + die "Missing 'xgettext' executable. Have you installed the gettext package?\n"; + } + # Get all .pref file names opendir my $fh, $self->{path_pref_en}; my @pref_files = grep { /.pref/ } readdir($fh); -- 2.6.2