LocalizedCDImageTools

Revision 7 as of 2011-05-19 09:35:59

Clear message
  • Launchpad Entry: desktop-o-cd-localization

  • Created: 2011-05-18

  • Contributors: Mark Shuttleworth, Didier Roche, Colin Watson, Kyle Nitzsche

  • Packages affected: ubiquity, cdimage, creation of new packages

Summary

Tools and a workflow to provide truly localized CD images. This goes beyond merely installing the right translations, we also want to provide localized default bookmarks, input methods, chat protocols, radio stations, or background images.

Create a set of tools for providing these as ubuntu-l10n-language addon packages (as declarative as possible), and build CD images with this extra customization package. Through this spec, these packages will be referred to as loco packages.

With this, concrete localization projects like desktop-o-qin-ubuntu-china will be a lot easier to implement.

Release Note

To be done when implementation is at beta.

Rationale

Our only action after the user chooses his locale is to install the matching language packs and support (dictionaries, etc.), but true localization goes way beyond that: Locos want to customize default bookmarks, locale specific chat protocols, or preconfigured ibus input method modules. Right now Locos both have to figure out how to customize these settings by themselves, which is not easy and also rather intrusive sometimes. Often these changes can't be preserved during upgrades, and there is only little QA and advertising happening on those images.

By providing an official method for localizing CD images we want to make these Loco efforts both more visible and also much easier to implement. So far we have not made much use of the knowledge that Loco teams have, they are in a much better position than the core developers to know what should be adapted for their region.

This also mitigates the eternal CD size resource conflicts on which language packs to ship on the official CD releases.

User stories

  • Li downloads the "Ubuntu Chinese Edition" from cdimage.ubuntu.com (note that this is only a strawman name, CD mirroring is not part of this spec). gfxboot, ubiquity, and the live session start in Simplified Chinese with the sunpinyin ibus input method ready and active. She opens Firefox and clicks on the "DWNews.com" (note that this is just an example) bookmark in the toolbar, a popular Chinese news site. She opens the chat window and is able to add her QQ account.

  • Didier already has an official Ubuntu 11.10 CD. He chooses "French" in Ubiquity. Since it is connected to the Internet, Ubiquity installs the French specific localization settings automatically. (Note: This might become an option in the UI.)

  • Martin already has a 10.04 LTS installation which he just upgraded to 11.10. In software-center he selects the "Deutsche regionale Anpassungen" package ("German regional adaptions") and ends up with the same localizations than a fresh 11.10 install would have applied.
  • Kyle prepares a customized version of Ubuntu for Compu1337, a large OEM. He prepares a compu1337-default-settings package as a copy of the ubuntu-l10n-template package, sticks in an appropriate background.jpg, and adds it to the project seeds. When booting the generated image, the default desktop background image shows a big Compu1337 logo.

Scope

This specification only deals with the mechanics of declaring, packaging, and shipping localizations. In particular, the following aspects are not covered:

  • CD mirroring/hosting
  • The actual customizations for any particular language.
  • QA for the localized images.

This is also limited to settings which can be customized by just adding an additional loco package (plus its dependencies). In some cases we might modify Ubuntu packages to look in additional data/override files/directories, but we don't support package removal or code changes with this system. If changes of that scope are desired, they need to happen with custom engineering, just as today.

Design

For the initial version, the following default values will get customizable with loco packages:

  • locale and language
  • Keyboard layout
  • Firefox bookmarks
  • Firefox start page
  • Unity launchers
  • Radio stations in Banshee and Rhythmbox
  • Default Firefox search engine
  • Extra packages

Workflow:

  • Install ubuntu-l10n-builder.

  • Run ubuntu-l10n-template fr to generate a skeleton ubuntu-l10n-fr source package. This will have a minimal debian/ directory, some template files, and a README which points to the documentation.

  • The user adds the data as flat files (e. g. firefox/bookmarks.txt or desktop/background.jpg), and runs dch to add a changelog entry.

  • Running dpkg-buildpackage will generate ubuntu-l10n-fr_version_all.deb with the data files shipped in the right locations, and maintainer scripts to set them up.

  • This package can then be uploaded to the Ubuntu archive, or kept in a PPA, as desired.

Implementation

In the following sections, Source is the user-provided file in the loco package source, while Destination is where the loco binary package will ship it.

The ubuntu-l10n-builder package will provide a dh_ubuntu_l10n debhelper program which will install all Source files into their destination location. With this, the logic can be maintained centrally in the ubuntu-l10n-builder source, and the loco packages themselves only require a three-line boilerplate debian/rules. ubuntu-l10n-template will create an appropriate debian/control with the language name in the package description etc. It will also provide a standard debian/copyright with no templating, which the user can customize manually if desired.

locale and language

  • Source: default/locale

  • Destination: /usr/share/ubuntu-l10n-XX/locale

  • Behaviour: postinst snippet which puts it into /etc/default/locale, or updates it if that already exists.

ubuntu-l10n-template pre-creates this file with sensible defaults.

TODO: find out what needs to happen to pre-select language in gfxboot → Colin?

keyboard layout

  • Source: default/keyboard

  • Destination: grep out XKB_{MODEL,LAYOUT,VARIANT,OPTIONS}=... from default/keyboard, put the result into /usr/share/pkgname/keyboard.

  • Behaviour: postinst snippet which puts it into /etc/default/keyboard (wrapped in the standard commentary text), or updates it if that already exists.

ubuntu-l10n-template pre-creates this file with sensible defaults.

TODO: find out what needs to happen to pre-select layout in gfxboot → Colin?

Firefox bookmarks

  • Source: firefox/bookmarks.txt; simple text file, each line has "name URL"

  • Destination: Create and ship a "distribution ini" file for firefox with the bookmarks, which will be appended to the default ones which we already have (Firefox and Ubuntu folders). The precise behaviour of this ini file needs to be researched and tested.

Caveat: Right now these ini file bookmarks do not support favicons. If this is not sufficient or not working, a fallback approach is to create and ship a /usr/lib/firefox/omni-l10n.jar based on the standard /usr/lib/firefox-4.0.1/omni.jar and change firefox to prefer using the former if present.

ubuntu-l10n-template pre-creates this file with just a comment about the format.

Firefox start page

  • Source: firefox/startpage.txt; simple text file with just the URL

  • Destination: Create and ship a "distribution ini" file for firefox with the browser.startup.homepage preference set to that value.

ubuntu-l10n-template pre-creates this file with just a comment with an example.

Default Firefox search engine

  • Source: firefox/defaultsearch.txt; simple text file with just the search engine name (e. g. Google)

  • Destination: Create and ship a "distribution ini" file for firefox with the browser.search.defaultenginename preference set to that value.

ubuntu-l10n-template pre-creates this file with just a comment with some examples (Google, Wikipedia)

Note that the available search engines live in Firefox itself (it ships translated locale specific search engines), so if one is missing, we'd need to fix it there for the time being.

Unity launchers

  • Source: unity/launchers.txt; simple text file with one launcher name per line. These correspond to .desktop file names.

  • Destination: Create /usr/share/glib-2.0/schemas/ubuntu-l10n-XX.gschema.override with the current default launcher list of Unity pls launchers.txt appended.

ubuntu-l10n-template pre-creates this file with just a comment about the format and an example.

Radio stations in Banshee and Rhythmbox

  • Source: multimedia/radiostations.txt; text file with one "Name URL" enty per line.

  • Destination: Create /usr/share/glib-2.0/schemas/ubuntu-l10n-XX.gschema.override with the appropriate settings for Rhythmbox and Banshee.

If Banshee doesn't get ported to gsettings, create a gconf schema override instead.

ubuntu-l10n-template pre-creates this file with just a comment about the format and an example.

Extra packages

  • Source: depends.txt, recommends.txt, one dependency per line

  • Destination: debian/control has ${ubuntu-l10n:Depends} and ${ubuntu-l10n:Recommends}. dh_ubuntu_l10n replaces these with the standard language/support packs (from ./check-language-support -l locale) plus depends.txt appended, and builds ${ubuntu-l10n:Recommends} from recommends.txt.

ubuntu-l10n-template pre-creates this file with just a comment about the format and an example.

Test/Demo Plan

To be done when implementation is at beta.

We will provide an ubuntu-l10n-test package with all possible customizations, and provide documentation what the expected result is. This can then be verified in the live system.

Unresolved issues

None at the moment.

References


CategorySpec