Bug 104954 - DOCX Export: Heading Styles are Wrong when Open with MSO 2010 (because of translation conflict of "Heading" and "Title")

Dear All:

I encountered a bug related to docx export and have managed to find a solution for this. The bug is, in some non-english UI, if you apply some paragraphs the "Heading 1" style then save this document as DOCX, when reopen with MSO2010 the heading 1 style is showing as inherit from "Title", which causes all paragraphs of Heading 1 style to be centered in MSO2010.

The workaround of this issue is to change the translation of "Heading" to something different than the localized string for "Title" as shown in MSO2010. For example, in MSO 2010 the style name for "Title" is "标题", although the word "Heading" has the same meaning "标题" in Chinese, I intentionally changed the translation of "Heading" to "标题样式" (meaning "Heading Styles") so that it does not conflict with the Title style in MSO2010.

This may be a bug for MSO2010, not for LibreOffice. However, to make the DOCX files created by LibreOffice showing the correct formating in MSO2010, I suggest all language teams to check whether this issue exists in your language, and if yes, make the changes in pootle accordingly.

See bug https://bugs.documentfoundation.org/show_bug.cgi?id=104954 for more details.

锁琨珑 <suokunlong@126.com> 於 2016年12月29日 週四 下午12:35寫道:

Dear All:

I encountered a bug related to docx export and have managed to find a
solution for this. The bug is, in some non-english UI, if you apply
some paragraphs the "Heading 1" style then save this document as DOCX,
when reopen with MSO2010 the heading 1 style is showing as inherit from
"Title", which causes all paragraphs of Heading 1 style to be centered
in MSO2010.

The workaround of this issue is to change the translation of "Heading"
to something different than the localized string for "Title" as shown in
MSO2010. For example, in MSO 2010 the style name for "Title" is "标题",
although the word "Heading" has the same meaning "标题" in Chinese, I
intentionally changed the translation of "Heading" to "标题样式" (meaning
"Heading Styles") so that it does not conflict with the Title style in
MSO2010.

I don't think translating "Heading 1" from "标题 1" to "标题样式 1" would fix the
problem.

If you check the docx file in MSO2010, "Heading 1" still is "Heading 1"
style, no matter what the translation is.

The problem is that the formatting style of Heading 1 (align to the left)
in docx file exported by LibreOffice would change (center) in MSO2010.

Hi Cheng-Chia, see my reply below:

锁琨珑 <suokunlong@126.com> 於 2016年12月29日 週四 下午12:35寫道:

Dear All:

I encountered a bug related to docx export and have managed to find a
solution for this. The bug is, in some non-english UI, if you apply
some paragraphs the "Heading 1" style then save this document as DOCX,
when reopen with MSO2010 the heading 1 style is showing as inherit from
"Title", which causes all paragraphs of Heading 1 style to be centered
in MSO2010.

The workaround of this issue is to change the translation of "Heading"
to something different than the localized string for "Title" as shown in
MSO2010. For example, in MSO 2010 the style name for "Title" is "标题",
although the word "Heading" has the same meaning "标题" in Chinese, I
intentionally changed the translation of "Heading" to "标题样式" (meaning
"Heading Styles") so that it does not conflict with the Title style in
MSO2010.

I don't think translating "Heading 1" from "标题 1" to "标题样式 1" would fix the
problem.

If you check the docx file in MSO2010, "Heading 1" still is "Heading 1"
style, no matter what the translation is.

The problem is that the formatting style of Heading 1 (align to the left)
in docx file exported by LibreOffice would change (center) in MSO2010.

No, I don't mean to change from "Heading 1" to "标题样式 1", I only mean to change "Heading" to "标题样式". All the translations for the other "Heading N" styles need not be changed. Remember in Writer "Heading N" are all based on "Heading".
I don't know the reason behind this, but this change really solves my problem.
If you look at the docx in MSO2010, before make the changes, "标题 1" is Based On (基于) "Title (标题)", which is wrong. It should be Based On "Heading" in MSO 2010. "Title (标题)" is centered, this caused the heading 1 centered.
After the change the translation of "Heading" to "标题样式", "标题 1" is Based On (基于) "Heading (标题样式)", which is correct.

Dear Kevin,

...
This may be a bug for MSO2010, not for LibreOffice. However, to make the
DOCX files created by LibreOffice showing the correct formating in
MSO2010, I suggest all language teams to check whether this issue exists
in your language, and if yes, make the changes in pootle accordingly.

Thanks a lot for investigating and reporting your solution here.
We don't have the same problem in the Dutch version of LibreOffice.
However I remember an issue where you reported a similar/related problem
with headings.

Regards,
Cor

锁琨珑 <suokunlong@126.com> 於 2016年12月29日 週四 下午2:32寫道:

Hi Cheng-Chia, see my reply below:

> 锁琨珑 <suokunlong@126.com> 於 2016年12月29日 週四 下午12:35寫道:
>
>> Dear All:
>>
>> I encountered a bug related to docx export and have managed to find a
>> solution for this. The bug is, in some non-english UI, if you apply
>> some paragraphs the "Heading 1" style then save this document as DOCX,
>> when reopen with MSO2010 the heading 1 style is showing as inherit from
>> "Title", which causes all paragraphs of Heading 1 style to be centered
>> in MSO2010.
>>
>> The workaround of this issue is to change the translation of "Heading"
>> to something different than the localized string for "Title" as shown in
>> MSO2010. For example, in MSO 2010 the style name for "Title" is "标题",
>> although the word "Heading" has the same meaning "标题" in Chinese, I
>> intentionally changed the translation of "Heading" to "标题样式" (meaning
>> "Heading Styles") so that it does not conflict with the Title style in
>> MSO2010.
>>
> I don't think translating "Heading 1" from "标题 1" to "标题样式 1" would fix
the
> problem.
>
> If you check the docx file in MSO2010, "Heading 1" still is "Heading 1"
> style, no matter what the translation is.
>
> The problem is that the formatting style of Heading 1 (align to the left)
> in docx file exported by LibreOffice would change (center) in MSO2010.
>
No, I don't mean to change from "Heading 1" to "标题样式 1", I only mean to
change "Heading" to "标题样式". All the translations for the other "Heading
N" styles need not be changed. Remember in Writer "Heading N" are all
based on "Heading".

I finally got what you mean! Thanks.

"Heading 1" to "Heading N" all are inherited from the "Heading" style.
However, the localized MSO2010 (e.g. all Chinese variants) use the same
translation "標題" for both "Heading" and "Title."

Thus MSO2010 matches the "Heading" format to "Title" format unexpectedly
and makes all "Heading", "Heading 1" to "Heading N" align to center as
"Title" does.

And you are trying to help MSO2010 match the right "Heading" style instead
of "Title" style by changing the translation of "Heading" style into
something different from "標題".
However, the way to help MSO2010 makes the translation of "Heading" not
consistent with the Heading from"Heading 1" to "Heading N".

That might be a workaround within LibreOffice for increasing
interoperability with MSO2010, but I think that is far more than what we
should do from our position. Plus, you said the problem is a MSO2010-only
problem, not reproducible with MSO 2013 and 2016. Although Chinese
(traditional) is affected as well like Chinese (simplified), I prefer not
to change the translation. After all, it is that localized MSO not picking
the right style because it uses same translation for both "Heading" and
"Title".

于 2016年12月29日 GMT+08:0019:08:32, Cor Nouws <oolst@nouenoff.nl> 写到:

Dear Kevin,

...
This may be a bug for MSO2010, not for LibreOffice. However, to make

the

DOCX files created by LibreOffice showing the correct formating in
MSO2010, I suggest all language teams to check whether this issue

exists

in your language, and if yes, make the changes in pootle accordingly.

Thanks a lot for investigating and reporting your solution here.
We don't have the same problem in the Dutch version of LibreOffice.
However I remember an issue where you reported a similar/related
problem
with headings.

Yes I had reported a similar bug report, But I closed that bug because it became to complex and far away from the solution.

于 2016年12月29日 GMT+08:0019:43:45, Cheng-Chia Tseng <pswo10680@gmail.com> 写到:

锁琨珑 <suokunlong@126.com> 於 2016年12月29日 週四 下午2:32寫道:

Hi Cheng-Chia, see my reply below:

> 锁琨珑 <suokunlong@126.com> 於 2016年12月29日 週四 下午12:35寫道:
>
>> Dear All:
>>
>> I encountered a bug related to docx export and have managed to

find a

>> solution for this. The bug is, in some non-english UI, if you

apply

>> some paragraphs the "Heading 1" style then save this document as

DOCX,

>> when reopen with MSO2010 the heading 1 style is showing as inherit

from

>> "Title", which causes all paragraphs of Heading 1 style to be

centered

>> in MSO2010.
>>
>> The workaround of this issue is to change the translation of

"Heading"

>> to something different than the localized string for "Title" as

shown in

>> MSO2010. For example, in MSO 2010 the style name for "Title" is

"标题",

>> although the word "Heading" has the same meaning "标题" in Chinese,

I

>> intentionally changed the translation of "Heading" to "标题样式"

(meaning

>> "Heading Styles") so that it does not conflict with the Title

style in

>> MSO2010.
>>
> I don't think translating "Heading 1" from "标题 1" to "标题样式 1" would

fix

the
> problem.
>
> If you check the docx file in MSO2010, "Heading 1" still is

"Heading 1"

> style, no matter what the translation is.
>
> The problem is that the formatting style of Heading 1 (align to the

left)

> in docx file exported by LibreOffice would change (center) in

MSO2010.

>
No, I don't mean to change from "Heading 1" to "标题样式 1", I only mean

to

change "Heading" to "标题样式". All the translations for the other

"Heading

N" styles need not be changed. Remember in Writer "Heading N" are all
based on "Heading".

I finally got what you mean! Thanks.

"Heading 1" to "Heading N" all are inherited from the "Heading" style.
However, the localized MSO2010 (e.g. all Chinese variants) use the same
translation "標題" for both "Heading" and "Title."

Thus MSO2010 matches the "Heading" format to "Title" format
unexpectedly
and makes all "Heading", "Heading 1" to "Heading N" align to center as
"Title" does.

And you are trying to help MSO2010 match the right "Heading" style
instead
of "Title" style by changing the translation of "Heading" style into
something different from "標題".
However, the way to help MSO2010 makes the translation of "Heading" not
consistent with the Heading from"Heading 1" to "Heading N".

That might be a workaround within LibreOffice for increasing
interoperability with MSO2010, but I think that is far more than what
we
should do from our position. Plus, you said the problem is a
MSO2010-only
problem, not reproducible with MSO 2013 and 2016. Although Chinese
(traditional) is affected as well like Chinese (simplified), I prefer
not
to change the translation. After all, it is that localized MSO not
picking
the right style because it uses same translation for both "Heading" and
"Title".

As Mark Huang has commented in the bug report, changing the translation is the easiest sulotion: https://bugs.documentfoundation.org/show_bug.cgi?id=104954#add_comment