Certain OTD documents cause spell checking to be turned off

When I compose a document in Google docs and download it as odt the spell checking that does red lines under the misspelled words is turned off. If I download the same document as docx the spell checking works. ODT documents created on LibreOffice Writer do not have this issue.

I haven’t spent time examining the contents of an odt to see if there are spelling checker controls in the xml. It might be something I need to look at when I get some time to do that.

I’m using LibreOffice 7.3.4.2, specifically the libreoffice-writer-7.3.4.2-4.fc36.x86_64 package.

Do other people see this happening or could it be only on my equipment?

The name of the language is often somewhat different in Google docs so LibreOffice looks for and doesn’t find that dictionary.

Set the language for the document/paragraph/selection to your usual language in LibreOffice

1 Like

Thanks. I checked and it appears that Google Docs uses English (United States) while LibreOffice Writer uses English (USA).

That’s not a difference, just different wording in the UI. What EarnestAl was referring is that GDocs may export only en instead of the correct en-US and technically en doesn’t have a spell-checker because there’s en-US and en-GB different spelling. However, LibreOffice imports the plain en assuming it’s en-US (since some version ago). If you see English (USA) after import then the assignment appears to be correct (otherwise it would be English {en}), but maybe Google just exports the document with spell-checking switched off and you manually need to turn it on.

I have just created a document in GDocs for testing: A doucment to test spelling - Google Docs - if you like, you may check. The strange thing is, it downloaded for me using a “Default” language:

A Google document.odt (7.9 KB)

Thanks for the clarification about the language codes.
I don’t think that spell checking is turned off. While running LibreOffice Writer with the odt document which was exported from Google docs, I use Tools → Language → For all text → English (USA) to change the language setting and that alone causes LibreOffice Writer to start checking spelling properly.

See the attached screenshot of the language of an odt download of a google doc that has not been edited, etc.

So that’s exactly the English {en} that I mentioned. That was tdf#137742 fixed for OOXML documents apparently, but according to your screenshot cheesy Google Docs seems to do the same mistake for ODF .odt documents (if we are really talking about ODF .odt?). We may have to add the same workaround to ODF import. Or rather not. I reopened tdf#144273 for that.

In that case Google Docs wrote styles with fo:language="none" fo:country="none" that seems to lead to the Default, however Writer may handle that, probably as system locale.

1 Like

In styles.xml I don’t see fo:language="none" but I do see fo:language="en" fo:country="none".

How do you determine if a document is ODF or OOXML?

The fo:language="none" was in Mike’s example.

Normally .odt is ODF (the OpenDocument Format standard) and .docx is OOXML (the Microsoft “standard”). ODF has content.xml and styles.xml streams and OOXML does not, and only ODF uses the fo:* attributes. Further you can inspect the XML streams what namespaces they actually declare.

Anyway, fo:language="en" fo:country="none" is bad and it should be fo:country="US" instead.

How do people feel about the idea that when LibreOffice Writer loads a document with a language where spell checking is not supported it displays a dialog (with a don’t show this anymore check box) explaining that spell checking can’t be done without selecting a different language?
The existing behavior of automatic spell checking not working is confusing.

Please do not use the Answer or Suggest a solution field for comments that are not an answer to the original question / solution to the problem, use Comment instead. Thanks.

And no, a dialog whenever encountering a language/locale not supported by currently installed spell-checkers isn’t such a good idea. Normally you also don’t want to change the language to spell-check because checking with a different language spell-checker usually does not make sense. In this case it’s broken because Google Docs writes broken documents.

Summary: Even if you set your language and country globally in your google account, Google docs does not use the specified country for odt downloads. LibreOffice Writer automatic spelling checker needs the country information in the odt file order to work.

There a two work-arounds:

  1. Download docx from Google Docs and load that into LibreOffice Writer, save as odt.
  2. Download odt from Google Docs and then load that into LibreOffice Writer and use Tools → Language → For all text → pick the language and country.

If it did that it would be equally wrong because the user’s country is not related to the language/locale a (part of the) document content is in.

New documents have to default to some country setting. There’s a difference between creating a new document with a global country setting and mangling an uploaded document by applying the global default to it.
I checked and Google sheets has a per-document setting and puts it in the odt. The spell checking issue does not happen to those.

Report the problem to Google please.

Good luck with that. I did use the Google docs app to send feedback which is the most I know how to do but I doubt anyone reads the feedback, they probably run statistical analysis on it to find the most repeated words as they could indicate the biggest issues.

I have been considering running my own NextCloud instance but I have yet to price out VPS. I doubt it would fit on my 1GB Clearfog Pro router and the MochaBIN is not yet in production. The Clearfog Pro only uses 10 W even with a 2 TB USB-3 btrfs RAID-1. It’s the only general-purpose computer I leave on 7x24 in my home. I don’t like consuming excess electricity as the world gets baked.