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.
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 ...
[EMAIL PROTECTED] schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
Hi!
I'm using dgettext() with different domains in one set of scripts
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,
Did you look for files named config.php? I would try to find out which file
is loaded instead of the wanted one. Maybe you could use
fopen('config.php','r',TRUE); and check the contents of that file to get an
idea where it comes from? If it happens only with a file of this name, I
would assume
Wouldn't this be solved if the email is simply an answer to the thread
instead of a new, separate email? Within the thread about nested files
(http://www.nabble.com/Nested-include-require-not-working-in-5.2-tf4882937.html)
there was also an email with a changed subject ((SOLVED) was added), but
I got different portions of code only used for certain purposes (who don't
;-)?). But what, in your opinion (better: in your experience) would be the
best regarding script-performance: Putting each code-portion in a separate
file and include it if required, putting it in a constant-dependent
Thank you for the answers.
My abstract:
Use separate files for separate code. Easy to maintain, no real loss in
performance. That's fine, as I'm just doing so (like if I need a database
abstraction, I include dbas.php and if dbas.php needs some miscellaneous
functionality, it includes
For some simple applications I use a function to collect values in a static
variable and to return them when called in a special way, just like this
(fairly senseless) example:
function example($elem='') {
static $store = array();
if (!func_num_args()) return($store);
... do
The manual says:
In order to use variable variables with arrays, you have to resolve an
ambiguity problem. That is, if you write $$a[1] then the parser needs to
know if you meant to use $a[1] as a variable, or if you wanted $$a as the
variable and then the [1] index from that variable. The
Just to be curious:
when something like
if (defined('FOO') FOO) {
class foo{};
function foo(){};
}
is parsed and FOO is not defined, will the code inside be parsed
nevertheless? Or is anything inside skipped, leading to a (fragments of
microseconds) faster handling of the code? Thus to
From: Zoltán Németh [EMAIL PROTECTED]
function example($elem='') {
static $store = array();
AFAIK the above line should cause an error on the second run of the
function, as you declare the same static variable for the second time.
or am I wrong?
I think so - otherwise static
they have a word very suitable to this situation in dutch 'mierenneuken',
personally I'd stick with pretty girls.
OT: Couldn't translate that in german, the nearest approach seems to be
Haarspalterei but unfortunately for me this seems not to match the
situation. And it doesn't meet pretty
How about
$foo = str_replace('nbsp;','',$foo);
?
Or could there be an 'nbsp;' in a context where it shouldn't be replaced?
Thomas
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
13 matches
Mail list logo