[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: May I ask...
From: |
Bruno Haible |
Subject: |
Re: May I ask... |
Date: |
Fri, 26 Aug 2005 13:41:58 +0200 |
User-agent: |
KMail/1.5 |
Clemens Claudio wrote:
> I have some own libraries, and some binaries.
> I would like to define a different domain for each lib and binary. Is it
> possible in C? Or must I define for all my binaries and libraries (about
> 70000 lines of code with lots of strings) the same domain (which will give
> me a huge POT file).
It is absolutely possible, and even recommended, to use different
domains in such a situation. All you have to do for this is to
- use the dgettext() function instead of gettext(),
- define the shorthand macro _() differently for each program and
library, most likely through a private include file that is
specific to the program or library:
progfoo.h:
#define _(string) dgettext ("progfoo", string)
progfoo.c:
#include "progfoo.h"
libbar-private.h:
#define _(string) dgettext ("libbar", string)
- use different po/ directories for progfoo and for libbar.
These directories need not to be named "po"; any name will do.
(AM_GNU_GETTEXT recognizes them by the fact that they have a
Makefile.in.in and a LINGUAS file.)
> PHP:
I don't know about PHP, but I guess the situation is similar? It's just a
matter how to structure your code?
Bruno
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: May I ask...,
Bruno Haible <=