stop shipping static gconf translations, use gettext at runtime

Bug #123025 reported by Martin Pitt on 2007-06-29
Affects Status Importance Assigned to Milestone
cdbs (Ubuntu)
Martin Pitt
gconf (Ubuntu)
Martin Pitt

Bug Description

Binary package hint: gconf2

gconf translations are currently duplicated a lot: First, the .mo files already have them (primary source), then they are in the .schemas file in /usr/share/gconf/schemas/ (24 MB on my system), and finally they are in /var/lib/gconf/defaults/ (one file per language, together ~ 50 MB on my system). We should:

 * Drop the translations in .schemas and and instead put the translation domain into it; this should happen in a cdbs rule, similar to what we did with .desktop and .server files

 * Drop /var/lib/gconf/defaults/%gconf-tree-<lang>.xml entirely and instead have gconftool copy the translation domain to /var/lib/gconf/defaults/%gconf-tree.xml.

 * Have gconftool and gconf-editor use gettext at runtime, using the translation domain given in %gconf-tree.xml.

Martin Pitt (pitti) wrote :

Oh, gconftool and gconf-editor probably just use libgconf2-4, so the translation is likely centralized in gconf_schema_get_{short,long}_desc().

Changed in gconf2:
importance: Undecided → Wishlist
Changed in gconf2:
assignee: nobody → desktop-bugs
status: New → Confirmed
Martin Pitt (pitti) wrote :

The uncompressed 51 MB of /var/lib/gconf/defaults/ compress (with gzip -9) into 4.1 MB (excluding the main index %gconf-tree.xml, which we need to keep in modified form).

/usr/share/gconf/schemas/ compresses into 4.6 MB. It is not easily possible to get exact data how much is covered by translations, but a rough guesstimation is 70%.

So implementing this would give us about 7 MB on the live CD.

Changed in gconf2:
status: Confirmed → Triaged
Martin Pitt (pitti) on 2008-12-17
Changed in gconf2:
assignee: desktop-bugs → pitti
Martin Pitt (pitti) on 2009-01-22
Changed in gconf2:
status: Triaged → In Progress
Martin Pitt (pitti) wrote :

This also needs a corresponding change in our build system, to remove translations and add the gettext domain to .schemas files (similar to the already existing code in for .desktop/.server/.directory files).

Changed in cdbs:
assignee: nobody → pitti
status: New → In Progress
Martin Pitt (pitti) wrote :

Example: nautilus with static translations:

/usr/share/gconf/schemas/apps_nautilus_preferences.schemas size:
original: 1,957,761 bytes
With patched cdbs: 43,430 bytes

(Plus a similar amount of savings in /var/lib/gconf/defaults/*.xml)

Size of nautilus-data.deb:
original: 978,728 bytes
with patched cdbs: 505,334 bytes

Martin Pitt (pitti) wrote :
Changed in cdbs:
status: In Progress → Fix Committed
Martin Pitt (pitti) wrote :

I checked that the gconf patch does not have a measurable performance impact by measuring the time of
GNOME startup (press enter in gdm until panel menu works).

cold cache:
 - upstream gconf, per-lang tree: 76.7 s 75.5 s 75.0 s
 - patched gconf, per-lang tree: 77.1 s 74.8 s 74.9 s

hot cache:
 - upstream gconf, per-lang tree: 28.0 s 28.1 s 28.1 s
 - patched gconf, per-lang tree: 28.0 s 28.3 s 28.1 s

In theory, with a completely converted *.schemas tree, startup time should be faster, since gconfd-2 does not have to load and parse all the translated xml files any more. Getting descriptions is a relatively seldom operation and not needed at all for startup. If an application needs translations of its own gconf keys, its .mo file should already be loaded, thus the performance impact for this should be negligible.

The only real performance impact that will probably happen is with gconf-editor, where you need lots of translations for many different keys. But first I don't expect this to actually be noticeable by users, and second this is well worth paying this price in exchange for the general space and time savings.

Changed in gconf2:
status: In Progress → Fix Committed
Changed in gconf:
status: Unknown → New
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package cdbs - 0.4.52ubuntu12

cdbs (0.4.52ubuntu12) jaunty; urgency=low

  * 1/rules/ Drop translations from gconf .schemas
    files, put in the gettext translation domain instead. gconf >=
    2.25.0-0ubuntu1 will use gettext() dynamically. Once all our
    *.schemas files will be converted, this will save ~ 90 MB
    uncompressed/10 MB compressed on a default Ubuntu installation.
    (LP: #123025)

 -- Martin Pitt <email address hidden> Fri, 23 Jan 2009 14:59:06 +0100

Changed in cdbs:
status: Fix Committed → Fix Released
Martin Pitt (pitti) wrote :

gconf (2.25.0-0ubuntu1) jaunty; urgency=low

  * New upstream release:
    - Fix various format string warnings.
    - Sync saved state to disk before closing.
    - Add --search-key-regex option to gconftool.
    - Add --toggle option to gconftool.
    - Translation updates.
  * Add 01_xml-gettext-domain.patch: Support calling gettext at runtime and
    putting the gettext domain into the .schemas file instead of replicating
    translations in /usr/share/gconf/schemas/*.schemas *and*
    /var/lib/gconf/defaults/%gconf-tree- $LANG.xml.
  * Once all our *.schemas files will be converted, this will save ~
    90 MB uncompressed/10 MB compressed. (LP: #123025)

 -- Martin Pitt <email address hidden> Thu, 22 Jan 2009 20:19:12 +0100

Changed in gconf2:
status: Fix Committed → Fix Released
mati (mati-wroc) wrote :

Great news! This space (10 MB) could be used to easily fix #311389 (and brainstorm idea #13740, respectively) :)

Sebastien Bacher (seb128) wrote :

the space should rather be used to ship translations

Changed in gconf:
status: New → Confirmed
Changed in gconf:
importance: Unknown → Wishlist
Changed in gconf:
status: Confirmed → Expired
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.