dgettext vs. xgettext

View: New views
3 Messages — Rating Filter:   Alert me  

dgettext vs. xgettext

by news_yodpeirs :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi!

I'm using dgettext() with different domains in one set of scripts (or even
in one script). When extracting the messages with xgettext I would like to
specify an option to get only messages for one domain, like getting all
messages from calls to dgettext('foobar',...) and ignore all others.
Otherwise it wouldn't be possible to know which message belongs to which
domain. Did anyone else came across this problem? And, even more interesing:
Does anyone have a solution for this?

With kind regards
Thomas

--
PHP Unicode & I18N Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: dgettext vs. xgettext

by news_yodpeirs :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

No ideas? Am I the only one using different domains with dgettext? What's
the sense of it if you can't get the translations apart?

Any hint is welcome ...

<news_yodpeirs@...> schrieb im Newsbeitrag
news:BE.20.43439.6D228474@......

> Hi!
>
> I'm using dgettext() with different domains in one set of scripts (or even
> in one script). When extracting the messages with xgettext I would like to
> specify an option to get only messages for one domain, like getting all
> messages from calls to dgettext('foobar',...) and ignore all others.
> Otherwise it wouldn't be possible to know which message belongs to which
> domain. Did anyone else came across this problem? And, even more
> interesing:
> Does anyone have a solution for this?
>
> With kind regards
> Thomas

--
PHP Unicode & I18N Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: dgettext vs. xgettext

by news_yodpeirs :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

So long, I solved it by myself. As I'm only using dgettext() and the domain
always is represented by a constant, I simply collect all php-files, then
preg_match_all() occurences of dgettext() (with domain in mind), put the
texts in the different corresponding files and, as I'm on the way, convert
them into the appropriate charset, merge the new files with the existing
ones and compile them (using the gnu-gettext binaries). So on the fly I got
all my texts stored and compiled, preserving the old translations.

Thank you for listening.

--
PHP Unicode & I18N Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

LightInTheBox - Buy quality products at wholesale price