webapp2 gettext与谷歌云端点一起使用

时间:2014-04-03 17:08:42

标签: google-app-engine internationalization webapp2

from webapp2_extras.i18n import gettext as _
...
_("something")

我的api中有一些代码可以调用webapp2应用程序使用的共享函数。然而,它使用gettext来翻译字符串;从Google Cloud Endpoints调用时,我得到了

AssertionError: Request global variable is not set.

这也适用于调用webapp2.uri_for函数,因为从谷歌云端点调用时没有设置请求全局变量。我试图寻找解决方案,但除非我修改实际的库,否则无法解决。

0 个答案:

没有答案
相关问题