Enlightenment CVS committal
Author : kwo
Project : e16
Module : e
Dir : e16/e/scripts
Modified Files:
e_gen_menu
Log Message:
Localized menu generation (based on patch by Andreas Volz <[EMAIL PROTECTED]>).
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/scripts/e_gen_menu,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -3 -r1.32 -r1.33
--- e_gen_menu 6 Jun 2004 20:05:09 -0000 1.32
+++ e_gen_menu 13 Jun 2004 20:47:39 -0000 1.33
@@ -43,6 +43,13 @@
$EdirRoot = "$ENV{'EROOT'}";
$EdirBin = "$ENV{'EBIN'}";
+# Localization bits. There may be better ways to do this.
+$Lang = "$ENV{'LANG'}";
+$loc1 = $loc2 = $loc3 = $Lang;
+$loc2 =~ s/[EMAIL PROTECTED]//;
+$loc3 =~ s/_.*//;
+$loc1 = "" if ($loc1 eq $loc2);
+
$EdirUser = "$ENV{'HOME'}/.enlightenment" unless $EdirUser;
$EdirRoot = "/usr/share/enlightenment" unless $EdirRoot;
$EdirBin = "/usr/bin" unless $EdirBin;
@@ -159,6 +166,7 @@
$N++;
$Name = $Exec = $Icon = "";
+ $Nam1 = $Nam2 = $Nam3 = "";
$Cats = shift;
$Type = shift;
@@ -166,6 +174,12 @@
while (<FI>) {
if (/^Name=(.*)$/) {
$Name = $1;
+ } elsif ($loc1 && /^Name\[$loc1\]=(.*)$/) {
+ $Nam1 = $1;
+ } elsif ($loc2 && /^Name\[$loc2\]=(.*)$/) {
+ $Nam2 = $1;
+ } elsif ($loc3 && /^Name\[$loc3\]=(.*)$/) {
+ $Nam3 = $1;
} elsif (/^Exec=(.*)$/) {
$Exec = $1;
} elsif (/^Icon=(.*)$/) {
@@ -182,6 +196,13 @@
last;
}
}
+ if ($Nam1 || $Nam2 || $Nam3) {
+ if ($Nam1) { $Name = $Nam1; }
+ elsif ($Nam2) { $Name = $Nam2; }
+ else { $Name = $Nam3; }
+ $Name = `echo "$Name" | iconv -f UTF-8`;
+ chomp($Name);
+ }
}
close FI;
@@ -227,7 +248,7 @@
local $f;
@l = grep /\.desktop$/, ReadDir($d);
- foreach $f (@l) {
+ foreach $f (@l) {
$f = "$d/$f";
print "- File $f\n" if $dbg ge 2;
ProcessFile("$f", "$dx", "$t");
@@ -248,7 +269,7 @@
next;
}
@d2l = grep !/^\./, ReadDir($d);
- foreach $d2 (@d2l) {
+ foreach $d2 (@d2l) {
print " Subdir: $d/$d2\n" if $dbg ge 1;
next unless -d "$d/$d2";
ProcessDir("$d/$d2", "$d2", "$t");
@@ -282,16 +303,16 @@
return $i;
}
- foreach $d (split(':', $IconDirs)) {
+ foreach $d (split(':', $IconDirs)) {
$i = "$d/$f";
next unless -f $i;
$i = ScaleIcon($i);
return $i;
}
- foreach $d (split(':', $IconDirsKDE)) {
- foreach $t (split(':', $Themes)) {
- foreach $u (split(':', "apps:filesystems:actions")) {
+ foreach $d (split(':', $IconDirsKDE)) {
+ foreach $t (split(':', $Themes)) {
+ foreach $u (split(':', "apps:filesystems:actions")) {
$i = "$d/$t/16x16/$u/$f";
$i = "$i.png" unless ($f =~ /\.png$/);
print "Testing $i\n" if $dbg >= 2;
-------------------------------------------------------
This SF.Net email is sponsored by the new InstallShield X.
>From Windows to Linux, servers to mobile, InstallShield X is the
one installation-authoring solution that does it all. Learn more and
evaluate today! http://www.installshield.com/Dev2Dev/0504
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs