Zend_Gdata_Calendar_EventEntry 德语答案

发布于 2024-12-28 07:35:52 字数 538 浏览 0 评论 0原文

我的问题是 Zend_Gdata_Calendar_EventEntry 的所有响应都以德语发送到我的应用程序,我猜是因为它自动采用服务器语言。我想知道如何强制GData的语言?

这是我的应用程序代码的一部分:

//on récupère le nom du service
$this->gcal = Zend_Gdata_Calendar::AUTH_SERVICE_NAME;

//on s'authentifie
$client = Zend_Gdata_ClientLogin::getHttpClient($user, $pass, $this->gcal);
$client->setConfig(array('language' => 'en'));

//on crée un nouvel objet calendar
$this->gcal = new Zend_Gdata_Calendar($client);

如果我打印 GCal 对象,则语言设置为英语。我不明白为什么谷歌用德语回答!

My problem is that all responses of Zend_Gdata_Calendar_EventEntry are sent to my application in German, I guess because it takes the server language automatically. I would like to know how to force GData's language?

This is a part of my application's code:

//on récupère le nom du service
$this->gcal = Zend_Gdata_Calendar::AUTH_SERVICE_NAME;

//on s'authentifie
$client = Zend_Gdata_ClientLogin::getHttpClient($user, $pass, $this->gcal);
$client->setConfig(array('language' => 'en'));

//on crée un nouvel objet calendar
$this->gcal = new Zend_Gdata_Calendar($client);

If I print my GCal object, the language is set in English. I don't understand why Google answers in German!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

若能看破又如何 2025-01-04 07:35:52

我认为谷歌可能正在做一些我们在采埃孚也能做的事情:

三种区域设置的行为略有不同:

'browser' - Zend_Locale 应该使用以下信息
由用户的 Web 浏览器提供。它由 PHP 发布在
全局变量 $_SERVER['HTTP_ACCEPT_LANGUAGE']。

如果用户在其浏览器中提供了多个区域设置,
Zend_Locale 将使用第一个找到的语言环境。如果用户不
提供区域设置或从命令行调用脚本
将自动使用自动语言环境“环境”,并且
回来了。

'environment' - Zend_Locale 应该使用以下信息
由主机服务器提供。它是由 PHP 通过内部发布的
函数 setlocale()。

如果一个环境提供了多个语言环境,Zend_Locale 将使用
第一个找到的语言环境。如果主机未提供区域设置
自动区域设置“浏览器”将自动使用并返回。

'auto' - Zend_Locale 应该自动检测任何可以
一起工作。它将首先搜索用户区域设置,然后,如果
不成功,搜索主机区域设置。

如果无法检测到区域设置,它将抛出异常并告诉您
自动检测失败。

您的服务器可能将 $_SERVER['HTTP_ACCEPT_LANGUAGE'] 设置为 DE,我知道这不多,但至少您可以检查并可能在应用程序中更改它。

I think Google may be doing something that we can do in ZF:

There are three locales which have a slightly different behaviour:

'browser' - Zend_Locale should work with the information which is
provided by the user's Web browser. It is published by PHP in the
global variable $_SERVER['HTTP_ACCEPT_LANGUAGE'].

If a user provides more than one locale within his browser,
Zend_Locale will use the first found locale. If the user does not
provide a locale or the script is being called from the command line
the automatic locale 'environment' will automatically be used and
returned.

'environment' - Zend_Locale should work with the information which is
provided by the host server. It is published by PHP via the internal
function setlocale().

If a environment provides more than one locale, Zend_Locale will use
the first found locale. If the host does not provide a locale the
automatic locale 'browser' will automatically be used and returned.

'auto' - Zend_Locale should automatically detect any locale which can
be worked with. It will first search for a users locale and then, if
not successful, search for the host locale.

If no locale can be detected, it will throw an exception and tell you
that the automatic detection has been failed.

your server may be setting $_SERVER['HTTP_ACCEPT_LANGUAGE'] to DE, I know it's not much but at least you can check and maybe change it in app.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文