Bug 151154 - Change category "draw" in Template Manager and make it translatable
Summary: Change category "draw" in Template Manager and make it translatable
Status: RESOLVED DUPLICATE of bug 132576
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
7.3.5.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Template-Manager
  Show dependency treegraph
 
Reported: 2022-09-23 21:52 UTC by Rafael Lima
Modified: 2022-09-26 19:13 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Screenshot showing the problem (33.35 KB, image/png)
2022-09-23 21:52 UTC, Rafael Lima
Details
Screenshot showing the problem (in pt-BR) (149.43 KB, image/png)
2022-09-23 22:02 UTC, Rafael Lima
Details
Template Manager categories after patch (144.36 KB, image/png)
2022-09-25 19:21 UTC, Rafael Lima
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rafael Lima 2022-09-23 21:52:11 UTC
Created attachment 182651 [details]
Screenshot showing the problem

In the Template Manager (File - Templates - Manage templates) we have the "Filter by Category" drop-down list.

Opening this list we have one entry that is called "draw" whereas all others have full names. This even causes translation issues, since the "draw" string is untranslatable. See attached image for more details.

The reason "draw" is used is because it is the name of the folder where the template is located, since we do not have a full Category name to map to this folder in:

core/sfx2/inc/doctempl.hrc

and in

core/sfx2/source/doc/doctemplates.cxx

I suggest we use the word "Flowcharts" for this category, since it only contain one template about BPMN flowcharts. And we also need to make this string translatable.

It's a simple fix. We just need to define which word to use.
Comment 1 Rafael Lima 2022-09-23 22:02:37 UTC
Created attachment 182652 [details]
Screenshot showing the problem (in pt-BR)

Here's the screenshot using pt-BR user interface. Notice that the "draw" string is not translated.
Comment 2 Julien Nabet 2022-09-25 08:22:19 UTC
+1 for me but let's ask to experts UI guys! :-)
Comment 3 Laurent Balland 2022-09-25 18:49:18 UTC
I tried to deep in this bug but I was not able to find a solution.

Categories name are defined in TEMPLATE_LONG_NAMES_ARY[]:
https://opengrok.libreoffice.org/xref/core/sfx2/inc/doctempl.hrc?r=144057a5#27
I added a line
+    NC_("TEMPLATE_LONG_NAMES_ARY", "Draw"),

as well as in TEMPLATE_SHORT_NAMES_ARY[]:
https://opengrok.libreoffice.org/xref/core/sfx2/source/doc/doctemplates.cxx?r=91ba9654#483
I added a line at the same position
+    "draw",

In addition, templates directories are declared in directory_ooo.scp
https://opengrok.libreoffice.org/xref/core/scp2/source/ooo/directory_ooo.scp?r=14c7bc1c#602
I added this declaration:
+Directory gid_Dir_Template_Common_Draw
+    ParentID = gid_Dir_Template_Common;
+    DosName = "draw";
+End
+

But all that has no effect :-( I'm still missing something
Comment 4 Rafael Lima 2022-09-25 19:21:41 UTC
Created attachment 182669 [details]
Template Manager categories after patch

(In reply to Laurent BP from comment #3)
> I tried to deep in this bug but I was not able to find a solution.
> 
> Categories name are defined in TEMPLATE_LONG_NAMES_ARY[]:
> https://opengrok.libreoffice.org/xref/core/sfx2/inc/doctempl.
> hrc?r=144057a5#27
> I added a line
> +    NC_("TEMPLATE_LONG_NAMES_ARY", "Draw"),
> 
> as well as in TEMPLATE_SHORT_NAMES_ARY[]:
> https://opengrok.libreoffice.org/xref/core/sfx2/source/doc/doctemplates.
> cxx?r=91ba9654#483
> I added a line at the same position
> +    "draw",

This is exactly what I did. However, for it to take effect you need to be on a clear user profile. You need to either be on safe mode or apply the "Reset settings and user interface modifications" option to see the new category name.

Here's a screenshot I took after applying the patch and resetting the user profile.
Comment 5 Heiko Tietze 2022-09-26 08:28:22 UTC
Of course, upper case and localization is desirable. Some effort was done for bug 132576 in https://gerrit.libreoffice.org/c/core/+/111258 and I suggest to make this ticket a duplicate.

The BPMN template was added with https://gerrit.libreoffice.org/c/core/+/93514.

*** This bug has been marked as a duplicate of bug 132576 ***
Comment 6 Laurent Balland 2022-09-26 19:13:05 UTC
(In reply to Rafael Lima from comment #4)
> This is exactly what I did. However, for it to take effect you need to be on
> a clear user profile. You need to either be on safe mode or apply the "Reset
> settings and user interface modifications" option to see the new category
> name.

You are so right! :-) Thanks, I feel better. I added some comments on your patch.