Hello.
Many developers are adding new languages to OpenOffice. Last week I
submitted bug #104249: By opening an .odt file containing such a
language with an "unpatched" OpenOffice version language information
gets lost.
To solve this problem I suggest the following behavior:
I didn't have a look at the code, yet, but I assume it looks like this:
const struct _languages {
const char *iso_code; /* ISO language code */
int microsoft_code; /* Microsoft Office language code */
const char *name; /* User visible name */
} languages[]={
...
{"de-DE",0x407,"Deutsch"},
...
};
I propose to use a variable-size array that is initialized from a
fixed-size array containing the "built-in" languages. Additional
languages may be loaded from a configuration file.
This makes adding new languages that are used only by few people easier
because only the configuration file must be modified (which may be done
by a macro or a GUI).
If you open an .odt file that contains unknown languages code (e.g.
"ay-PE" and "quz-PE" that I used for testing) an invalid Microsoft
language ID (e.g. 0x7FF, 0x7FE, ...) should be chosen and
the following entries should be added temporarily (until OpenOffice is
closed) to the list:
{"ay-PE",0x7FF,"Unknown (ay-PE)"}
{"quz-PE",0x7FE,"Unknown (quz-PE)"}
By opening an MS Office document containing an unknown ID (e.g. 0xABCD)
an invalid ISO code (e.g. "x01-XX") should be chosen and following entry
should be created:
{"x01-XX",0xABCD,"Unknown (0xABCD)"}
This should also be done when the configuration file contains only the
ISO code or only the MS code for one language.
- Then language information is not lost when opening a document
containing unknown languages,
- in the "Format -> Character -> Language" field the language is
displayed ("unknown xxx" instead of "none"),
- any user can add a rare minority language as long as he knows the ISO
code by changing the configuration file.
- However by converting MS Office or RTF to OpenOffice and vice versa
you'll get bad language codes. (Maybe the export filters could be
adapted to write "no language" in the case of conversion.)
Thanks for your reading and feedback.
Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]