GNOME Bugzilla – Bug 692208
Split translated videos into per-locale packages
Last modified: 2018-03-28 13:15:43 UTC
Split translated videos into per-locale packages to decrease the overall package size, which is huge due to video files. More in Shaun's mail: https://mail.gnome.org/archives/gnome-i18n/2013-January/msg00024.html One way we could address this is with language packs of videos. We'd package the translated pages, subtitles and all, in the main package, but split the translated videos into per-locale packages. I just added support for the Mallard Conditionals lang test token[1] to Yelp, which means we could have something like this on the index page: <if:if test="!lang:C action:install" xmlns:if="http://projectmallard.org/if/1.0/";> <p>You can watch these videos in your language if you install a language pack.</p> <p><link action="install:getting-started-cz" style="button">Make it so.</link></p> </if:if> This would only show up in translated versions (more precisely, copies without an xml:lang attribute). Unfortunately, we don't yet have a way to hide it after the package is installed. [1] http://projectmallard.org/if/1.0/tokens.html#lang
Petr asked on IRC about using the right locale in the install link. The default ITS rules for Mallard will put the whole <link> element, attribute and all, into the PO file. So translators can translate it. But translators usually avoid translating the markup bits, I think. So here's a trick to separate the install action and the link text to make translators' lives easier. Add these to the <page> element: xmlns:mal="http://projectmallard.org/1.0/" xmlns:its="http://www.w3.org/2005/11/its" Add this to the <info> element: <its:rules> <its:translateRule selector="//mal:link/@action" translate="yes"/> <its:locNoteRule selector="//mal:link/@action"> <its:locNote>Translate this to install:getting-started-LL, replacing LL with your locale, only if there is a video translation pack for your locale.</its:locNote> </its:locNoteRule> </its:rules> Change the <p> with the link to this: <p><link action="install:getting-started-cz" style="button" its:translate="no"> <span its:translate="yes">Make it so.</span></link></p> Now the PO file generated by itstool should have this: #. (itstool) path: p/link@action #. (itstool) comment: p/link@action #. Translate this to install:getting-started-LL, replacing LL with your #. locale, only if there is a video translation pack for your locale. #: index.page:31 msgid "install:getting-started-cz" msgstr "" #. (itstool) path: link/span #: index.page:32 msgid "Make it so." msgstr "" There would still be an issue with any localizations for which we don't have a video language pack, which I imagine will happen a lot. Probably the best way to deal with that is to manage the conditional on the if:if. So instead of just this: <if:if test="!langC action:install"> We do this: <if:if test="lang:cz action:install, lang:de action:install, ..."> And we add to the list as language packs are verified to exist. But if the language packs are just a distro thing, and not an upstream GNOME thing, this could get really tricky.
Created attachment 235938 [details] [review] index.page patch adding the install button Attaching a patch that adds the install button, per Shaun's comment. Updated RPMs for Fedora rawhide are available at: http://pmkovar.fedorapeople.org/ Result: seems to work as expected when viewing the page via yelp's All Documents with the cs locale. Doesn't seem to work for me when opening the page via terminal.
shaunm recently blogged about this on Planet: http://blogs.gnome.org/shaunm/2013/02/14/mallard-and-video-language-packs/
A koji build for F19 with subpackages is here: http://koji.fedoraproject.org/koji/buildinfo?buildID=406220
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gnome-getting-started-docs/issues/1.