From a284baee174d55b8b24e48166da47289da55aca7 Mon Sep 17 00:00:00 2001 From: Marc Balmer Date: Sun, 11 Dec 2011 15:40:55 +0100 Subject: [PATCH] Bail out early if an invalid language is used. Signed-off-by: Marc Balmer http://bugs.koha-community.org/show_bug.cgi?id=7346 Signed-off-by: Paul Poulain (cherry picked from commit d9f7922ad77406939a5f57a22e9a6474e4c328d3) Signed-off-by: Chris Nighswonger --- misc/translator/translate | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/misc/translator/translate b/misc/translator/translate index ebd5ce55bc..90f2950b7a 100755 --- a/misc/translator/translate +++ b/misc/translator/translate @@ -49,6 +49,10 @@ my ($cmd, $lang) = @ARGV; $cmd = lc $cmd; if ( $cmd =~ /create|install|update/ ) { my $installer = LangInstaller->new( $lang, $pref ); + if ( $cmd !~ /create/ && $lang && not $lang ~~ $installer->{langs} ) { + print "Unsupported language: $lang\n"; + exit; + } if ( $all ) { usage() if $cmd eq 'create'; for my $lang ( @{$installer->{langs}} ) { -- 2.39.5