Click here to get back home

Why php gettext is needed in real life?

 HomeNewsGroups | Search

comp.lang.php - PHP programming language discussions 

get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Why php gettext is needed in real life? howa 06-03-2008
Posted by howa on June 3, 2008, 1:06 pm
Please log in for more thread options
http://hk2.php.net/manual/en/ref.gettext.php

I just wonder why those kind of translation/mapping can't be
implemented in using plain PHP array?

Howard

Posted by Iván Sánchez on June 3, 2008, 1:23 pm
Please log in for more thread options
Iván Sánchez Ortega wrote:

show/hide quoted text

str_replace('gave','have');

--
----------------------------------
Iván Sánchez Ortega -ivansanchez-algarroba-escomposlinux-punto-org-

Vamos, hale, hale, que es gerundio! (Yola Berrocal)

Posted by Joe Scylla on June 4, 2008, 2:57 am
Please log in for more thread options
howa wrote:
show/hide quoted text

First, gettext is faster that a php array

Sencondary, translators can use a gui programm for translation the
string (PoEdit, Eclipse Plugin).

But the main reason is: with gettext you can extract and refresh the
strings need translation out of the source code into your gettext
project file.

Joe

Posted by howa on June 4, 2008, 9:44 am
Please log in for more thread options
On 6$B7n(B4$BF|(B, $B2<8a(B2$B;~(B57$BJ,(B, Joe Scylla
show/hide quoted text

I agree with points such as GUI tools, but is gettext faster?

PHP array can be cached into memory using APC/XCache and you can even
use them without any method call.

Howard

Posted by Joe Scylla on June 4, 2008, 10:09 am
Please log in for more thread options
howa wrote:
show/hide quoted text

Well at least in my benchmarking it is (on Suse and Debian). Remember
that gettext caches loaded translation file in memory.

http://mel.melaxis.com/devblog/2006/04/10/benchmarking-php-localization-is-gettext-fast-enough/

It may depend on the gettext-implementation. There is a user posted in
the comments who had better performance with arrays under Windows.

Joe

Similar ThreadsPosted
Assertions in real life November 18, 2008, 5:51 pm
gettext.so April 15, 2008, 6:55 pm
Gettext doesn't worh, help! July 17, 2004, 8:39 pm
loading gettext January 10, 2005, 12:42 pm
GETTEXT (not really a question) July 13, 2005, 6:01 pm
Gettext fails me November 9, 2006, 8:32 am
gettext() function May 29, 2008, 3:46 am
Gettext problem December 18, 2009, 8:06 am
gettext vs custom ways May 10, 2007, 8:02 pm
Freebsd locales (gettext) October 26, 2007, 10:54 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Driving a better car - Fuelzilla.com

Cabling site for homeowners and pros alike - Cabling-Design.com

Friends:

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap
Privacy Policy