Bug 872432

Summary: RFE: support a language variable in the menu_category config file parameter
Product: [Community] Publican Reporter: Ruediger Landmann <r.landmann>
Component: publicanAssignee: Jeff Fearn <jfearn>
Status: CLOSED CURRENTRELEASE QA Contact: tools-bugs <tools-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 3.0CC: rglasz, rlandman, xma
Target Milestone: 3.1   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 3.1.0 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-02-05 22:40:51 EST Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:

Description Ruediger Landmann 2012-11-02 00:10:52 EDT
Description of problem:

Publican uses the value of the "menu_category" config file parameter to create a .desktop file for the desktop-html version of a document. The value of "menu_category" is added to a section of the document's spec file that controls the .desktop file generation.

This works fine as-is, as long as a project intends that all documents in all languages should appear in the same menu, or where people packaging the translated docs know to change the menu_category parameter before they run "publican package".

A language variable would let us set different desktop groups for different languages without having to modify the publican.cfg file at packaging time: for example, English documentation for Foo 123 gets grouped into X-Documentation-Foo-12-en-US while Japanese translations appear in a separate submenu: X-Documentation-Foo-12-ja-JP.

Version-Release number of selected component (if applicable):
Publican 3.0.0

How reproducible:
100%

Steps to Reproduce:
1. Set "menu_category" for a book that has been translated into at least one language
2. package the book in its original language and note the part of the spec file that governs .desktop file creation
3. package the book in the translated language and note the part of the spec file that governs .desktop file creation

Actual results:
Untranslated and translated books would appear in the same menu or submenu

Expected results:
Packagers should have an easy way to specify that documents in different languages should go into separate menus.

Additional info:
Workaround is to manually update the publican.cfg file depending on the language being packaged.
Comment 1 Jeff Fearn 2013-01-08 18:33:11 EST
All strings matching __LANG__ in menu_category will now be replaced with $lang.

The documentation for menu_category needs to be updated with this information.

This fix has been committed to the devel branch for inclusion in Publican 3.1.
Comment 2 xuezhi ma 2013-01-31 22:51:15 EST
Verify version: publican-3.1.0-0.el6eng.noarch  --> PASS

Verify steps:
1. Edit /etc/xdg/menus/documentation.menu, add four categorys, "X-Publican-en-US","X-Publican-ru-RU","X-Publican-zh-CN","X-Publican-fr-FR".
2. edit publican.cfg with menu_category:X-Publican-__LANG__.
3. $publican package --binary --desktop --lang=each long
4. install all rpms

Actual results:
menu_category:X-Publican-__LANG__ can be take as menu_category:X-Publican-${lang}