[wp-polyglots] translation of empty string
Nikolay Bachiyski
nbachiyski at developer.bg
Tue Dec 11 12:07:42 GMT 2007
2007/12/11, Tamás Makó <wp-polyglots at futourist.hu>:
> Hello everyone,
>
> When I call for instance _e() with empty string (let's say it is in a variable),
> it echos the .po file's metadata and this showed on the blog.
> This is not too fortunate.
> Is this a known feature and I must handle the occurences of empty string
> or a bug in the gettext module?
This is the expected gettext behaviour. It uses the source strings as
a key in a dictionary and the meta data is indexed with empty string,
so that it won't collide with the actual strings for translation.
You should use only literal strings and never variables in gettext
function calls. If you want to substitute a value, which is not part
of the translation use printf/sprintf or other templating mechanism.
Happy translating,
Nikolay.
More information about the wp-polyglots
mailing list