How to change culture/language of the "TWTR.Widget" (type - profile)


#1

I am not able to find the option to change the cutlure/language of the TWTR.Widget (type-profile)? I am using following code generated from the twitter website.

http://twitter.com/about/resources/widgets/widget_profile

<script charset="utf-8" src="http://widgets.twimg.com/j/2/widget.js"></script>
<script>
new TWTR.Widget({
  version: 2,
  type: 'profile',
  rpp: 4,
  interval: 30000,
  width: 250,
  height: 300,
  theme: {
    shell: {
      background: '#333333',
      color: '#ffffff'
    },
    tweets: {
      background: '#000000',
      color: '#ffffff',
      links: '#4aed05'
    }
  },
  features: {
    scrollbar: false,
    loop: false,
    live: false,
    behavior: 'all'
  }
}).render().setUser('twitter').start();
</script>

#2

Hi Sukhminder,

I may be wrong, but I don’t believe there’s a way to customize the language or locality of the widgets at this time.


#3

thanks…but then how the twitter works on multilingual sites?


#4

Twitter can work pretty well on multilingual sites – and a lot of our client-side products are fully multilingual-aware (like Twitter Web Intents, the Tweet Button, the Follow Button) – the widgets that display profile tweets and such are a bit older. If you’re determined, you can build equivalent functionality yourself using the REST API and localize as you see fit.


#5

thanks Taylor…do you have any examples or references which i can refer for REST API if i try to go that path?


#6

You could download http://widgets.twimg.com/j/2/widget.js locally and replace the fixed language parts by your own language. There are some parts that construct the html and there you can replace it (ex. reply, retweet, favorite etc etc). Upload onto your own hosting environment and call the widget (http://www.yourdomain.com/widget.js).


#7
<script>

new TWTR.Widget({

  version: 2,

  type: 'profile',

  rpp: 4,

  interval: 30000,

  width: 250,

  height: 300,

  theme: {

    shell: {

      background: '#333333',

      color: '#ffffff'

    },

    tweets: {

      background: '#000000',

      color: '#ffffff',

      links: '#4aed05'

    }

  },

  features: {

    scrollbar: false,

    loop: false,

    live: false,

    behavior: 'all'

  }

}).render().setUser('twitter').start();

</script>

#8