Hi Christian,

Christian Lohmaier wrote:

> Hi Mathias, *,
> 
> On Mon, Feb 05, 2007 at 07:01:54PM +0100, Mathias Bauer wrote:
>> Alamo Vallejo, Joan wrote:
>> 
>> > Is there a way to select the language the document is written in when
>> > you're loading the document? I want to have the right spell checker set
>> > already when the doc is loaded
>> 
>> There is no such thing as a "document language" in OOo.
> 
> Hmm - but how would you explain the setting Tools|Options → Languages →
> Language Settings?
> 
> It has a "default language for documents" settings that can be applied
> to the current document only as well.

That's the "user experience", yes. Here on a developer's list I try to
explain how Writer works internally.

The "document language" the spell checker uses is what I described: the
language attribute in the default paragraph style. Writer does use the
language stored in the metadata (as described by yourself) only as a
fallback if no language is set at the style. And until now I never saw
any document *created by OOo* where the language wasn't set (see below).

> 
>> The language the
>> spell checker uses is a character attribute that (if no setting has been
>> applied by the user) is taken from the default paragraph style.
> 
> Default paragraph style doesn't has a language set by default.

Open a blank new document. Save it and look into the styles.xml. You
will find the language attribute in the default style.

>> So if you load a document it has its "document language" built in - it's
>> the one stored in its default paragraph style.
> 
> No, it's not... (Organize tab of the style doesn't list language
> setting)

Interesting. It *does* here.

Did you look on the font tab page in the "modify style" dialog? Or where
else?
Did you check the styles.xml in the document?
How did you create your document?

While we are at it - I think it would be better to have it exactly as
you described it: even the default style shouldn't have a language set
so that the metadata fallback is used. Unfortunately this isn't how it
is now. I will check this with the team. Language settings are on my
radar ATM.

> I mentioned here recently that the documentation for DocumentInfo
> mentions a Language property that I would have expected to be just that.
> But api is broken and doesn't return that property.
> http://qa.openoffice.org/issues/show_bug.cgi?id=26672

It never returned that property so it isn't broken. Something must have
been fine before it can get broken. ;-)
Of course it's buggy, no question. Perhaps I should raise the target...

> The default language is a <dc:language>en-US</dc:language> property in
> content.xml

But as described this is only the fallback language. We have yet to
check how you managed to get documents without a language attribute in
the default style.

Ciao,
Mathias

-- 
Mathias Bauer (mba) - Project Lead OpenOffice.org Writer
OpenOffice.org Engineering at Sun: http://blogs.sun.com/GullFOSS
Please don't reply to "[EMAIL PROTECTED]".
I use it for the OOo lists and only rarely read other mails sent to it.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to