|
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
> In other words, professional translators will gave an easier time
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
> 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
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
> First, gettext is faster that a php array
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
> On 6$B7n(B4$BF|(B, $B2<8a(B2$B;~(B57$BJ,(B, Joe Scylla
>> First, gettext is faster that a php array
>
> 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
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 Threads | Posted | | 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 |
|