[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: how to harvest translatable strings from generated files?
From: |
Bruno Haible |
Subject: |
Re: how to harvest translatable strings from generated files? |
Date: |
Wed, 13 Jul 2005 21:03:26 +0200 |
User-agent: |
KMail/1.5 |
Hi,
Paul Pogonyshev wrote:
> I have a custom-format files which a parsed during build process with
> custom tools to generate C files. Some of these files contain translable
> strings. Apparently, I cannot feed the custom files to `xgettext', because
> it doesn't understand their format.
Yes, and it is some effort to make 'xgettext' understand a custom format.
It's better to generate some dummy C file, just as input for xgettext,
such as
gettext("foo");
/* TRANSLATORS: ...some comment for the translators... */
gettext("bar");
> At the same time, C files end up in
> the build directory, which is not necessarily the same as the source
> directory.
You can either create the dummy C file in the source directory, and
distribute it with your package. The same way as you handle the output
from bison or flex.
Or you can create the dummy C file in the build directory, during "make" -
like you do with .o files -, and constrain yourself to not do "make update-po"
or "make dist" when $builddir != $srcdir. Remember, xgettext is not run
by a normal "make"; only when the maintainer invokes it explicitly through
"make update-po" or "make dist".
Bruno