Bug Hunting Session
Bug 35186 - Headings change language when applied
Summary: Headings change language when applied
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: easyHack, needsDevEval
Depends on:
Blocks: Writer-Styles-Heading Paragraph Writer-UX
  Show dependency treegraph
 
Reported: 2011-03-10 14:44 UTC by Arno Teigseth
Modified: 2018-10-26 09:47 UTC (History)
11 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Arno Teigseth 2011-03-10 14:44:16 UTC
When I write something, select all then Character->set language to Quichua 

and then move up to the line I'd like to be Heading1, press Ctrl+1 and voilà, the Heading now is English(!)

I believe this has something to do with styles, yes. But it's illogical that a text that was some language changes to another language when applying "formatting" (as users would think of it headings)
Comment 1 Yifan Jiang 2011-03-14 23:08:41 UTC
Hi Arno,

As a work around, you could modify the Heading1's language preference by:

F11->Right mouse clicking on Heading1->Modify...->Font (the tab)->Set the language.
Comment 2 Yifan Jiang 2011-03-14 23:11:18 UTC
Hi Cedric, is it a feature or a bug? It's a bit confusing to me as well :) Thanks for reviewing.
Comment 3 Heiko Tietze 2017-09-25 11:02:57 UTC
Definitely yes, headings (and any other styles) must not set the language. But when I try your issue with master it works like this. So could you please retry?

Version: 6.0.0.0.alpha0+
Build ID: ffeb750163909e15ee0dd2d16f8030bf08e66eae
CPU threads: 4; OS: Windows 6.1; UI render: default; 
TinderBox: Win-x86@42, Branch:master, Time: 2017-09-11_06:28:48
Locale: de-DE (de_DE); Calc: group
Comment 4 Yousuf Philips (jay) (retired) 2017-09-25 11:54:16 UTC
Still happens in master. If language is set at the direct formatting level, i assume it shouldnt be overwritten by language set at the style level.

Version: 6.0.0.0.alpha0+
Build ID: 7315f325ff7ada3d6bd85a471058fdaeaff8cdb0
CPU threads: 2; OS: Linux 4.4; UI render: default; VCL: gtk2; 
TinderBox: Linux-rpm_deb-x86_64@70-TDF, Branch:master, Time: 2017-09-17_06:58:21
Locale: en-US (en_US.UTF-8); Calc: group
Comment 5 Heiko Tietze 2017-09-25 12:02:15 UTC
True, still relevant. Direct formatting at "Tools > Language > For selection" is reverted with H1, for example. Is this an easy hack, Shinnok?
Comment 6 Thomas Lendo 2017-09-25 12:39:48 UTC
(In reply to Heiko Tietze from comment #5)
> True, still relevant. Direct formatting at "Tools > Language > For
> selection" is reverted with H1, for example.
I don't understand why this is a bug. Other direct formatting will also be reverted/overwritten by style attributes. If you have a string that is red and bold and language is Russian (all 3 attributes are direct formatted without styles) and you apply this string to "Heading 1" or to "Text Body" or whatever you want, these direct formatting attributes will be overwritten by the applied style. The attributes red, bold and Russian language are lost.

The issue here is: If the user don't work with styles or know anything about styles, how can she apply a heading without styles? Because in all styles a language is set--at least in "Default Style" paragraph style. The issue her is, that you can't have a heading without using styles but you can normal text without  using styles which is inconsistent for only direct formatting users.
Comment 7 Heiko Tietze 2017-09-26 15:24:06 UTC
(In reply to Thomas Lendo from comment #6)
> The issue here is: If the user don't work with styles or know anything about
> styles, how can she apply a heading without styles? Because in all styles a
> language is set--at least in "Default Style" paragraph style.

Exactly. The simple solution is to remove the language property from the default style.
Comment 8 Thomas Lendo 2017-10-08 21:28:43 UTC
(In reply to Heiko Tietze from comment #7)
> Exactly. The simple solution is to remove the language property from the
> default style.
I see a massive problem for people only using styles when the language property is removed. How do you add language information in styles then? And what's ODF spec saying about it?
Comment 9 Heiko Tietze 2017-10-08 21:34:07 UTC
(In reply to Thomas Lendo from comment #8)
> I see a massive problem for people only using styles when the language
> property is removed. How do you add language information in styles then? And
> what's ODF spec saying about it?

Didn't mean to change the format but just leave out the definition of the language. Thought of some kind of "none", not sure if that is possible.
Comment 10 Yousuf Philips (jay) (retired) 2017-10-09 17:16:37 UTC
(In reply to Heiko Tietze from comment #7)
> Exactly. The simple solution is to remove the language property from the
> default style.

Not sure that is even an option. The correct solution is the direct formatting language property shouldnt be overwritten by style-level language property.

Maxim, Stuart, Cor, Regina: what is your take?
Comment 11 Regina Henschel 2017-10-09 19:57:55 UTC
If you select all and then set a language, this is not applied as hard character formatting but as hard paragraph formatting. If you would really apply a hard character formatting, that would be retained when applying Heading 1. You can test this, if you set the language for a single word in the paragraph.

Currently no way exists to remove a hard paragraph formatting other than applying a paragraph style. For example apply Heading 1, then go to Format > Paragraph and set a yellow background. Now try to remove the yellow background.

The predefined "Default style", "Heading" or "Heading 1" paragraph styles do not contain any language setting. The language is taken from the used template, or if no template is used, from the setting in Tools > Options > Language Settings > Languages.

You cannot remove the language from paragraph styles, because it is there in ODF and you always need it as the default language for the text in the paragraph.

The part "select all then Character->set language to Quichua" in the initial post is a unsuitable method. Correct methods are
A) In Tools > Options > Language Settings > Languages set 'Quichua' and mark 'For the current document only'. Then the setting goes to the <style:default-style> element in the file. A different way to the same setting is menu Tools > Language > For All Text > More...
B) Modify the paragraph style "Default Style" to 'Quichua'. The other paragraph styles will inherit it because of the hierarchy. This setting goes to the paragraph style with name "Standard" in the file.

Setting language "None" does not mean, that the language property is removed from the paragraph style, but to the contrary it means that the paragraph style gets an explicit language property set. "None" means, that spellchecking, hyphenation and other language dependent features are disabled.

For me a solution is not to change the existing features, but to invent a UI, that makes it easier to use a suitable method for changing the language of a single document.
Comment 12 Thomas Lendo 2017-10-11 13:09:20 UTC
Regina: Thanks for your clarification.

If not using styles, a paragraph's language can only be changed by hard character formatting (character dialog or language selector in status bar) as the paragraph dialog has no possibility to change the language. Right?

So the character dialog seems to be the wrong way to change the language of a paragraph or the whole document as it's not set as character property in xml. If somebody wants to do that, a warning could be shown near the language setting in the character dialog or the language setting is grayed out with a link to a new language dialog where you can set the language for a paragraph and/or the whole document in a "hard formatting" way without styles.

In this new dialog, a language change for the whole document is changing the "default language for document" properties (Western, Asian, complex) for this document in the options dialog. No Benjamin is finding this options dialog settings, so maybe in "Format > Language" a new dialog can be made to do this.

Or this new dialog could be a new tab in the paragraph dialog -- what I wouldn't do if the dialog contains not only the paragraph language property but also a way to change the document's language.

Here a mockup for a language dialog:
---------------------------------------------------
| Set language for:                               |
| o Selected Paragraph   o Current Document       |
|                                                 |
| Western:               [... drop-down menu ...] |
| [] Asian:              [... drop-down menu ...] |
| [] Complex ext layout: [... drop-down menu ...] |
|                                                 |
| Help                      OK    Cancel    Reset |
--------------------------------------------------

PS: "Selected paragraph" means that the language of a paragraph is changed where the mouse cursor is positioned in (no full selection of text/phrase/paragraph necessary).

PPS: In MS Word 2013 I only found the status bar language selector and a language dialog in the paragraph styles to change text language -- both can be reset to default by the "remove all style formattings" command in the styles sidebar.
Comment 13 Yousuf Philips (jay) (retired) 2017-10-18 13:06:16 UTC
(In reply to Regina Henschel from comment #11)
> If you select all and then set a language, this is not applied as hard
> character formatting but as hard paragraph formatting. If you would really
> apply a hard character formatting, that would be retained when applying
> Heading 1. You can test this, if you set the language for a single word in
> the paragraph.

Then likely the paragraph dialog should also have the language comboboxes found in the Character dialog to be able to change this at the hard paragraph level, just like we do so in the statusbar and Tools > Language > For Paragraph. It can be put in the alignment tab, as text direction is also there, and Tools > Language > For Paragraph > More... could open the paragraph dialog instead of the character dialog.

> Currently no way exists to remove a hard paragraph formatting other than
> applying a paragraph style. For example apply Heading 1, then go to Format >
> Paragraph and set a yellow background. Now try to remove the yellow
> background.

I could remove it just the same way as i added it, setting background fill to None from Color.

> For me a solution is not to change the existing features, but to invent a
> UI, that makes it easier to use a suitable method for changing the language
> of a single document.

I think the two means that you mentioned (Tools > Language > For All text and Default paragraph style) are more than sufficient means to do so.
Comment 14 Thomas Lendo 2017-11-10 11:35:24 UTC
(In reply to Yousuf Philips (jay) from comment #13)
> (In reply to Regina Henschel from comment #11)
> > If you select all and then set a language, this is not applied as hard
> > character formatting but as hard paragraph formatting.
> Then likely the paragraph dialog should also have the language comboboxes
> found in the Character dialog to be able to change this at the hard
> paragraph level, just like we do so in the statusbar and Tools > Language >
> For Paragraph. It can be put in the alignment tab, as text direction is also
> there, and Tools > Language > For Paragraph > More... could open the
> paragraph dialog instead of the character dialog.
I support this idea. This would unify the behavior of styles/properties and the statusbar. If language is a property of a paragraph in ODF, then this should be reflected in the paragraph dialog. Also with this solution we avoid a new dialog or workflow.
Comment 15 saran.chava143 2018-01-14 05:36:12 UTC
Hello!Can someone please explain me about this bug?
Comment 16 Cor Nouws 2018-02-08 13:26:17 UTC
(In reply to saran.chava143 from comment #15)
> Hello!Can someone please explain me about this bug?

ehh, saran.chaval: the comments in this issue should explain it :)
Or: what information are you looking for? what is it that you do not understand?
Comment 17 Cor Nouws 2018-10-17 19:05:03 UTC
(In reply to Thomas Lendo from comment #14)
> (In reply to Yousuf Philips (jay) from comment #13)
> > (In reply to Regina Henschel from comment #11)
> > > If you select all and then set a language, this is not applied as hard
> > > character formatting but as hard paragraph formatting.
> > Then likely the paragraph dialog should also have the language comboboxes
> > found in the Character dialog to be able to change this at the hard
> > paragraph level, just like we do so in the statusbar and Tools > Language >
> > For Paragraph. It can be put in the alignment tab, as text direction is also
> > there, and Tools > Language > For Paragraph > More... could open the
> > paragraph dialog instead of the character dialog.
> I support this idea. This would unify the behavior of styles/properties and
> the statusbar. If language is a property of a paragraph in ODF, then this
> should be reflected in the paragraph dialog. Also with this solution we
> avoid a new dialog or workflow.

One can set language for text parts. The case described, the language is set at paragraph level. I guess to keep the xml file clean. After all the language applied in the example it is direct formatting.

The current behavior looks consistent to me.
If you make a random paragraph italic, then apply Heading 1 (that happens not to be italic), then the result will be roman, not italic.

For me this is a WFM. And I see support from Regina Henschel in comment #11:

> For me a solution is not to change the existing features, but to invent a
> UI, that makes it easier to use a suitable method for changing the language
> of a single document.

@heiko: has this been discussed in UX? Or better ask: can we look at it (again) ?
Comment 18 Heiko Tietze 2018-10-26 09:47:01 UTC
(In reply to Cor Nouws from comment #17)
> For me this is a WFM. And I see support from Regina Henschel in comment #11:
> ...
> @heiko: has this been discussed in UX? Or better ask: can we look at it
> (again) ?

Sure, let's close this ticket as WFM and start with Jay's idea in bug 120932.