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 <f.demians@tamil.fr>
  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 <kyle@bywatersolutions.com>

Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>
This commit is contained in:
Olli-Antti Kivilahti 2015-10-29 15:40:50 +02:00 committed by Jesse Weaver
parent 8255e2ec1f
commit 37b0e2ce9c
1 changed files with 4 additions and 0 deletions

View File

@ -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);