[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
More on locale
Hi all,
I found that there is no way that the searching in MV3.14 will work
with the LC_CTYPE setting being done on the fly.
You might get reasonable results if you put 'use locale' in some places
in Search.pm, always just before I compile the search function. I won't
patch MV for distribution because of possible side effects... but here
is a patch against 3.14-3:
*** /home/reference/minivend-3.14-3/lib/Vend/Search.pm Mon Aug 16 08:07:15 1999
--- /tmp/Search.pm Fri Sep 10 06:53:24 1999
***************
*** 591,598 ****
--- 591,600 ----
("coordinate search\ncode is: $code\nfunc is:\n$f")
if ::debug(0x10);
# END DEBUG
+ use locale;
$f = eval $f if $f;
die($@) if $@;
+ no locale;
$code .= <<EOF;
$range_code
$ender
***************
*** 644,649 ****
--- 646,652 ----
return ($f);
}
#::logError("code is $code");
+ use locale;
$limit_sub = eval $code;
die "Bad code: $@" if $@;
return ($limit_sub, $f);
***************
*** 739,744 ****
--- 742,748 ----
if ::debug(0x10);
# END DEBUG
+ use locale;
my $func = eval $code;
die "bad pattern: $@" if $@;
***************
*** 784,789 ****
--- 788,794 ----
if ::debug(0x10);
# END DEBUG
+ use locale;
my $func = eval $code;
die "bad pattern: $@" if $@;
In MiniVend 4, I am integrating and testing this throughout. I have
successfully demonstrated searching for and sorting on different locales;
dynamic [tag time] outputs, and other niceties. It will be controlled by
setting LC_CTYPE, LC_COLLATE, and LC_TIME keys in the MiniVend Locale settings.
So when you do a locale change for the user, all of this will roll through if
you set the appropriate locale:
Locale de_DE LC_CTYPE de_DE
Locale de_DE LC_TIME de_DE
# Example of keeping sorting for a US-specific database
Locale de_DE LC_COLLATE en_US
I haven't decided whether I should test for availability of the locale and
do this automatically; any input is welcome.
--
Mike Heins http://www.minivend.com/ ___
Internet Robotics |_ _|____
131 Willow Lane, Floor 2 | || _ \
It's a little-known fact Oxford, OH 45056 | || |_) |
that the Y1K problem caused <mikeh@minivend.com> |___| _ <
the Dark Ages. -- unknown 513.523.7621 FAX 7501 |_| \_\