LangpacksDesktopfiles

Revision 5 as of 2005-11-04 15:52:41

Clear message

Summary

Some translatable files do not use gettext at runtime, but rather contain all translations in a single file, like .desktop and .server files. We want to find a robust and generic way to update these translations through Rosetta and language packs.

Rationale

Currently the language packs contain only translations for desktop applications that use gettext. However, there are many more translatable items in Ubuntu. Our goal is to extract all translatable contents from application packages, import them into Rosetta, and ship them into language packs so that they can be updated after a release and benefit from Rosetta updates.

Scope and use cases

  • Sjoerd adds a Dutch translation to a menu entry of a Breezy application in Rosetta. Breezy users should get this new translation with the next language pack update.

Design

There are two ways how to achieve this goal:

Parallel hierarchy

  • pkgstriptranslations will store .desktop and .server files in translation tarballs.
  • Rosetta will export a file that maps .desktop/.server file names to translation domains.
  • langpack-o-matic uses intltool/homebrew script to add new translations to those files.
  • We create a new package desktop-translations which ships files in parallel directory hierarchies /usr/share/applications-langpack/ and /usr/lib/bonobo/servers-langpack/; those files are preferred over the files in the original directory. It only requires very few changes to lookup files into these additional directories. We just have to make sure that the desktop backend that is responsible for that ignores files whose application is not installed.
    • desktop-translations can be updated after the release to provide new desktop files.

Switch to use gettext

The Gnome library that evaluates desktop/server files should just use gettext() to translate entries since application's *.mo files already ship the translations. Therefore we want to propose the extension of the [http://standards.freedesktop.org/desktop-entry-spec/latest/ FreeDesktop standard] to support an additional field TranslationDomain, so that Gnome, KDE, and other implementations can find the matching .mo file at runtime to get additional translations from it. Note that most upstream packages already use gettext to translate .desktop files at build time.

This could require some caching to speed up the process.

Implementation

A proposed domain key is:

X-Gettext-Domain

Code

pyxdg and libgnome-desktop are patched to support gettext:

Data preservation and migration

No data needs to be preserved when adding data to language packs.

Outstanding issues

JorgeBernal: all the .desktop files are going to be in the language-packs? gnome-app-install currently extracts data from packages directly. If all the .desktop files are going to be in the language pack g-a-i can use it. I'm attending to the BOF, but I just wanted to note this to not forget it.

BoF agenda and discussion