From 0bb90fdff28ed01bd62ae07d6c334398cb6e2210 Mon Sep 17 00:00:00 2001 From: acli Date: Sun, 29 Feb 2004 07:59:08 +0000 Subject: [PATCH] Backport from HEAD - allow user to specify zh_TW yet get the Chinese templates 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 adc846bff0..1653648b83 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.5