Bug 872432 - RFE: support a language variable in the menu_category config file parameter
Summary: RFE: support a language variable in the menu_category config file parameter
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Publican
Classification: Community
Component: publican
Version: 3.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: 3.1
Assignee: Jeff Fearn 🐞
QA Contact: tools-bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-11-02 04:10 UTC by Ruediger Landmann
Modified: 2013-02-06 03:40 UTC (History)
3 users (show)

Fixed In Version: 3.1.0
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-02-06 03:40:51 UTC
Embargoed:


Attachments (Terms of Use)

Description Ruediger Landmann 2012-11-02 04:10:52 UTC
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 23:33:11 UTC
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-02-01 03:51:15 UTC
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}


Note You need to log in before you can comment on or make changes to this bug.