Man Linux: Main Page and Category List


       dh_gentdeb - build debian TDeb translation packages


       dh_gentdeb [debhelper options]


       dh_gentdeb prepares localisation content for a debian Tdeb package.

       Only the -p debhelper option is handled by dh_gentdeb, if none is
       specified the TDeb package name will be ’$sourcepackage-tdeb’.


       dh_gentdeb is a debhelper add-on created by Emdebian to create
       translation packages (tdebs). dh_gentdeb is intended to separate out
       the individual translation files from the current Debian packages into
       packages without any translation files and a single TDeb package, one
       per source package.

       Generated packages use the syntax:

       If a second tdeb is supported by one source package, the
       $srcpackage-tdeb package must contain any debconf templates used by any
       of the binary packages. The second tdeb is then used for translations
       of optional content.

       (Note that Debian TDebs are architecture-independent, Emdebian TDebs
       are architecture-dependent.)

       Once a package uses dh_gentdeb, translation files must be removed from
       all packages in the normal build. This includes all translated manpages
       and other translated content. Original, untranslated, content should

       dh_gentdeb runs as a part of the normal package build - simply add the
       call to the binary-indep target of debian/rules, usually after
       dh_install and before dh_builddeb. dh_gentdeb handles locating the
       relevant files, a .install file is not normally necessary.

       Support for a tdeb diff1.gz will be added as dh_gentdeb develops.  The
       extra diff is used by translators to build updated or new tdeb
       packages. Tdeb packages depend on the source:Version of the mainpackage
       but no packages may depend upon the tdeb. (Not even other TDebs). The
       mainpackage can be specified using the -p option.

       Use of diff1.gz should remove the need to create a customised source
       with a debian/rules stub etc. by allowing Emdebian TDebs to be created
       during an Emdebian build and Debian TDebs in a Debian build.
       Translators would then be able to use:

        $ apt-get source $package
        $ cd $package-$version/
        $ poedit po/$lang.po

       To build the package, either dh_gentdeb can behave as em_installtdeb
       does now and run a build only of the TDeb components or dpkg-
       buildpackage could gain an option to only process the TDeb.

       dh_gentdeb currently only supports gettext translation.

       The locale package must use GETTEXT_PACKAGE for the eventual filename
       of the binary translation file - although this may be the same as the
       $dh{MAINPACKAGE}. GETTEXT_PACKAGE is determined by upstream, not
       Debian.  When building the whole package, the binary translation file
       may be in debian/tmp/usr/share/locale/$lang/LC_MESSAGES but when in
       translator mode, this location is not available. Instead retrieve
       GETTEXT_PACKAGE from the POT filename, the Makefile GETTEXT_PACKAGE
       macro or if that is not set, use the upstream source package name. This
       may need extending.

       Some packages use multiple po directories and dh_gentdeb checks for a
       POT file in all usable po directories, including within the tdeb
       source, along with all po files: e.g.


       When packaged, the Debian tdeb built from this source would contain:


       For more detail on Tdebs, see:

       Note that the Debian implementation of tdebs differs from the tdebs for
       Emdebian because Emdebian does not care about manpages in general, let
       alone translated manpages. Once the ’nodocs’ DEB_BUILD_OPTION is
       supported in debhelper, this will not be an issue as the tdebs can be
       built for Emdebian without any manpages. Other translated documentation
       would be omitted under ’nodocs’ too. Images containing translated text
       are relatively few.


       The default action is to process all available po files and all
       identifiable translated content.

Debconf Templates

       Packages may need to rename the templates file for the template file
       and change the reference in debian/po/ to the new file. This
       results in a lintian warning:

        Now running lintian...
        W: dpkg-cross: no-debconf-templates
        Finished running lintian.

       The package probably now needs to Pre-Depend on the TDeb.
       Alternatively either dpkg or debconf should automatically install a
       TDeb prior to trying to configure the main package.

       Templates files are the most common reason for l10n rebuilds of
       packages prior to a release.


       debhelper (7)

       This program is based on debhelper.


       Neil Williams <>

Copyright and Licence

        Copyright (C) 2007-2008  Neil Williams <>

        This package is free software; you can redistribute it and/or modify
        it under the terms of the GNU General Public License as published by
        the Free Software Foundation; either version 3 of the License, or
        (at your option) any later version.

        This program is distributed in the hope that it will be useful,
        but WITHOUT ANY WARRANTY; without even the implied warranty of
        GNU General Public License for more details.

        You should have received a copy of the GNU General Public License
        along with this program.  If not, see <>.

Use in Debian

       generate_source will be removed before inclusion into Debian.

       At the same time, XC-Package-Type: tdeb needs support too. Notably,
       many of the scripts in the devscripts package fail to identify the TDeb
       in the .changes file and certain debhelper scripts fail to handle the
       TDeb package-type.

       reprepro needs a patch to accept .tdeb and allow .tdeb in the
       repository files:
        $ reprepro --ignore=extension -b /path/ includedeb \
        unstable ../qof-locale-sv_0.7.5-1em1_arm.tdeb
        $ ls /opt/reprepro/locale/pool/main/q/qof/

        Filename: pool/main/q/qof/qof-locale-sv_0.7.5-1em1_arm.deb
        Description: sv translation for qof (tdeb)

       reprepro also needs a way to handle a .tdeb in a .changes file.
        reprepro -b /opt/reprepro/locale/ include unstable
        ’qof-locale-id_0.7.5-1em1_arm.tdeb’ is not .deb or .udeb!
        There have been errors!

Other translations

       Packages may also contain translated manpages and translations for
       debconf templates. These translations are not yet packaged or processed
       by dpkg-gentdeb. For Tdebs to be supported in Debian, these issues will
       need to be resolved such that Emdebian can continue to only package the
       gettext program translations, omitting translated manpages and leaving
       debconf translation support to existing tools or implement sufficient
       changes in cdebconf.