After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 630053 - Does not use localized values from xslt/gettext/l10n.xml
Does not use localized values from xslt/gettext/l10n.xml
Status: RESOLVED FIXED
Product: yelp
Classification: Applications
Component: XSLT
2.30.x
Other Linux
: Normal normal
: ---
Assigned To: Yelp maintainers
Yelp maintainers
Depends on:
Blocks:
 
 
Reported: 2010-09-19 11:08 UTC by Gabor Kelemen
Modified: 2011-01-10 16:13 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add language attribute to the page element (789 bytes, patch)
2010-12-24 09:42 UTC, Gabor Kelemen
none Details | Review

Description Gabor Kelemen 2010-09-19 11:08:42 UTC
Reported downstream: https://bugs.launchpad.net/ubuntu/+source/yelp/+bug/556683

Yelp does not use the localized values from the /usr/share/xml/gnome/xslt/gettext/l10n.xml file (part of gnome-doc-utils).

To reproduce:
Open Empathy help, on the bottom of the page, you should see "Further Reading" and "See Also" localized.
http://people.ubuntu.com/~milo/yelp-problem.png (on Ubuntu)
http://people.ubuntu.com/~kelemeng/pix/yelp.png (on Fedora 13)

For another example start:
yelp ghelp:user-guide#gosnautilus-28

The Opening Files section of the Gnome User Guide opens, hover over the "file extensions" link, and it will show the tooltip "Read the definition of ´file extension´" - unlocalized. Strangely, this works only on Ubuntu, on Fedora it is not a link, just italic text. 
http://people.ubuntu.com/~kelemeng/pix/Opening%20Files.png

Also, I have to note that localization of <quote> tags seems to work, despite what I said in the Ubuntu bug.
Comment 1 Shaun McCance 2010-12-20 19:00:33 UTC
It looks like our translated Mallard files don't have the xml:lang attribute set, so I guess it's xml2po's fault.
Comment 2 Gabor Kelemen 2010-12-20 19:42:44 UTC
(In reply to comment #1)
> It looks like our translated Mallard files don't have the xml:lang attribute
> set, so I guess it's xml2po's fault.

Indeed, changing the second line of a translated .page file to 
<page xmlns="http://projectmallard.org/1.0/" type="topic" id="introduction" lang="hu">

solves the problem, strings get translated.
Comment 3 Gabor Kelemen 2010-12-24 09:42:30 UTC
Created attachment 176991 [details] [review]
Add language attribute to the page element

I stole some code from the DocBook processing class of xml2po.

Also, I noticed that after generating the help of Orca with this applied, the Previous and Next navigational links on the top of the pages are not translated, while the Further Reading and See Also static texts at the bottom are. Probably another bug.
Comment 4 Shaun McCance 2010-12-24 13:48:34 UTC
Thanks for the patch. You can drop the DocBook-specific comment. And the while loop for root is almost certainly unnecessary, because there's only one root element that getRootElement could possibly get. Finally, for Mallard you should really use the attribute name 'xml:lang' instead of 'lang'.
Comment 5 Gabor Kelemen 2010-12-27 09:45:32 UTC
(In reply to comment #4)
> Finally, for Mallard you should
> really use the attribute name 'xml:lang' instead of 'lang'.

I'm sorry, I have no idea how to do this - I'm more of a translator than anything else, I just wanted to submit a proof of concept patch.