Apache OpenOffice (AOO) Bugzilla – Issue 94435
Spanish "Modern", not possible to provide a spell-checker for it...
Last modified: 2010-02-22 15:32:39 UTC
We appear to have two MS Langids for Spanish as used in Spain. In i18npool/inc/i18npool/lang.h we have... #define LANGUAGE_SPANISH 0x040A and #define LANGUAGE_SPANISH_MODERN 0x0C0A but both are mapped to/from the locale of es_ES in i18npool/source/isolang/isolang.cxx Our list in svtools/source/misc/langtab.src of available languages (as used for selection of what language to assign text to for spellchecking) lists both of these MSLangIds as Spanish (Spain) and Spanish, Modern (Spain). But our spellchecking system works on Locales rather than MSLangIds, and we do a locale to single mslangid mapping in a lot of places, not a locale to multiple mslangids. So as far as I can see e.g. it's not possible to provide a dictionary for this mysterious "Spanish (Modern)" entry in the dictionary/hyphenation/thesauri lists etc. as only the first es_ES match of Spanish (Spain) can be set. Googling around to see if we really needed to do a multi-mapping, I strongly suspect that "Spanish (Modern)" is really "Spanish (Modern Sort)", i.e. See http://www.microsoft.com/globaldev/DrIntl/columns/017/default.mspx#EBH and http://msdn.microsoft.com/en-us/library/aa369771.aspx for where the locale is called "Modern Sort" i.e. it is not a distinct language at all, but a way of specifying whether to use a Traditional or Modern sorting/collation mechanism for Spanish. If that's the case, then it doesn't make much sense to list both languages in most contexts. Perhaps in no contexts at all unless there is some mechanism where this extra piece of info is used to select traditional spanish collation somewhere ? I'd guess that we should map es_ES in isolang.cxx to whichever MSLangId describes the collation that we (icu?) do for Spanish, (I suspect LANGUAGE_SPANISH_MODERN). Drop the other from langtab.cxx as a deprecated MSLangID) and change the strings to just say "Spanish (Spain)" for the remaining entry.
Created attachment 56903 [details] a patch
Here's a quick fix, i.e. if I set some text to "Spanish Modern" and reload the document it turns into Spanish Spain already, so just remove the option in the first place :-)
TL->ER: Can we do something about this one? For a spell checker to distinguish between them it would require different locales. Can this properly be covered by using the variant part of locales as well? TL->CMC: However my first guess would be that this is about the same as with previous German old and German new spelling, and French and French Classic now. That is: there are different dictionary extensions to be provided for each version but both dictionaries will use the same locale. And the user has just to make his choice which one to install. It is planned for the future to have more than one dictionary for the same language and then manually selecting in the UI which one to use. But that would still not allow to have both language variants in use in the same document. (And that was also never the case for German old spelling and German new spelling...)
In this specific case my suspicion is that this originates in an old MS bodge, and both ids only differ by the rules for how to sort strings in the language, and not in any other way like in spelling rules. Sort of the opposite case to that of a locale which has one entry for it, but has alternative new/old dictionaries. I think this one is a locale with two entries for it. Probably best resolved by just removing one from the UI :-)
Problem with removing one entry from the UI language list box is that with imported MS documents the core directly uses the LangID values. If a document used the value we removed, language attribution would display the "Unknown" entry, if any. Either import filters would have to remap the value, or the language list box needed a mechanism to select the entry for LANGUAGE_SPANISH_MODERN whenever LANGUAGE_SPANISH was requested, probably the easiest. Then in isolang.cxx the mapping for LANGUAGE_SPANISH_MODERN should be moved before LANGUAGE_SPANISH. I'll try to get this into cws locales31 => reassigning to spare time account.
In cws locales31: i18npool/inc/i18npool/lang.h 1.12.24.2 i18npool/source/isolang/isolang.cxx 1.16.24.2 i18npool/source/isolang/mslangid.cxx 1.10.24.2 svtools/source/misc/langtab.cxx 1.3.140.1 svtools/source/misc/langtab.src 1.6.140.3 svtools/source/numbers/zforscan.cxx 1.49.140.2 svx/source/dialog/langbox.cxx 1.25.132.1 svx/source/msfilter/countryid.cxx 1.8.242.1 sw/source/filter/ww8/writerwordglue.cxx 1.28.250.1 binfilter/bf_svtools/source/numbers/svt_zforscan.cxx 1.3.38.1 binfilter/bf_sw/source/filter/basflt/sw_fltini.cxx 1.15.32.1 - Renamed define LANGUAGE_SPANISH to LANGUAGE_SPANISH_DATED in lang.h - Changed accordingly in isolang.cxx and moved LANGUAGE_SPANISH_MODERN to be the first Spanish entry. Removed the second entry for LANGUAGE_SPANISH "es" (language only). - Added replacement of LANGUAGE_SPANISH_DATED with LANGUAGE_SPANISH_MODERN in MsLangId::getReplacementForObsoleteLanguage() that now is used in SvtLanguageTable::GetString(), both SvxLanguageBox::InsertLanguage() methods, SvxLanguageBox::SelectLanguage() and SvxLanguageBox::IsLanguageSelected(). - Changed LANGUAGE_SPANISH to LANGUAGE_SPANISH_DATED in places that had switch cases for both, LANGUAGE_SPANISH and LANGUAGE_SPANISH_MODERN. - Introduced #define LANGUAGE_SPANISH LANGUAGE_SPANISH_MODERN for all other places that use it. - Removed "Spanish, Modern (Spain)" from langtab.src
Reassigning to QA for verification.
Verified in CWS locales31
This issue is closed automatically. It should be fixed in a version with is available for longer than half a year (OOo 3.1). If you think this issue isn't fixed in the current version (OOo 3.2) please reopen it. But then please pay attention about the field 'target milestone'. The closure was approved by the Release Status Meeting at 22nd of February 2010 and it is based on the issue handling guideline for fixed/verified issues : http://wiki.services.openoffice.org/wiki/Handle_fixed_verified_issues