Re: ITA freedict
Petter Reinholdtsen <pere@hungry.com> writes:
> If you set LOCPATH to the equivalent of /usr/lib/locale, and LC_ALL to
> the name of the locale you generate, you should get what you want
> without being root. Something like this (mostly cut-n-paste from d-i
> build system):
>
> # The variables
> LOCALE_PATH=/tmp/usr/lib/locale
> LOCALE_NAME=en_IN
> LOCALE_CHARSET=UTF-8
>
> # Generating the locale
> mkdir -p $LOCALE_PATH
> localedef -i "$LOCALE_NAME.$LOCALE_CHARSET" -f "$LOCALE_CHARSET" \
> "$LOCALE_PATH/$LOCALE_NAME.$LOCALE_CHARSET"
>
> # Using the locale
> LOCPATH=$LOCALE_PATH LC_ALL=$LOCALE_NAME.$LOCALE_CHARSET date
Steve Langasek <vorlon@netexpress.net> added:
> Looks like this needs to be localedef -i "$LOCALE_NAME" -f "$LOCALE_CHARSET"
> instead, but otherwise, I've confirmed that this works.
I need to use this locale as a command line argument to dictfmt
--locale. dictfmt calls this locale with setlocale(3). I have tried
--locale $(LOCALE_NAME).$(LOCALE_CHARSET) and --locale
$(LOCPATH)/$(LOCALE_NAME).$(LOCALE_CHARSET). Both return invalid
locale, which is the error message dictfmt emits when it cannot open
the specified locale file. The locale _is_ generated in
$LOCALE_PATH.
Is the environment variable LOCPATH used by setlocale(3)?
Can anyone suggest what I need to try to make this work?
Regards,
Bob
--
_
|_) _ |_ Robert D. Hilliard <hilliard@debian.org>
|_) (_) |_) 1294 S.W. Seagull Way <bob@bobhilliard.net>
Palm City, FL 34990 USA GPG Key ID: 390D6559
Reply to: