Hi Mathias,
On Tue, Feb 06, 2007 at 09:19:46PM +0100, Mathias Bauer wrote:
> Christian Lohmaier wrote:
> > 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.
No, not only user experience, but file-fromat-level as well...
> The "document language" the spell checker uses is what I described: the
> language attribute in the default paragraph style.
No, since that can be empty.
If fully agree with the statement that the langauge is a character
format and if it is defined either by hard formatting or inherited by a
character of paragraph style, that language will be used.
But by default the paragraph or character styles don't have a language
property set.
> 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).
Well, then you apparently never used (vanilla) OOo :-)
> >> 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.
No. I'll get
[...]<style:style style:name="Standard" style:family="paragraph"
style:class="text"/>[...]
> >> 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.
Then you're not using the built-in default template, but some other one
that already has the langauge set.
Only if I assign a langauge to the default paragraph stlye, styles.xml
will contain:
[...]
<style:style style:name="Standard" style:family="paragraph"
style:class="text">
<style:text-properties fo:language="it" fo:country="IT"/>
</style:style>[...]
> Did you look on the font tab page in the "modify style" dialog? Or where
> else?
That doesn't count since that always shows values, even when not
assigned in the style, but only inherited, either from another inherited
style of from factory defaults, or from other places in the document.
> Did you check the styles.xml in the document?
Yes, of course.
> How did you create your document?
With vanilla OOo, just create a new doc & save.
> [...]
> > 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. ;-)
I don't really distinguish between documentation and implementation
here.
The wrong documentation (or behaviour) did cost me at least two hours of
useless fiddling around.
> 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.
It is not in the default paragraph-style, but in the general section,
that also contains the default font chosen (since in vanilla docs, this
is also not a property of the default paragraph style).
For the spellcheck-functionality inside OOo, it might look like a
property of the default paragraph style, but on the xml-level it isn't.
(of course you can manually set the property in the style)
ciao
Chrsitan
--
NP: 4Lyn - One 2 Three
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]