开发者

GWT visualization API Motion Chart language

开发者 https://www.devze.com 2022-12-21 16:25 出处:网络
I\'m using the gwt visualization library to display motion charts in a gwt app. However, the language shown in the chart is random (different language every time it loads).

I'm using the gwt visualization library to display motion charts in a gwt app. However, the language shown in the chart is random (different language every time it loads).

This: http://code.google.com/apis/visualization/documentation/using_overview.html#localization says I can set it, but only through the load method. But the GWT load method does not allow me to set anything other than the version and Packages.

As far as I can tell, there is no way of explicitly setting the language using the GWT API.

Any ideas开发者_开发百科?


You can set the locale of a GWT application in many ways: Locales in GWT. My guess would be that the Visualization API uses that value to set its own locale value.

You should be able to do a quick test of this by appending locale=fr (change to your desired locale) to the address:

http://www.example.com/MyGwtApp.html?locale=fr

This will force that locale to be used by GWT.


Update: the AjaxLoader does support setting the language via the AjaxLoader.AjaxLoaderOptions:

AjaxLoaderOptions options = AjaxLoaderOptions.newInstance();
options.setLanguage("fr");
AjaxLoader.loadApi("visualization", "1", null, options);

I'm not sure you can use null for the callback parameter, but you get the general idea.


I've discovered that this is a bug, which I've submitted here:

http://code.google.com/p/gwt-google-apis/issues/detail?id=358

0

精彩评论

暂无评论...
验证码 换一张
取 消