AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

2004.07.06 14:40 "[Tiff] Suggested Patch for libtiff to easify translation using gettext", by Bernd Herd
2004.07.10 20:11 "Re: [Tiff] Suggested Patch for libtiff to easify translation using gettext", by Andrey Kiselev
2004.07.11 11:47 "Re: [Tiff] Suggested Patch for libtiff to easify translation using gettext", by Bernd Herd

2004.07.06 14:40 "[Tiff] Suggested Patch for libtiff to easify translation using gettext", by Bernd Herd

Hello,

I've done some translation of libtiff error and warning messages to german.

extraction of libtiff messages can be done using the following command:

xgettext   -kTIFFError:2   -kTIFFWarning:2 *.c

The resulting messages.po conatains the translatable strings.

However some strings in libtiff are used with small differences depending on the occurence. For example:

"%d: Sample out of range, max %d"
"Sample %d out of range, max %u"
"%lu: Sample out of range, max %lu"
"%u: Sample out of range, max %u"

The attached patch unifies these messages so they will only consume a single translation entry.

The attached file de.po contains the translation strings for german.

Thank you for developing libtiff.

I do not regularily read this mailing list.

Bernd Herd

        :-)

http://www.herdsoft.com/katalog/davinci_roadmap.html

Index: tif_dirread.c

=================================================================== RCS file: /home/herdsoft/cvsroot/davinci4/src/lib/tiff/libtiff/tif_dirread.c,v retrieving revision 1.2

diff -c -r1.2 tif_dirread.c

*** tif_dirread.c       6 Jul 2004 13:04:24 -0000       1.2
--- tif_dirread.c       6 Jul 2004 13:54:00 -0000

***************
*** 145,151 ****
                        return (0);
                if (!ReadOK(tif, dir, dircount*sizeof (TIFFDirEntry))) {
                        TIFFError(module,
! "%.100s: Can not read TIFF directory",
                                    tif->tif_name);
                        goto bad;
                }
--- 145,151 ----
                        return (0);
                if (!ReadOK(tif, dir, dircount*sizeof (TIFFDirEntry))) {
                        TIFFError(module,
! "%.1000s: Can not read TIFF directory",
                                    tif->tif_name);
                        goto bad;
                }
Index: tif_read.c

=================================================================== RCS file: /home/herdsoft/cvsroot/davinci4/src/lib/tiff/libtiff/tif_read.c,v retrieving revision 1.2

diff -c -r1.2 tif_read.c

*** tif_read.c  6 Jul 2004 13:04:24 -0000       1.2
--- tif_read.c  6 Jul 2004 14:20:47 -0000

***************
*** 58,65 ****
        if (td->td_planarconfig == PLANARCONFIG_SEPARATE) {
                if (sample >= td->td_samplesperpixel) {
                        TIFFError(tif->tif_name,
! "%lu: Sample out of range, max %lu",
! (u_long) sample, (u_long) td->td_samplesperpixel);
                        return (0);
                }
                strip = sample*td->td_stripsperimage + row/td->td_rowsperstrip;
--- 58,65 ----
        if (td->td_planarconfig == PLANARCONFIG_SEPARATE) {
                if (sample >= td->td_samplesperpixel) {
                        TIFFError(tif->tif_name,
! "%d: Sample out of range, max %d",
! sample, td->td_samplesperpixel);
                        return (0);
                }
                strip = sample*td->td_stripsperimage + row/td->td_rowsperstrip;
***************
*** 220,227 ****
        if (!TIFFCheckRead(tif, 0))
                return ((tsize_t) -1);
        if (strip >= td->td_nstrips) {
! TIFFError(tif->tif_name, "%lu: Strip out of range, max %lu",
! (u_long) strip, (u_long) td->td_nstrips);
                return ((tsize_t) -1);
        }
        bytecount = td->td_stripbytecount[strip];
--- 220,227 ----
        if (!TIFFCheckRead(tif, 0))
                return ((tsize_t) -1);
        if (strip >= td->td_nstrips) {
! TIFFError(tif->tif_name, "%ld: Strip out of range, max %ld",
! (long) strip, (long) td->td_nstrips);
                return ((tsize_t) -1);
        }
        bytecount = td->td_stripbytecount[strip];
***************
*** 423,430 ****
        if (!TIFFCheckRead(tif, 1))
                return ((tsize_t) -1);
        if (tile >= td->td_nstrips) {
! TIFFError(tif->tif_name, "%lu: Tile out of range, max %lu",
! (u_long) tile, (u_long) td->td_nstrips);
                return ((tsize_t) -1);
        }
        bytecount = td->td_stripbytecount[tile];
--- 423,430 ----
        if (!TIFFCheckRead(tif, 1))
                return ((tsize_t) -1);
        if (tile >= td->td_nstrips) {
! TIFFError(tif->tif_name, "%ld: Tile out of range, max %ld",
! (long) tile, (long) td->td_nstrips);
                return ((tsize_t) -1);
        }
        bytecount = td->td_stripbytecount[tile];
Index: tif_strip.c

=================================================================== RCS file: /home/herdsoft/cvsroot/davinci4/src/lib/tiff/libtiff/tif_strip.c,v retrieving revision 1.2

diff -c -r1.2 tif_strip.c
*** tif_strip.c 6 Jul 2004 13:04:24 -0000 1.2
--- tif_strip.c 6 Jul 2004 14:17:56 -0000
***************
*** 44,50 ****
        if (td->td_planarconfig == PLANARCONFIG_SEPARATE) {
                if (sample >= td->td_samplesperpixel) {
                        TIFFError(tif->tif_name,
! "%u: Sample out of range, max %u",
                            sample, td->td_samplesperpixel);
                        return ((tstrip_t) 0);
                }
--- 44,50 ----
        if (td->td_planarconfig == PLANARCONFIG_SEPARATE) {
                if (sample >= td->td_samplesperpixel) {
                        TIFFError(tif->tif_name,
! "%d: Sample out of range, max %d",
                            sample, td->td_samplesperpixel);
                        return ((tstrip_t) 0);
                }
Index: tif_tile.c

=================================================================== RCS file: /home/herdsoft/cvsroot/davinci4/src/lib/tiff/libtiff/tif_tile.c,v retrieving revision 1.2

diff -c -r1.2 tif_tile.c

*** tif_tile.c  6 Jul 2004 13:04:24 -0000       1.2
--- tif_tile.c  6 Jul 2004 14:25:21 -0000

***************
*** 82,89 ****
                return (0);
        }
        if (y >= td->td_imagelength) {
! TIFFError(tif->tif_name, "Row %ld out of range, max %lu",
! (long) y, (u_long) td->td_imagelength);
                return (0);
        }
        if (z >= td->td_imagedepth) {
--- 82,89 ----
                return (0);
        }
        if (y >= td->td_imagelength) {
! TIFFError(tif->tif_name, "%lu: Row out of range, max %lu",
! (u_long) y, (u_long) td->td_imagelength);
                return (0);
        }
        if (z >= td->td_imagedepth) {
***************
*** 93,99 ****
        }
        if (td->td_planarconfig == PLANARCONFIG_SEPARATE &&
            s >= td->td_samplesperpixel) {
! TIFFError(tif->tif_name, "Sample %d out of range, max %u",
                    (int) s, td->td_samplesperpixel);
                return (0);
        }
--- 93,99 ----
        }
        if (td->td_planarconfig == PLANARCONFIG_SEPARATE &&
            s >= td->td_samplesperpixel) {
! TIFFError(tif->tif_name, "%d: Sample out of range, max %d",
                    (int) s, td->td_samplesperpixel);
                return (0);
        }

# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Free Software Foundation, Inc.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: libtiff\n"
"POT-Creation-Date: 2004-07-06 16:34+0200\n"
"PO-Revision-Date: 2004-07-05 11:41:39\n"
"Last-Translator: Bernd Herd <info@herdsoft.com>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=iso-8859-1\n"
"Content-Transfer-Encoding: 8bit\n"

#: tif_acorn.c:454 tif_apple.c:208 tif_atari.c:180 tif_msdos.c:111 #: tif_unix.c:155 tif_vms.c:253 tif_win3.c:124 tif_win32.c:207

#, c-format
msgid "%s: Cannot open"
msgstr "Kann %s nicht �ffnen"

#: tif_apple.c:128
#, c-format
msgid "%s: Cannot get file size"
msgstr "Kann Dateigr��e nicht bestimmen"

#: tif_apple.c:205
#, c-format
msgid "%s: Cannot create"
msgstr "Kann Datei nicht erzeugen"

#: tif_codec.c:107
#, c-format
msgid "%s compression support is not configured"
msgstr "Unterst�tzung f�r Kompressionsmethode %s ist nicht konfiguriert"

#: tif_compress.c:42
#, c-format
msgid ""

"%s %s encoding is no longer implemented due to Unisys patent enforcement" msgstr ""

"%s %s codierung ist aufgrund des Unisys-Patents auf diese " "Kompressionstechnik nicht mehr implementiert"

#: tif_compress.c:45
#, c-format
msgid "%s %s encoding is not implemented"
msgstr "%s %s Codierung ist nicht implementiert"

#: tif_compress.c:51
#, c-format

msgid "Compression scheme %u %s encoding is not implemented" msgstr "Kompressionsschema %u %s ist nicht implementiert"

#: tif_compress.c:84
#, c-format
msgid "%s %s decoding is not implemented"
msgstr "%s %s Dekompression ist nicht implementiert"

#: tif_compress.c:88
#, c-format

msgid "Compression scheme %u %s decoding is not implemented" msgstr "Dekompression f�r Kompressionsschema %u %s ist nicht implementiert"

#: tif_compress.c:119

msgid "Compression algorithm does not support random access" msgstr "Dieses Kompresssionsverfahren erlaubt keinen wahlfreien zugrifff"

#: tif_compress.c:215
#, c-format
msgid "No space to register compression scheme %s"
msgstr "Kein Platz um Kompressionsschema %s zu registrieren"

#: tif_compress.c:232
#, c-format

msgid "Cannot remove compression scheme %s; not registered" msgstr "Kann Kompressionsschema %s nicht entfernen da es nicht registriert ist"

#: tif_dir.c:106
#, c-format

msgid "%s: Invalid InkNames value; expecting %d names, found %d" msgstr "%s: Ung�ltiger Wert f�r InkNames, erwartet %d namen, gefunden %d"

#: tif_dir.c:215
#, c-format
msgid "Bad value %ld for \"%s\" tag ignored"
msgstr "Schlecgter Wert %ld f�r \"%s\" tag ignoriert"

#: tif_dir.c:307
#, c-format
msgid "Nonstandard tile width %d, convert file"
msgstr ""
"Nicht dem Standard entsrpechende Kachelbreite %d, konvertierten Sie die Datei"

#: tif_dir.c:318
#, c-format
msgid "Nonstandard tile length %d, convert file"
msgstr ""
"Nicht dem Standard entsrpechende Kachelh�he %d, konvertierten Sie die Datei"

#: tif_dir.c:402
#, c-format
msgid "%s: Sorry, cannot nest SubIFDs"
msgstr "%s: Kann SubIFDs nicht verschachteln"

#: tif_dir.c:497 tif_dir.c:935
#, c-format

msgid "%s: Invalid %stag \"%s\" (not supported by codec)" msgstr "%s: Ung�ltiges %stag \\\"%s\\\" (von diesem Code nicht unterst�tzt)"

#: tif_dir.c:571
msgid "... pass by value not implemented."
msgstr "... pass by value nicht implementiert"

#: tif_dir.c:590
#, c-format
msgid "%.1000s: Bad value %d for \"%s\""
msgstr "%.1000s: Falscher Wert %d f�r \"%s\""

#: tif_dir.c:595
#, c-format
msgid "%.1000s: Bad value %ld for \"%s\""
msgstr "%.1000s: Falscher Wert %ld f�r \"%s\""

#: tif_dir.c:600
#, c-format
msgid "%.1000s: Bad value %f for \"%s\""
msgstr "%.1000s: Falscher Wert %f f�r \"%s\""

#: tif_dir.c:620
#, c-format
msgid "%s: Unknown %stag %u"
msgstr "%s: Unbekanntes %stag %u"

#: tif_dir.c:633
#, c-format
msgid "%s: Cannot modify tag \"%s\" while writing"
msgstr "%s: Kann Tag \"%s\" ls"