【问题标题】:i18n in Google App Engine - PHPGoogle App Engine 中的 i18n - PHP
【发布时间】:2013-07-02 19:19:53
【问题描述】:

我正在尝试通过 gettext 扩展在 GAE - PHP 中实现 i18n,但它失败了,我想到目前为止 GAE 中还没有启用该扩展。

我尝试过使用 php-gettext 类,它运行良好,但我有点担心它的速度。如您所见,in this benchmark 该类是最慢的方法。

你知道我可以使用其他方法吗?我更喜欢使用 php-gettext 类和 .po 文件而不是字符串 ID,但我也不想降低网站速度。

非常感谢! :)

【问题讨论】:

标签: php google-app-engine internationalization


【解决方案1】:

自应用引擎 1.9.22 起,intl 扩展可用,但必须激活。只需将其包含在您的 php.ini 文件中即可:

extension = "intl.so"

(如Google App Engine's issue tracker on June 11th 2015中提到的)

【讨论】:

    【解决方案2】:

    你可以试试图书馆php-gettext-memcached。它建立在 php-gettext 库之上,并使用 Google 的 memcached 服务缓存已解析的翻译数据,从而提高了速度。

    Performance benchmark

    免责声明:我编写了这个库。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-06-26
      • 1970-01-01
      • 2016-04-20
      • 2017-03-24
      • 2013-06-06
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多