[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Locales names in OOo



Hi Jerome,

On Mon, Sep 02, 2002 at 01:13:58AM +0200, Jerome Warnier wrote:
> As you all know, the problem with OOo not keeping localization settings 
> is now clear (at least to me) :-)
> It is due to OOo's strange handling of locales names.
> I figured out that forcing a translation in /usr/bin/openoffice from 
> "fr_FR" to "fr-FR" solves the problem (cfr my previous e-mails about 
> this problem).

> The problem is that we cannot make such a translation for every single 
> locale name OOo and Debian support.

I've dug around in the source quite a bit trying to work out where things
are going wrong, but I hadn't come to a good conclusion yet which is why I
hadn't reported yet, and am rather busy at the moment.  But I'd better
explain what I've found so far so you don't go down this road too far until
it is certain that this really is a fix.

When digging around, I found locales are defined xml files in
i18pool/source/localedata_ascii.  These are the files in 1.0.1:

af_ZA.xml ca_ES.xml cs_CZ.xml da_DK.xml de_AT.xml de_CH.xml de_DE.xml
de_LI.xml de_LU.xml el_GR.xml en_AU.xml en_BZ.xml en_CA.xml en_CB.xml
en_GB.xml en_IE.xml en_JM.xml en_NZ.xml en_PH.xml en_TT.xml en_US.xml
en_ZA.xml en_ZW.xml es_AR.xml es_BO.xml es_CL.xml es_CO.xml es_CR.xml
es_DO.xml es_EC.xml es_ES.xml es_GT.xml es_HN.xml es_MX.xml es_NI.xml
es_PA.xml es_PE.xml es_PR.xml es_PY.xml es_SV.xml es_UY.xml es_VE.xml
fi_FI.xml fr_BE.xml fr_CA.xml fr_CH.xml fr_FR.xml fr_LU.xml fr_MC.xml
hu_HU.xml id_ID.xml is_IS.xml it_CH.xml it_IT.xml nb_NO.xml nl_BE.xml
nl_NL.xml nn_NO.xml no_NO.xml pl_PL.xml pt_BR.xml pt_PT.xml ru_RU.xml
sv_FI.xml sv_SE.xml tr_TR.xml

Note that there is fr_FR, not fr-FR.

I couldn't find any system library functions that provide answers to
questions such as 'given this locale, what is the name of the language':
nl_langinfo does return some information, but I guess not enough to encode
all the needed language/charset/... information into cross-platform .sx*
files.

Digging around in the OOo source seems to confirm that:  In one or two
source files there are some tables that seem to translate LANG variables
into the internal representation.  For example,
i18pool/source/localedata/localedata.cxx:

[...]
        { "fr_FR",  lcl_DATA_EURO, "fr" },
        { "fr_BE",  lcl_DATA_EURO, NULL },
        { "fr_CA",  lcl_DATA_EURO, NULL },
        { "fr_CH",  lcl_DATA_EURO, NULL },
        { "fr_LU",  lcl_DATA_EURO, NULL },
        { "fr_MC",  lcl_DATA_EURO, NULL },
[...]

I also found some charmap translation tables, too.

So I don't understand why fr-FR fixes your problem, but it doesn't seem to
be the way it was intended to be.  I guess there is some problem with the
locale parsing for fr_FR and fr_BE but I don't know what that is yet.

Chris

Attachment: pgpeFK0bZw84K.pgp
Description: PGP signature


Reply to: