Jason, I got the information that this wasn't implemented from kurrik in the IRC chat, and already implemented a simplified "template emulator" on my code to solve most of my current needs.
Thanks a lot for the information on localization, currently our app is only in portuguese, but that will likely change in the future and this will be very helpful. On Jun 20, 9:01 pm, Jason <[EMAIL PROTECTED]> wrote: > 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 <[EMAIL PROTECTED]> 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....... > > > -------------------- BEGIN CODE -------------------- > > > var activity = opensocial.newActivity('LISTEN_TO_THIS_SONG', {Song: > > 'Paint it Black',Artist: 'Rolling Stones', Subject: viewer, Owner: > > owner}) > > opensocial.requestCreateActivity(activity, > > opensocial.CreateActivityPriority.HIGH, SendActivityCallback); > > > -------------------- END CODE -------------------- > > > But it always fails with the error "You must pass in an activity with > > a title or title id". I can only send Activities if I don't use > > templates. > > > Anyone has any ideas what may be causing this error? > > > URL for my test > > application:http://189.39.44.79:8091/activitysample/activitytest.xml > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Orkut Developer Forum" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/opensocial-orkut?hl=en -~----------~----~----~----~------~----~------~--~---

