Apache OpenOffice (AOO) Bugzilla – Issue 12831
Word filter should not hardcode default lang when writing
Last modified: 2013-08-07 14:41:36 UTC
$subject says it all. See attached patche.
Created attachment 5344 [details] Patch that uses LongLnaguage for lid in Word
I know, but the problem is that if you do this then some of the field names must be localized for a number of languages, german french english spanish etc otherwise word will not recognize them. Currently the names are in german so we set the document language to german. I tried this before and got burnt when the fields stopped working in word. This makes less difference then you might think because the default language of the default style overrides this for everything else, and that language is set correctly. Nevertheless I agree that its annoying and should be fixed but we need to output the correct languages names of the fields depending on the document language before this oneliner can be put in. I say we finish the 1.1. beta and then do this change and dig out the localized fields names from word and do it properly for 2.0. I believe we only need to handle english, french, german and spanish. Everything else supposedly uses english names for the fields. Or at least word will allow english names in other langauge versions.
resolve later
*** Issue 12239 has been marked as a duplicate of this issue. ***
Created attachment 8726 [details] English Fields
Created attachment 8740 [details] Saved with German Word97
Created attachment 8741 [details] Japanese Word2000
Created attachment 8744 [details] Español Word XP (10) es-MX
Created attachment 8756 [details] Word 2000 - Es - Windows 2000
I suspect that the big three of german, french and spanish are special cases when it comes to fields, so I think I have to have these three sets of field names before I can safely try to save and the "real" language id for the document.
Created attachment 8849 [details] File saved with the french version of word 97
Hmm these examples seem to bear out this knowledge base article: http://support.microsoft.com/default.aspx?scid=kb;en-us;268717 which says that all fields are now in english since word 2000, regardless of the language, and looking at the output of the new localized versions I see that they all have their codepage set to 409, i.e. english to make other older versions happy. Article says "The decision to use a single field name language worldwide was made to allow users of multiple languages to exchange documents more easily. Earlier versions of German, French, and Spanish Word required extensive language detection and field translation routines to allow users of one language version to open documents that were created in a different language version. This was effectively an attempt to localize a programming language where some parts of a string are tokens to be interpreted by the program, which should be translated, and other parts are user-viewable text, which should not be translated. This translation process made it difficult to add new features to the fields object model and could cause awkward results for multilingual users. The new model of using nonlocalized field names is consistent with the model used for Visual Basic for Applications that has existed in Office since version 7.0/95, and for SQL, where the VBA statements, methods, properties, and so on, are in English regardless of the localized language. It allows a more seamless transition between languages, reduces possibilities of errors in translated documents, and gives the users of all international versions of the software a consistent experience. Changing Word 97 Macros to Work in Word 2000 for Any Language: When you open a document that was created in a localized version of Word 97 (for example, French, German, or Spanish Word), Word 2000 changes the names of any fields and field options in the document from the local language to English" So I think I should do the same as what word now does. a) use english field names always on export b) always set the "struct" codepage to 0x409 to make these english names work on every version of word back to the past c) not import and export the "default languages for document" setting at all, seeing as its not equivalent to the codepage feature in word. Word just uses the default "normal" style and when you change its default language, you change the language of the normal style in the normal.dot template.
Created attachment 8859 [details] Saved with Word 97 in Spanish
Reopen to work with this bug
Ok, implemented using english field names the same as word > 2000 does. Don't change the document default language to the same language as the lid id used to track what language the fields are in, as word no longer uses this as it once did.
Done in killarneyfilterteam13 for 2.0
Reopen to reassign
cmc->mru: From killarneyfilterteam13 onwards we should always export english field names to be like word 2000 and upwards. So should test that field export still works when opened in 97 for example.
Checked fix with CWS killarneyfilterteam13.
Verified. Fix will be included in OO 2.0
Fix good in OO 2.0 snapshot src680m13.