Bug 486162

Summary: publican should generate language in <book>
Product: [Community] Publican Reporter: Muayyad Alsadi <alsadi>
Component: publicanAssignee: Jeff Fearn 🐞 <jfearn>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 1.6CC: jfearn, mmcallis, publican-list, sradvan
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 0.44 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-03-26 22:08:25 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 487075    
Bug Blocks:    
Attachments:
Description Flags
publican common content translation and rtl enabled css
none
publican fedora ar translation
none
screenshot of fedora's selinux user guide
none
New langauge override css
none
Screen shot of styled HTML. none

Description Muayyad Alsadi 2009-02-18 17:39:47 UTC
Description of problem:
the latest upstream docbook-style-xsl has now auto detection for direction from language attribute of the first tag (book/article/...)
https://bugzilla.redhat.com/show_bug.cgi?id=475077

this mean that 

make publish-html-xx-YY

should be injected as <book language="xx-YY"> in the output xml

Version-Release number of selected component (if applicable):
publican-0.40-0.fc10.noarch

How reproducible:
always

Steps to Reproduce:
1. in any document type make publish-html-xx-YY where XX-YY is a language code
  
Actual results:
if it's an rtl language it will be aligned to wrong direction
eg. http://mdious.fedorapeople.org/vieq/DRAFTS/html-single/#chap-Security-Enhanced_Linux-Trademark_Information

Expected results:
language attribute in the generated xml file and proper direction

Comment 1 Murray McAllister 2009-02-25 02:54:02 UTC
"svn co http://svn.fedorahosted.org/svn/selinuxguide/community/trunk/SELinux_User_Guide"

Note: Makefile currently has "OTHER_LANGS = ar-AR" commented out.

Comment 2 Jeff Fearn 🐞 2009-02-25 03:56:07 UTC
I have this change in place, but I can't test it until po2xml is fixed in rawhide.

Comment 3 Jeff Fearn 🐞 2009-03-05 06:15:09 UTC
Please confirm that the attribute to be set is 'language' and not 'lang'.

'language' is not a valid attribute in DocBook and setting that attribute will prevent a book from building as publican will not process input files that are not valid DocBook XML.

Comment 4 Muayyad Alsadi 2009-03-06 12:52:12 UTC
yes, sorry I meant lang

thanks,

Comment 5 Jeff Fearn 🐞 2009-03-09 02:28:21 UTC
Publican now emits lang="xx-YY" to intermediate XML.

This patch will be pushed to rawhide when the translations of the common content are complete.

Comment 6 Muayyad Alsadi 2009-03-09 10:54:04 UTC
could you please point me to the version-release so that I can test it

http://koji.fedoraproject.org/koji/buildinfo?buildID=91336

does not mention anything in %changelog
just the mass rebuild

Comment 7 Jeff Fearn 🐞 2009-03-09 21:27:11 UTC
(In reply to comment #6)
> could you please point me to the version-release so that I can test it
> 
> http://koji.fedoraproject.org/koji/buildinfo?buildID=91336
> 
> does not mention anything in %changelog
> just the mass rebuild  

As I said "This patch will be pushed to rawhide when the translations of the common content are complete.  "

The translations are not complete, so the new package has not been pushed to koji yet.

Comment 8 Muayyad Alsadi 2009-03-10 19:13:05 UTC
if you mean adding ar-AR to
http://svn.fedorahosted.org/svn/publican/trunk/publican-fedora/

I can do the translation

tell me to do that if I'm right

Comment 9 Jeff Fearn 🐞 2009-03-12 06:59:16 UTC
FYI publican 0.44 and publican-fedora 0.18 have been pushed in to koji and built OK. They should get pushed in to rawhide in the next push.

http://koji.fedoraproject.org/koji/buildinfo?buildID=93868
http://koji.fedoraproject.org/koji/buildinfo?buildID=93869

Cheers, Jeff.

Comment 10 Muayyad Alsadi 2009-03-12 19:30:06 UTC
I have done some translations and attached a minor fix to the Arabic css file

could you please apply the attached patches
one on publican and one on publican-fedora

then fix the RTL images in publican by 

mkdir -p content/common/ar-AR/images
for i in stock-go-back.png stock-go-forward.png
do
  convert -flop content/common/en-US/images/"${i}" content/common/ar-AR/images/"${i}"
done

and in publican-fedora by

mkdir -p ar-AR/images
for i in stock-go-back.png stock-go-forward.png
do
  convert -flop en-US/images/"${i}" ar-AR/images/"${i}"
done

Comment 11 Muayyad Alsadi 2009-03-12 19:31:42 UTC
Created attachment 335002 [details]
publican common content translation and rtl enabled css

patch -p1

Comment 12 Muayyad Alsadi 2009-03-12 19:32:17 UTC
Created attachment 335004 [details]
publican fedora ar translation

patch -p1

Comment 13 Muayyad Alsadi 2009-03-12 19:33:06 UTC
Created attachment 335005 [details]
screenshot of fedora's selinux user guide

Comment 14 Jeff Fearn 🐞 2009-03-13 06:04:59 UTC
Created attachment 335058 [details]
New langauge override css

Hi, I applied all the patches except the css patch.

For the css I restructured it to minimise the amount of duplication. Duplicating the content in the brands was enough to make it unmaintainable before, doing that for the languages would be a nightmare.

What I did was :

1: add a new include to default.css to include lang.css
2: make a delta of the changes in common.css to produce lang.css for ar-AR
3: switch next/previous images in lang.css, avoiding manipulating the images.
3: test on SELinux_User_Guide

It looks good to me ... admittedly I can't read the content, but it seems to work correctly, including the next/previous buttons being switched.

Taking this approach really reduces the maintenance overhead, especially when other languages wish to modify things. It also means that all brands automatically get this these fixes for ar-AR since brands do not over ride default.css and as lang.css is included last it will override all other customisations.

Screen shot to follow!

Comment 15 Jeff Fearn 🐞 2009-03-13 06:06:50 UTC
Created attachment 335059 [details]
Screen shot of styled HTML.

Thanks for your patches and translations Muayyad :)

Comment 16 Muayyad Alsadi 2009-03-13 19:09:29 UTC
Great!
nice work and good idea
the screenshot is perfect

but I wonder can't we find a better way to put admonition images [note/warning..etc.] to the right other than background-position

because I set it to be right but it should be right-1em to make a small 1em gap

but of course having 0em padding is better than having them on the left

Comment 17 Fedora Update System 2009-03-18 23:57:09 UTC
publican-fedora-0.18-0.fc10,publican-0.44-0.fc10 has been submitted as an update for Fedora 10.
http://admin.fedoraproject.org/updates/publican-fedora-0.18-0.fc10,publican-0.44-0.fc10

Comment 18 Fedora Update System 2009-03-26 14:53:17 UTC
publican-fedora-0.18-0.fc10, publican-0.44-0.fc10 has been pushed to the Fedora 10 stable repository.  If problems still persist, please make note of it in this bug report.