Bug 149332 - Writer choose the wrong language for text I type
Summary: Writer choose the wrong language for text I type
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
3.3.0 release
Hardware: All Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-05-27 11:07 UTC by Francesco
Modified: 2022-06-15 13:46 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments
In the attachment i put all my settings for Windows (418.71 KB, image/png)
2022-05-27 11:16 UTC, Francesco
Details
Adding a Spanish layout for Windows language on Windows 10 (16.65 KB, image/png)
2022-06-14 10:42 UTC, Mike Kaganski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Francesco 2022-05-27 11:07:56 UTC
Description:
I have a document.docx; it is in Italian.
When I start typing, the text is underlined, since it is recognized as Polish.

I suppose the text is recognized as polish because one of the following:
1. in Windows settings, I have Polish regional format;
2. the keyboard I use to write is a Polish keyboard (customized to write also Italian by MsKLC).

[The Windows user interface of the computer is in English, and Region is USA.]

Anyway, when I start to type any word in the document.docx, that word should not be recognized as Polish only because the input keyboard is Polish or the Regional Format is Polish.
The new text typed in a document in Italian should be:
1. Italian (by default, use the language of the rest of the document, and maybe user will change change it manually)
2. deduced by analyzing the words (but I don't trust too much in such AI).

For what I remember, I have similar problem since at least 12 years (with open office), but I never tried to analyze the problem until now, also because I used mostly other Office suites.

Steps to Reproduce:
I suppose you can use other languages instead of the ones i use. I make example with italian and polish
1. your windows system uses the polish keyboard, and Regional Format (date/time format) is Polish
2. create a document.docx. Fill it with Italian text. Ensure the language of the document is Italian so the text is not underlined because a dictionary different than Italian is used. Save.
3. start typing a new line in the document with words in italian, correctly spelled, example: "vi prego di aggiustare questo difetto"


Actual Results:
the new text is underlined, and the paragraph is marked as "Polish" 

Expected Results:
the text is not underlined, since it's correctly spelled italian in an italian document


Reproducible: Always


User Profile Reset: No



Additional Info:
[Information automatically included from LibreOffice]
Locale: en-US
Module: TextDocument
[Information guessed from browser]
OS: Windows (All)
OS is 64bit: no
Comment 1 Francesco 2022-05-27 11:16:19 UTC
Created attachment 180429 [details]
In the attachment i put all my settings for Windows
Comment 2 Mike Kaganski 2022-05-27 12:09:48 UTC
(In reply to Francesco from comment #0)
> 2. the keyboard I use to write is a Polish keyboard (customized to write
> also Italian by MsKLC).

This is *a feature* in LibreOffice, allowing one to have the text get the language defined by system input language. It allows people using several input languages to get the text language automatically, just using their familiar keyboard switch system shortcut (often Shift+Alt or the like). Of course, Windows allows users to have *same* keyboard layouts with *different* input languages ... so for you, you could use that OS feature if you wanted.

But in case you don't want it, you can disable that LibreOffice feature - check "Ignore system input language" under Options->Language Settings->Languages.

Closing NOTABUG.
Comment 3 Francesco 2022-05-27 13:19:39 UTC
This "feature" was driving me crazy.
Isn't better to add the option to disable/enable it in the context menu with languages, the one in the bottom of the window?

Else users will never discover it.
Comment 4 Mike Kaganski 2022-05-27 13:54:33 UTC
(In reply to Francesco from comment #3)

This feature does not cause many problems to users. Most users usually have some reasonably selected input language matching the language they use in writing, so even when they don't change languages, they won't have problems.

The exotic setups like yours is relatively rare; putting options to some prominent places will hurt more, just because (1) it would clutter UI, and (2) users who don't need that would (inadvertently) change it without understanding the complications, and may then (possibly much later, when they already forgot about it) discover that the application misbehaves (compared to their expectations).

The feature is explained in help [1] and in Writer guide [2]. I honestly would recommend anyone who uses multiple languages on writing, to *not* try to disable the feature, but to learn how it could *help* (just define several input languages in system settings, and develop a muscle memory to switch them whenever you switch from Polish to Italian). But indeed, it's up to user to decide - just it doesn't mean it needs to be prominent in the UI.

[1] https://help.libreoffice.org/latest/en-US/text/shared/optionen/01140000.html#bm_id295725
[2] https://documentation.libreoffice.org/assets/Uploads/Documentation/en/WG7.3/WG73-WriterGuide.pdf#page=450
Comment 5 Francesco 2022-05-27 17:38:51 UTC
A general case of mine is *very common*, because often with a keyboard you can write more than one language.
Let's take English as example: if anybody should write a document in English and has Spanish (French, Finnish, Polish, Ungarian ...) keyboard.
In any program (with exception of Writer) (s)he could just start typing, because the *Spanish keyboard includes all English letters* by default.
But not in Writer, because even if the text is in correct english and the document is in English, the text will be underlined.

So you want to force spanish-speaker people to install two layouts if they dont' want that correct text is underlined?
But the user *decided* that the document is in a given language, and set it to *that* language.

Same for all input systems that allow to write more than one language.
They usually can write English with their own keyboards without using an exotic combination as mine.

This feature just bothers most of people who create a document in English (or Italian) with a Spanish/French keyboard.
After your answer i am more convinced that this feature should be removed.

Of course it's not up to me to take the decision, I just want to explain the issue.
Comment 6 Francesco 2022-06-14 07:30:01 UTC
Can this task be reopen considering my comment 5?
It's not a bug but more something as a feature request/change but I wrote bug then, just because I didn't have other better options.

My example: consider an user who starts writing a document in English and has Spanish (French, Finnish, Polish, Ungarian ...) keyboard.
Does (s)he have to install English keyboard, considering that the English alphabet is already included in keyboard of his native language?

Having a double keyboard is always a problem, my example was about a more complex situation, but now i notice the problem is even more common: when a keyboard can write more than one language, the problem starts.
Examples:
* by using most keyboards you can write english
* by using French keyboard you can write Italian
* in Linux, by using most keyboards you can write esperanto

In addition, some languages don't have a keyboard in some OS (for example esperanto in Windows, but also many dialects with a dictionary in Word).

Please understand the problem. Again, maybe it's not a bug, if you can you can change its category, but it should be reopen and considered more seriously.

Dankon/Grazie/Thanks
Comment 7 Mike Kaganski 2022-06-14 08:13:10 UTC
(In reply to Francesco from comment #5)

Sorry, obviously missed this. Replying now.

> A general case of mine is *very common*, because often with a keyboard you
> can write more than one language.
> Let's take English as example: if anybody should write a document in English
> and has Spanish (French, Finnish, Polish, Ungarian ...) keyboard.
> In any program (with exception of Writer) (s)he could just start typing,
> because the *Spanish keyboard includes all English letters* by default.
> But not in Writer, because even if the text is in correct english and the
> document is in English, the text will be underlined.
> 
> So you want to force spanish-speaker people to install two layouts if they
> dont' want that correct text is underlined?

No. You likely missed that you can use *any* keyboard layout with any input language; so if you are OK with Spanish keyboard, just add a new input language (English), *with the same Spanish keyboard layout*, and only change the input language.

> But the user *decided* that the document is in a given language, and set it
> to *that* language.

The feature is exactly to make this "set it to that language" unneeded, because that setting would happen upon input language change automatically. But if the user insists that they prefer to use manual setting, they are free to disable application of system input language.

No, this should not be removed; and there is the configuration for this. This is not a bug. This is closed as such.
Comment 8 Francesco 2022-06-14 10:08:15 UTC
You continue to close this; I don't agree but i don't want to do ping pong.

>you can use *any* keyboard layout with any input language
How? How many people know/can do that? I have a multilingual keyboard but Writer recognize it as "Polish" and underlines in red any word wrote in a different language different than polish. Because according to Writer anything I write using that input keyboard MUST be polish or underlined.


And what about the languages without a keyboard layout? the problem is still present (local languages, or others as Esperanto)

And what about bilingual documents? I get crazy with them.
Comment 9 Mike Kaganski 2022-06-14 10:42:12 UTC
Created attachment 180752 [details]
Adding a Spanish layout for Windows language on Windows 10

(In reply to Francesco from comment #8)
> You continue to close this; I don't agree but i don't want to do ping pong.

Thanks for that.

> >you can use *any* keyboard layout with any input language
> How? How many people know/can do that?

It is an operating system feature. And the operating system documentation is not something to be discussed in LibreOffice bug report. However, *if needed*, we can indeed create some wiki; if you feel it would be good, you are welcome to create such a wiki page.

For instance, on Windows 10, you can add languages in Language Preferences system applet, and there, you "add a keyboard", where you choose the layout you need. See the attachment.

> I have a multilingual keyboard but
> Writer recognize it as "Polish" and underlines in red any word wrote in a
> different language different than polish. Because according to Writer
> anything I write using that input keyboard MUST be polish or underlined.

No, according to Writer, the *keyboard* is irrelevant, but the *input language* matters.

> And what about the languages without a keyboard layout? the problem is still
> present (local languages, or others as Esperanto)

How? The user would want to have *some* existing keyboard layout. Assigning the *wanted* keyboard layout for the language could be possible. And even in case when there is no *input language* like that (note that Esperanto is indeed among the languages list e.g. on Windows), there is the mentioned *setting* to not use the system input language in LibreOffice. The configuration is there in place; the real proportion of users with "local languages" not covered by the existing OS options is definitely less than number of those who are covered, so the default setting as it is now makes perfect sense.

> And what about bilingual documents? I get crazy with them.

The feature is *exactly* for bi- (tri-, ...) lingual document. You set up as many input languages in your system as you want; and then you use the OS key combination to switch the input language (from Spanish to English when you start writing in English; then from English to Spanish, when you switch back) - and Writer does everything to mark the text with the proper language. It only needs the proper input language setup; and note that everyone in the world /except/ for some Roman-language users who use several Roman languages that happen to have a keyboard layout that fits them all may feel it unusual; every Cyrillic, or Asian, or Arabic speaking user would already have the layouts together with input languages set up in the system. For Roman language speakers, the only difference would be that their input languages would share the same layout.
Comment 10 Francesco 2022-06-15 09:07:37 UTC
My comment was about the possibility to have one input language to write different languages.
For example: writing English by using Spanish input language, without need to install a new one and click to change it all the times. Just having one.
I do like that. Writer would force me to click all the time when I change a paragraph:
spanish input language when i wrote in spanish, then if I click on a paragraph that is in english, I have to click close to the watch, choose the english input language, write few words, then when i go back to a spanish paragraph I should again go close to the watch, choose the spanish input, etc. for the whole life.

What i mean, is that Writer should only consider the letters that I write in a document. if the 5 letters "hello" are a correctly-spelled english word, Writer should not care if the 5 letters come from a spanish, italian, albanian (etc. etc. etc.) input language/keyboard layout.
It's not his business, he should only analize the string/letters received in input.
Comment 11 Mike Kaganski 2022-06-15 09:54:24 UTC
(In reply to Francesco from comment #10)

Please: how many times should I repeat that you can just disable the feature in options - as I explained in comment 2 ("you can disable that LibreOffice feature - check "Ignore system input language" under Options->Language Settings->Languages"), comment 7 ("But if the user insists that they prefer to use manual setting, they are free to disable application of system input language"), comment 9 ("there is the mentioned *setting* to not use the system input language in LibreOffice"); comment 4 provided a link to help explaining the option. Disabling this option gives exactly what you repeatedly ask. The reason for its existence, and its default value was explained, too; and even why it shouldn't be more prominent. Could you please explain what else do we discuss at this point?
Comment 12 Francesco 2022-06-15 12:45:45 UTC
Uhm... I also asked to make the option to disable the feature more visible, because people don't know about it.
Eniwey: ap tu yu, teyk ker!
Comment 13 Mike Kaganski 2022-06-15 13:10:06 UTC
(In reply to Mike Kaganski from comment #11)
> and even why it shouldn't be more prominent.

Specifically comment 4 explains that it may have adverse effects when users inadvertently change it, and comment 9 discusses that the enabled state of the feature fits larger part of the population (both users using not only Roman script, and those Roman-script-only users who don't use several languages). And even the Roman-only users can benefit from learning how to use it properly ... but I digress.
Comment 14 Francesco 2022-06-15 13:27:17 UTC
>Specifically comment 4 explains that it may have adverse effects when users inadvertently change it
I don't think so, anyway it's the same for every feature in any program: for example there is a feature that makes text bold and can be inadvertently changed. But since it's visible, the same user can disable if not needed, and anyway (s)he learned how to make text bold (if we suppose this option was not known by that user).

>comment 9 discusses that the enabled state of the feature fits larger part of the population
Any statistics about? People just don't know about that option, and will continue without knowing its existence.

I understand that making more visible the possibility to disable/enable the feature won't be considered.
I don't agree about the reasons, but I see we both would waste time discussing about something that has already been decided and won't be changed.
Thanks for your time and have a nice day.
Comment 15 Mike Kaganski 2022-06-15 13:46:57 UTC
(In reply to Francesco from comment #14)
> but I see we both would waste time
> discussing about something that has already been decided and won't be
> changed.

No, the discussion documents why the decision is taken, and thus it may be challenged later with better arguments.

Thus:

> it's the same for every feature in any program: for
> example there is a feature that makes text bold and can be inadvertently
> changed. But since it's visible, the same user can disable if not needed,
> and anyway (s)he learned how to make text bold (if we suppose this option
> was not known by that user).

This is *not* the same. When user presses a Bold button, the effect is immediately obvious, thus toggling back is easy, and also learning what they did.

In the discussed case, the function is not immediately visible, until you start typing in another language (and it's not granted that it will happen the same day, or even month). So the action will likely *not* result in "(s)he learned how to", and when they see the effects much later, they will have no clue why.