Bug 81808 - Tables inserted in Writer do not adopt the language of the preceding paragraph
Summary: Tables inserted in Writer do not adopt the language of the preceding paragraph
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.2.5.2 release
Hardware: Other All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Writer-Tables-Enhancements
  Show dependency treegraph
 
Reported: 2014-07-27 13:48 UTC by Matthew Francis
Modified: 2019-01-29 08:48 UTC (History)
5 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 Matthew Francis 2014-07-27 13:48:50 UTC
When a table is inserted in Writer, the cell contents take the default (language pack) language rather than the language of the surrounding text

Steps to reproduce
1. In an LO with the en-GB language pack installed, create a new Writer document
2. Select all and set the text to "English (USA)"
3. Create a table

Result
The cells of the table have the language "English (UK)"


I work with documents in (separately) both language settings, and they have to be spellchecked in the correct language. It is contrary to expectation that inserting a table leaves text in a different language setting to the paragraph it was inserted into, even if the said language setting is the global default for LO

Put another way, if I start writing a document in "English (USA)", all text I input should be "English (USA)" unless I explicitly change the language
Comment 1 Bugcruncher 2014-07-29 05:05:37 UTC
There is no property "surrounding text" in LibreOffice.
When you create a new Table, the language for the text simply will follow the language you find in Style (<f11>) for "Table Contents" for "Font".

If you want to write a text in a different language from {Tools  ► Options  ► Language Settings  ► Languages  ► Default Language}, you will have to select the desired language in menu {Tools  ► Language  ► All Text} what will change Font Language in all styles for that document to desired different language.

So I think that this one is not a bug.
Comment 2 Matthew Francis 2014-07-29 08:07:28 UTC
Thank you for your suggestion, which was helpful. However, I believe that there is still an issue. Please allow me to restate slightly

The specific property in question is then not "surrounding text" (which as you say does not exist as a concept), but "previous paragraph".

Two further examples which together show the inconsistency of existing behaviour:

1) If I create a paragraph with style "Heading 1", set the language to "English (USA)", then press the return key to insert a new paragraph, the new paragraph has the style "Text Body", but still has the manually selected language "English (USA)" despite the fact that the new underlying style has the language "English (UK)" selected. Thus, in the general case, manually set attributes are inherited by a following paragraph even when a new style is selected automatically by the style rules.

2) If I set all the text in a paragraph to have font "Wingdings" and language "English (USA)", then insert a table from within the paragraph, the table content also has font "Wingdings", but language "English (UK)". Thus, there is already a mechanism whereby some, though for some reason not all, manually set attributes are inherited by (the paragraphs within) a table.

I would suggest that a manually set language is also an attribute which it is useful for a table to inherit, just as the manually set font is already inherited.
Comment 3 Matthew Francis 2014-08-06 15:49:38 UTC
One further point:
For CJK languages (and possibly CTL languages? although this is beyond my ken), font and language are intimately tied together. For instance, although you can render Japanese in a font optimised for Chinese and vice versa, the result will likely be somewhere on a scale of "just OK" to "looks completely wrong".

If I am writing a document with the default Asian language set to "Japanese", but need to include some text in "Chinese (simplified)", I might for instance set the font for that text to "Hiragino Sans GB" (which is optimised for Chinese (simplified)) and the text language to "Chinese (simplified)".

If I then insert a table at that point, inside the table cells I get the combination of the font "Hiragino Sans GB" and the text language "Japanese", which is nonsensical. Although Writer has gone to the trouble of continuing the font of the previous paragraph, the result doesn't make sense unless the language of the previous paragraph is also copied in together with the font.
Comment 4 Carlos Rodriguez 2015-10-24 22:01:55 UTC
Same behavior on Debian 8:

Version: 5.1.0.0.alpha1+
Build ID: 9a85743766e8a063d20d5f93ee88758e243397f4
TinderBox: Linux-rpm_deb-x86_64@70-TDF, Branch:master, Time: 2015-10-23_00:56:39
Locale: es-ES (es_ES.UTF-8)

Version: 5.0.4.0.0+
Build ID: 356ac58e6ac6d6c37f4aaffe29099994fe118eaf
TinderBox: Linux-rpm_deb-x86_64@46-TDF, Branch:libreoffice-5-0, Time: 2015-10-23_06:36:31
Locale: es-ES (es_ES.UTF-8)

Version: 4.4.7.0.0+
Build ID: 748ff17f7780232729d60ef764b0f2995b887b22
TinderBox: Linux-rpm_deb-x86_64@46-TDF, Branch:libreoffice-4-4, Time: 2015-10-22_15:51:22
Locale: es_ES.UTF-8

As Matthew commented, I should consider inserting a Table with the same language I'm writing on previous paragraph too.