Index: trunk/gsdl/bin/script/translate.pl
===================================================================
--- trunk/gsdl/bin/script/translate.pl	(revision 5483)
+++ trunk/gsdl/bin/script/translate.pl	(revision 5484)
@@ -186,15 +186,30 @@
 
     my $origtext = $text;
+
     $text =~ s/&(\d{3,4});/chr($1)/ge;
     $text =~ s/&([^;]*);/$rmap{$1}/g;
 
-    # special case for russian images - fonts expect text to be koi8-r encoded
-    if ($language_symbol eq "ru") {
+    # Default font is set by the individual scripts (flash_button-1.2.pl etc), usually lucida
+    my $fontchoice = "";
+
+    # special case for Kazakh images (can also handle Russian) - encode to match Kazakh font
+    if ($language_symbol eq "kz") {  # || $language_symbol eq "ru") {
+	$text = &unicode::unicode2singlebyte(&unicode::utf82unicode($text), "kazakh");
+	$fontchoice = " -foundry 2rebels -fontname \"helv kaz\"";
+    }
+    # special case for Russian images - font is koi8-r encoded
+    elsif ($language_symbol eq "ru") {
 	$text = &unicode::unicode2singlebyte(&unicode::utf82unicode($text), "koi8_r");
-    }
-    # special case for Kazakh images (can also handle Russian) - encode to match Kazakh font
-    elsif ($language_symbol eq "kz") {  # || $language_symbol eq "ru") {
-	$text = &unicode::unicode2singlebyte(&unicode::utf82unicode($text), "kazakh");
-    }
+	$fontchoice = " -foundry cronyx -fontname helvetica";
+    }
+    # special case for Ukrainian images - font is windows_1251 encoded 
+    elsif ($language_symbol eq "uk") {
+	$text = &unicode::unicode2singlebyte(&unicode::utf82unicode($text), "windows_1251");
+	$fontchoice = " -foundry rfx -fontname serene";
+    }
+    # special case for Thai images
+    # elsif ($language_symbol eq "th") {
+	# $text = &unicode::unicode2singlebyte(&unicode::utf82unicode($text), "thai");
+    # }
 
     # edit image macros
@@ -202,19 +217,30 @@
 
     if ($image_type eq "top_nav_button") {
-	
+
 	# generate images
-	my $options = "-text \"$text\" -filenamestem $image_name";
-	# special case for russian images
-	if ($language_symbol eq "ru") {
-	    $options .= " -fontsize 10 -height 20 -whitespace -image_dir $image_dir";
-	    $options .= " -foundry cronyx -fontname helvetica -fontweight bold";
-	}
+	my $options = "-text \"$text\" -filenamestem $image_name -image_dir $image_dir";
+	$options .= " -height 20 -whitespace";
+	$options .= $fontchoice;
+
 	# special case for Kazakh images (can also handle Russian)
-	elsif ($language_symbol eq "kz") {  # || $language_symbol eq "ru") {
-	    $options .= " -fontsize 10 -height 20 -whitespace -image_dir $image_dir";
-	    $options .= " -foundry 2rebels -fontname \"helv kaz\" -fontweight bold";
-	}
+	if ($language_symbol eq "kz") {  # || $language_symbol eq "ru") {
+	    $options .= " -fontsize 10 -fontweight bold";
+	}
+	# special case for Russian images
+	elsif ($language_symbol eq "ru") {
+	    $options .= " -fontsize 10 -fontweight bold";
+	}
+	# special case for Ukrainian images
+	elsif ($language_symbol eq "uk") {
+	    $options .= " -fontsize 10";
+	}
+	# elsif ($language_symbol eq "th") {
+	    # $options .= " -fontsize 30 -fontweight bold";
+	    # $options .= " -foundry 2rebels -fontname \"DB ThaiText\"";
+	    # $options .= " -fontsize 24";
+	    # $options .= " -foundry monotype -fontname \"Courier ProportionalThai\"";
+	# }
 	else {
-	    $options .= " -fontsize 12 -height 20 -whitespace -image_dir $image_dir";
+	    $options .= " -fontsize 12";
 	}
 	`$ENV{'GSDLHOME'}/bin/script/gimp/flash_button-1.2.pl $options`;
@@ -227,28 +253,25 @@
 	
 	# generate on and off images
-	my $options = "-text \"$text\" -filenamestem $image_name";
-	$options .= " -fontsize 17 -height 17 -fixed_width -width 87";
-	$options .= " -image_dir $image_dir";
-	# special case for russian images
-	if ($language_symbol eq "ru") {
-	    $options .= " -foundry cronyx -fontname helvetica";
-	}
-	# special case for Kazakh images (can also handle Russian)
-	elsif ($language_symbol eq "kz") {  # || $language_symbol eq "ru") {
-	    $options .= " -foundry 2rebels -fontname \"helv kaz\"";
-	}
+	my $options = "-text \"$text\" -filenamestem $image_name -image_dir $image_dir";
+	$options .= " -height 17 -fixed_width -width 87";
+	$options .= $fontchoice;
+
+	# special case for Thai images
+	if ($language_symbol eq "th") {
+	    # $options .= " -fontsize 30";
+	    # $options .= " -foundry 2rebels -fontname \"DB ThaiText\" -fontweight bold";
+	    # $options .= " -fontsize 24";
+	    # $options .= " -foundry monotype -fontname \"Courier ProportionalThai\"";
+	}
+	else {
+	    $options .= " -fontsize 17";
+	}
+
 	`$ENV{'GSDLHOME'}/bin/script/gimp/flash_button-1.2.pl $options`;
 
 	# generate green image
-	$options = "-text \"$text\" -filename ${image_name}gr.gif";
-	$options .= " -image_dir $image_dir";
-	# special case for russian images
-	if ($language_symbol eq "ru") {
-            $options .= " -foundry cronyx -fontname helvetica";
-	}
-	# special case for Kazakh images (can also handle Russian)
-	elsif ($language_symbol eq "kz") {  # || $language_symbol eq "ru") {
-	    $options .= " -foundry 2rebels -fontname \"helv kaz\"";
-	}
+	$options = "-text \"$text\" -filename ${image_name}gr.gif -image_dir $image_dir";
+	$options .= $fontchoice;
+
 	`$ENV{'GSDLHOME'}/bin/script/gimp/green_bar-1.2.pl $options`;
 
@@ -260,13 +283,19 @@
 
 	# generate on and off images
-	my $options = "-text \"$text\" -filenamestem $image_name";
-	$options .= " -fixed_width -whitespace -image_dir $image_dir";
-	# special case for russian images
-	if ($language_symbol eq "ru") {
-	    $options .= " -fontsize 8 -foundry cronyx -fontname helvetica";
-	}
+	my $options = "-text \"$text\" -filenamestem $image_name -image_dir $image_dir";
+	$options .= " -fixed_width -whitespace";
+	$options .= $fontchoice;
+
 	# special case for Kazakh images (can also handle Russian)
-	elsif ($language_symbol eq "kz") {  # || $language_symbol eq "ru") {
-	    $options .= " -fontsize 8 -foundry 2rebels -fontname \"helv kaz\"";
+	if ($language_symbol eq "kz") {  # || $language_symbol eq "ru") {
+	    $options .= " -fontsize 8";
+	}
+	# special case for Russian images
+	elsif ($language_symbol eq "ru") {
+	    $options .= " -fontsize 8";
+	}
+	# special case for Ukrainian images
+	elsif ($language_symbol eq "uk") {
+	    $options .= " -fontsize 8";
 	}
 	`$ENV{'GSDLHOME'}/bin/script/gimp/flash_button-1.2.pl $options`;
@@ -300,12 +329,6 @@
 	my $options = "-text \"$text\" -filenamestem yc$image_name -image_dir $image_dir";
 	$options .= " -width 77 -height 26 -fixed_width -whitespace -fontsize 13";
-	# special case for russian images
-	if ($language_symbol eq "ru") {
-	    $options .= " -foundry cronyx -fontname helvetica";
-	}
-	# special case for Kazakh images (can also handle Russian)
-	elsif ($language_symbol eq "kz") {  # || $language_symbol eq "ru") {
-	    $options .= " -foundry 2rebels -fontname \"helv kaz\"";
-	}
+	$options .= $fontchoice;
+
 	`$ENV{'GSDLHOME'}/bin/script/gimp/flash_button-1.2.pl $options`;
 
@@ -314,12 +337,6 @@
 	$options .= " -width 77 -height 26 -fixed_width -whitespace -fontsize 13";
 	$options .= " -bgcolor \"#96c19b\"";
-	# special case for russian images
-	if ($language_symbol eq "ru") {
-	    $options .= " -foundry cronyx -fontname helvetica";
-	}
-	# special case for Kazakh images (can also handle Russian)
-	elsif ($language_symbol eq "kz") {  # || $language_symbol eq "ru") {
-	    $options .= " -foundry 2rebels -fontname \"helv kaz\"";
-	}
+	$options .= $fontchoice;
+
 	`$ENV{'GSDLHOME'}/bin/script/gimp/flash_button-1.2.pl $options`;
 
@@ -328,13 +345,8 @@
 	$options .= " -width 77 -height 26 -fixed_width -whitespace -fontsize 13";
 	$options .= " -bgcolor \"#7E7E7E\" -fontcolor \"#a0a0a0\"";
-	# special case for russian images
-	if ($language_symbol eq "ru") {
-	    $options .= " -foundry cronyx -fontname helvetica";
-	}
-	# special case for Kazakh images (can also handle Russian)
-	elsif ($language_symbol eq "kz") {  # || $language_symbol eq "ru") {
-	    $options .= " -foundry 2rebels -fontname \"helv kaz\"";
-	}
-	`$ENV{'GSDLHOME'}/bin/script/gimp/flash_button-1.2.pl $options`;
+	$options .= $fontchoice;
+
+	`$ENV{'GSDLHOME'}/bin/script/gimp/flash_button-1.2.pl $options`;
+
 	# delete the unused dark image
 	unlink(util::filename_cat($image_dir, "nc$image_name" . "on.gif"));
@@ -344,18 +356,12 @@
 	# generate green bar image (we're assuming these bars are always 537
 	# pixels and are never stretched by excess text
-	my $options = "-text \"$text\" -filename ${image_name}.gif -dont_center";
-	$options .= " -width 537 -width_space 15 -image_dir $image_dir";
-	# special case for russian images
-	if ($language_symbol eq "ru") {
-	    $options .= " -foundry cronyx -fontname helvetica";
-	}
-	# special case for Kazakh images (can also handle Russian)
-	elsif ($language_symbol eq "kz") {  # || $language_symbol eq "ru") {
-	    $options .= " -foundry 2rebels -fontname \"helv kaz\"";
-	}
+	my $options = "-text \"$text\" -filename ${image_name}.gif -image_dir $image_dir";
+	$options .= " -dont_center -width 537 -width_space 15";
+	$options .= $fontchoice;
+
 	`$ENV{'GSDLHOME'}/bin/script/gimp/green_bar-1.2.pl $options`;
 
     } elsif ($image_type eq "green_title") {
-
+	
 	# read the width if it is specified in $image_macros
         my ($width) = $image_macros =~ /_width${image_name}x?_\s*[^\{]*\{(\d+)\}/;
@@ -366,12 +372,6 @@
 	$options .= " -width $width -height 57 -stripe_alignment right -text_alignment right";
 	$options .= " -fontsize 26 -fontweight bold";
-	# special case for russian images
-	if ($language_symbol eq "ru") {
-	    $options .= " -foundry cronyx -fontname helvetica";
-	}
-	# special case for Kazakh images (can also handle Russian)
-	elsif ($language_symbol eq "kz") {  # || $language_symbol eq "ru") {
-	    $options .= " -foundry 2rebels -fontname \"helv kaz\"";
-	}
+        $options .= $fontchoice;
+
 	`$ENV{'GSDLHOME'}/bin/script/gimp/title_icon-1.2.pl $options`;
 
