While activity templates were a part of the OpenSocial 0.7
specification, support was never added in Shindig, which is the
OpenSocial implementation that orkut, hi5, and several other
containers use for their application platforms. Furthermore, support
for 0.8 of the specification has not yet been rolled out to these
various containers since Shindig development is ongoing. You can
follow the official developer blog if you want the latest in orkut
platform-related news:
http://orkutdeveloper.blogspot.com/
For the time being, you can only specify a title and body for your
activities. To localize them, you can define all of the text you'll
need for your activities in a message bundle and use the gadgets.Prefs
instance method getMsg to retrieve the appropriate message from the
bundle (based on the user's language setting). For example, say I have
two messages defined (in separate files) for a certain greeting:
<!-- Bundle #1 (English) -->
<msg name="greeting">
Hello
</msg>
<!-- Bundle #2 (Portuguese) -->
<msg name="greeting">
Olá
</msg>
If my display language is set to Portuguese, the snippet new
gadgets.Prefs().getMsg('greeting') returns "Olá".
So the following code displays an activity with a greeting in the
language of the user who generated it:
var title = new gadgets.Prefs().getMsg('greeting');
var params = {};
params[opensocial.Activity.Field.TITLE] = title;
var activity = opensocial.newActivity( params );
opensocial.requestCreateActivity(activity,
opensocial.CreateActivityPriority.HIGH, callback);
Please let me know if you have any questions on this or if the snippet
above doesn't work for you. If you would like more details on
localization, please see the following article:
http://code.google.com/p/opensocial-resources/wiki/OrkutLocalization
Cheers!
- Jason
On Jun 18, 7:32 am, Badaro <
bad...@gmail.com> wrote:
> I'm trying to make my application send Activities using templates,
> following these samples:
>
>
http://code.google.com/apis/opensocial/docs/0.8/reference/#opensocial...http://code.google.com/apis/opensocial/docs/0.7/reference/opensocial....