Jean-Marc Lasgouttes wrote:

>>>>>> "Angus" == Angus Leeming <[EMAIL PROTECTED]>
>>>>>> writes:
> 
> Angus> ...is used, of course, to control l10n of the UI. (How about
> Angus> that for jargon!) Trouble is, it's not very intuitive to
> Angus> Windows users. I wonder if it would not be good to have a
> Angus> LyXRC::ui_language variable and get LyX to set LANG if it isn't
> Angus> empty:
> 
> What we should really do is query the language from windows and just
> use that. That cannot be so difficult to achieve...

Hmmm. Having tried out my idea (patch attached) I think you're right. The
patch has no effect because gettext_init is called so early --- way before
the lyxrc files are parsed.

> The main problem of course is that windows has different names for
> these locales. Is locale.alias installed currently in the locale/
> directory? Would that help to have it?

$ ls /mnt/windowsC/Program\ Files/LyX/Resources/locale
da  de  es  eu  fi  fr  it  locale.alias  nl  nn  no  pl  ro  ru  sk  sl 
tr

I attach this file also. How is it meant to be used?

> [later...]
> 
> I searched the web to find references on using gettext with win32 api,
> and I have to say I found nothing. Aren't there other unix apps that
> use gettext and got ported to windows?

You didn't look in the right place, obviously. google for "gettext
windows":

http://gnuwin32.sourceforge.net/install.html#Native-language_support_

Native-language support

Most GNU packages have the ability to output messages in several languages.
This native-language support (NLS) requires the LibIntl and the LibIconv
libraries. On MS-Windows they have been adapted so that NLS chooses the
system language, unless one of the environment variables LANG or LANGUAGE
has been set. The language codes (ISO 639) for these environment variables
are different from the MS-Windows ones. When using a program in a console
window (command.com or cmd.exe) and setting LANG or LANGUAGE, you must
also set the correct code page with the chcp command; for European
languages, code page 1252 usually suffices.

I read that as saying that the UI should just work. We shouldn't need to
set LANG. Hmmmmm. I wonder if this gnuwin32 behaviour is different to
MinSYS's and whose version of libIntl, LibIconv I have installed?

-- 
Angus
# Locale name alias data base.
# Copyright (C) 1996,1997,1998,1999,2000,2001 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU Library General Public License as published
# by the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Library General Public License for more details.
#
# You should have received a copy of the GNU Library General Public
# License along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
# USA.

# The format of this file is the same as for the corresponding file of
# the X Window System, which normally can be found in
#       /usr/lib/X11/locale/locale.alias
# A single line contains two fields: an alias and a substitution value.
# All entries are case independent.

# Note: This file is far from being complete.  If you have a value for
# your own site which you think might be useful for others too, share
# it with the rest of us.  Send it using the `glibcbug' script to
# [EMAIL PROTECTED]

# Packages using this file: lyx 

bokmal          no_NO.ISO-8859-1
bokm�l          no_NO.ISO-8859-1
catalan         ca_ES.ISO-8859-1
croatian        hr_HR.ISO-8859-2
czech           cs_CZ.ISO-8859-2
danish          da_DK.ISO-8859-1
dansk           da_DK.ISO-8859-1
deutsch         de_DE.ISO-8859-1
dutch           nl_NL.ISO-8859-1
eesti           et_EE.ISO-8859-1
estonian        et_EE.ISO-8859-1
finnish         fi_FI.ISO-8859-1
fran�ais        fr_FR.ISO-8859-1
french          fr_FR.ISO-8859-1
galego          gl_ES.ISO-8859-1
galician        gl_ES.ISO-8859-1
german          de_DE.ISO-8859-1
greek           el_GR.ISO-8859-7
hebrew          he_IL.ISO-8859-8
hrvatski        hr_HR.ISO-8859-2
hungarian       hu_HU.ISO-8859-2
icelandic       is_IS.ISO-8859-1
italian         it_IT.ISO-8859-1
japanese        ja_JP.eucJP
japanese.euc    ja_JP.eucJP
ja_JP           ja_JP.eucJP
ja_JP.ujis      ja_JP.eucJP
japanese.sjis   ja_JP.SJIS
korean          ko_KR.eucKR
korean.euc      ko_KR.eucKR
ko_KR           ko_KR.eucKR
lithuanian      lt_LT.ISO-8859-13
nb_NO           no_NO.ISO-8859-1
nb_NO.ISO-8859-1 no_NO.ISO-8859-1
norwegian       no_NO.ISO-8859-1
nynorsk         nn_NO.ISO-8859-1
polish          pl_PL.ISO-8859-2
portuguese      pt_PT.ISO-8859-1
romanian        ro_RO.ISO-8859-2
russian         ru_RU.ISO-8859-5
slovak          sk_SK.ISO-8859-2
slovene         sl_SI.ISO-8859-2
slovenian       sl_SI.ISO-8859-2
spanish         es_ES.ISO-8859-1
swedish         sv_SE.ISO-8859-1
thai            th_TH.TIS-620
turkish         tr_TR.ISO-8859-9

Attachment: ui_language_13x.diff.bz2
Description: BZip2 compressed data

Reply via email to