From 37b0e2ce9cbc4ba5070d22c96b357ddea1db084b 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. Signed-off-by: Kyle M Hall Signed-off-by: Jesse Weaver --- misc/translator/LangInstaller.pm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/misc/translator/LangInstaller.pm b/misc/translator/LangInstaller.pm index ad814dd098..52449454d8 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.39.5