Bug 95489 - Character styles applied through the Styles menu does not function in some locales
Summary: Character styles applied through the Styles menu does not function in some lo...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
5.1.0.0.alpha1
Hardware: All All
: medium normal
Assignee: Yousuf Philips (jay)
QA Contact:
URL:
Whiteboard: target:6.0.0 target:5.4.1
Keywords:
Depends on:
Blocks: Writer-Menus Writer-Styles-Character User-Locale
  Show dependency treegraph
 
Reported: 2015-11-01 08:20 UTC by Shinji Enoki
Modified: 2017-09-12 14:46 UTC (History)
8 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 Shinji Enoki 2015-11-01 08:20:05 UTC
"Quotation" style is not applied by menu operation.

1. Start Writer.
2. Enter characters and select it.
3. Select Menu "Styles-Quotation".

It does not function.

Env.
Version: 5.1.0.0.alpha1
Build ID: a8e4f75fe264f6ece37c154951cff53f2f4fa3e4
Locale:ja-JP (ja_JP.utf8)
Debian wheezy
Comment 1 JO3EMC 2015-11-01 08:24:25 UTC
also reproduced in the following environment.

Version: 5.1.0.0.alpha1 (Win_x86)
Build ID: a8e4f75fe264f6ece37c154951cff53f2f4fa3e4
Locale: ja-JP (ja_JP)
Windows 8.1 on 64bit-CPU
Comment 2 Julien Nabet 2015-11-01 18:09:26 UTC
On pc Debian x86-64 with master sources updated today, I don't reproduce this.
When I select "Quotations" style, the text is indented.
Perhaps locale UI dependent?
Comment 3 JO3EMC 2015-11-02 17:30:58 UTC
This problem occurs not with "Quotations" but with "Quotation".
Character Styles.

Also we couldn't apply "Default Caracter" style after other slyles.

It looks not to occur when using interface language "English(USA)" with Locale:ja-JP.
So, maybe language dependent.
Comment 4 Julien Nabet 2015-11-02 20:12:29 UTC
On pc Debian x86-64 with master sources updated yesterday, I don't reproduce this with French UI or Italian UI.
Perhaps I missed something or would it be a specific bug to certain UI locales?
Comment 5 Shinji Enoki 2015-12-06 05:50:57 UTC
I was reproduced in the following versions.

Version: 5.1.0.0.beta2
Build ID: 53054959a12edc6510f51b94ddc9b73d27aedaf6
Locale: ja-JP (ja_JP.UTF-8)
Debian GNU/Linux 8.2 (jessie) x86-64


I don't reproduce in the English version.
Version: 5.1.0.0.beta2
Build ID: 53054959a12edc6510f51b94ddc9b73d27aedaf6
Locale: en-US (ja_JP.UTF-8)
Debian GNU/Linux 8.2 (jessie) x86-64
Comment 6 Niklas Johansson 2016-01-18 09:21:18 UTC
I can reproduce with Swedish localization on Windows. 

The problem seems to appear because the English string was changed from Citation to Quotation at some point but not completely. The internal name is still Citation making the command in the menu work only when the local name of the style is Quotation.

I asked for guidance on the developers list.
Comment 7 Yousuf Philips (jay) 2017-06-07 01:48:24 UTC
@Maxim: Your thoughts on this?
Comment 8 Maxim Monastirsky 2017-06-08 22:57:09 UTC
(In reply to Yousuf Philips (jay) from comment #7)
> @Maxim: Your thoughts on this?
Each built-in style has 2 names. One is "internal" non-localizable name, and another "display" name which can be translated (and some styles have also a third name, i.e. the label we give to style commands in *Commands.xcu). In order to work with all locales, the .uno:StyleApply command should get the internal name. So "Quotation" is the display name, and should be replaced with the internal name which is "Citation".

wrt "Default Style" (comment 3 and Bug 108301 comment 0), Writer seems to return the translatable name also when asking for the internal name. So we need to change that, so it won't return it unless we explicitly ask for the display name.
Comment 9 Yousuf Philips (jay) 2017-06-08 23:22:33 UTC
(In reply to Maxim Monastirsky from comment #8)
> Each built-in style has 2 names. One is "internal" non-localizable name, and
> another "display" name which can be translated (and some styles have also a
> third name, i.e. the label we give to style commands in *Commands.xcu). In
> order to work with all locales, the .uno:StyleApply command should get the
> internal name. So "Quotation" is the display name, and should be replaced
> with the internal name which is "Citation".

So where can i find these internal names so i can correct all of them.

> wrt "Default Style" (comment 3 and Bug 108301 comment 0), Writer seems to
> return the translatable name also when asking for the internal name. So we
> need to change that, so it won't return it unless we explicitly ask for the
> display name.

So i guess i should reopen bug 108301 for that issue right?
Comment 10 Maxim Monastirsky 2017-06-10 19:30:12 UTC
(In reply to Yousuf Philips (jay) from comment #9)
> So where can i find these internal names so i can correct all of them.
The Add commands dialog uses the right names. You can insert a toolbar button, and then look at the xml.

> > wrt "Default Style" (comment 3 and Bug 108301 comment 0), Writer seems to
> > return the translatable name also when asking for the internal name. So we
> > need to change that, so it won't return it unless we explicitly ask for the
> > display name.
> 
> So i guess i should reopen bug 108301 for that issue right?
Currently bug 108301 seems like a mix of different issues with commands, labels etc. I don't mind if we reopen bugs, but each bug needs to be concentrated on a single issue.
Comment 11 Yousuf Philips (jay) 2017-06-11 01:54:15 UTC
(In reply to Maxim Monastirsky from comment #10)
> The Add commands dialog uses the right names. You can insert a toolbar
> button, and then look at the xml.

Roger.

> Currently bug 108301 seems like a mix of different issues with commands,
> labels etc. I don't mind if we reopen bugs, but each bug needs to be
> concentrated on a single issue.

Well Thomas created bug 108449 think that was the issue and you closed it, so please create a new bug with the specific issue that needs to be addressed, as you know best. :D
Comment 12 Yousuf Philips (jay) 2017-06-11 02:10:37 UTC
Patch is in, but wont be able to be backported as it would trigger retranslation.
https://gerrit.libreoffice.org/#/c/38655/
Comment 13 Commit Notification 2017-06-13 13:38:38 UTC
Yousuf Philips committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=90b083bd8e922ec4adf245aedfff14c6c6c01bf6

tdf#95489 use internal name for quotation character style

It will be available in 6.0.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 14 Julien Nabet 2017-06-13 13:52:02 UTC
(In reply to Yousuf Philips (jay) from comment #12)
> Patch is in, but wont be able to be backported as it would trigger
> retranslation.
> https://gerrit.libreoffice.org/#/c/38655/

According to https://wiki.documentfoundation.org/ReleasePlan/5.4, Hard English string & UI freeze is planned next week. Doesn't it mean this patch could be backported to 5.4 branch?
Comment 15 Yousuf Philips (jay) 2017-06-13 22:26:24 UTC
(In reply to Julien Nabet from comment #14)
> According to https://wiki.documentfoundation.org/ReleasePlan/5.4, Hard
> English string & UI freeze is planned next week. Doesn't it mean this patch
> could be backported to 5.4 branch?

Comment 12 was related to 5.3, so yes it will be in 5.4, but had problem backporting it in gerrit, so have to see what is going wrong.
Comment 16 Yousuf Philips (jay) 2017-07-29 16:35:40 UTC
5.4 patch - https://gerrit.libreoffice.org/40552
Comment 17 Commit Notification 2017-08-02 08:41:34 UTC
Yousuf Philips committed a patch related to this issue.
It has been pushed to "libreoffice-5-4":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=9ab228fdd6efe9a7873e3de1bb2357531a79feac&h=libreoffice-5-4

tdf#95489 use internal name for quotation character style

It will be available in 5.4.1.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 18 Commit Notification 2017-09-12 14:22:08 UTC
Yousuf Philips committed a patch related to this issue.
It has been pushed to "libreoffice-5-4":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=bb5a864f3b4aba6e5fb0ec5cc2617d94ab4d9c23&h=libreoffice-5-4

tdf#95489 fix internal name for quotation character style

It will be available in 5.4.2.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 19 Julien Nabet 2017-09-12 14:46:32 UTC
Just simplify targets.