From 1286644ded181eb6452b840d700420003b9aa444 Mon Sep 17 00:00:00 2001 From: acli Date: Tue, 10 Feb 2004 00:43:21 +0000 Subject: [PATCH] This allows the user to type zh_TW and still get Chinese from the zh-TW directory. --- C4/Output.pm | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/C4/Output.pm b/C4/Output.pm index a01ab51c94..2380af9586 100644 --- a/C4/Output.pm +++ b/C4/Output.pm @@ -129,10 +129,14 @@ sub themelanguage { THEME: foreach my $th (@themes) { foreach my $la (@languages) { - if (-e "$htdocs/$th/$la/$tmpl") { - $theme = $th; - $lang = $la; - last THEME; + for (my $pass = 1; $pass <= 2; $pass += 1) { + $la =~ s/([-_])/ $1 eq '-'? '_': '-' /eg if $pass == 2; + if (-e "$htdocs/$th/$la/$tmpl") { + $theme = $th; + $lang = $la; + last THEME; + } + last unless $la =~ /[-_]/; } } } -- 2.39.2