2

I'm trying to implement i18n in GAE - PHP via the gettext extension, but it fails, I suppose the extension is not enabled in GAE as of now.

I've tried using the php-gettext class, and it works fine, but I'm a bit concerned about its speed. As you can see in this benchmark the class is the slowest method.

Do you know any other way I can use? I'd prefer to use the php-gettext class and the .po files rather than string ids, but I also don't want to slow down the site.

Thanks a lot! :)

Koas
  • 402
  • 3
  • 10

2 Answers2

1

Since app engine 1.9.22, the intl extension is available, although it has to be activated. Just include it in your php.ini file as such:

extension = "intl.so"

(as mentioned in Google App Engine's issue tracker on June 11th 2015)

Roel Vermeulen
  • 594
  • 7
  • 15
0

You can try the library php-gettext-memcached. It was built on top of the php-gettext library, and caches parsed translation data using Google's memcached service, hence increasing its speed.

Performance benchmark

Disclaimer: I wrote this library.

Yifei Teng
  • 55
  • 5