Showing posts with label Google. Show all posts
Showing posts with label Google. Show all posts

Saturday, January 2, 2010

Python Wrapper of Google Language API with GAE Support

Code is hosted here.

Licensed under MIT license.

Usage:

>>> from glanguage import Translator
>>> t = Translator()
>>> t.translate('Hello, World', lang_from='en', lang_to='fr')
'Bonjour tout le monde'
>>> what = t.detect('你好')
>>> what.lang
'Chinese_simplified'
>>> what.lang_code
'zh-CN'
>>> print what
<language: (chinese_simplified)="" zh-cn="">
>>>

If the value of lang_from in the translate() method is omitted,
the language of the original text will be detected automatically.
The value of lang_to is default to 'en'.

Support for Google App Engine is added. The usage stays the same
on GAE. I also did some simplification to the original code
found online.

A lot credit goes to Peteris Krumins (peter@catonmat.net), who
wrote the code originally.

Thursday, March 6, 2008

Getting my Google Analytics back

The traffic report from Google analytics had been 0 almost a week before I found out the reason. The thing is, days ago, when I was moving part of the content in the old sidebar into the new one, all code within that part got accidentally deleted, and I had not back up any thing (oops..). I got them back little by little and finally get the page back to this original look. That's the beginning of the story, I totally forgot about the tracking code for analytics. And, not so excitingly, here's the end of this story: I went back to Google analytics, log in. In the "Website Profiles" table appeared on the first page, I clicked on "edit" for this site in column "settings". In the next page, it saids "Receiving Data" on the top right, which is, say, not true. I clicked on "Check Status". There appeared the status info and below is "Instructions for adding tracking", I found the "New Tracking Code (ga.js). Then the code is added back to this blog, which means, hopefully, Google Analytics should give me a proper report tomorrow.