Posts

Showing posts from November 27, 2008

using AJAX to dynamically translate a report

Image
I decided to push the AJAX integration a little bit further... Using jQuery and Google AJAX Language API , I was able to translate in "real time" a report. For my example, I decided to translate the records of a table containing the different states of the USA. I realize that this data is not the best for translation demonstration because many words are almost the same no matter what is the spoken language. To have better results, translate the data to Arabic, Chinese, Japanese or Korean. You can try a working example of the Dynamic Translation w/ Google AJAX Language API demo . 1) Report (Region Definition) Source: SELECT st ,initcap(state_name) AS state_name_en ,initcap(state_name) AS state_name FROM demo_states N.B. I had to use the initcap function on my data. Google translation engine is case sensitive. (I need to find more documentation to help with this issue.) 2) Report (Column Attributes) STATE_NAME_EN: Column Formatting > CSS Class: translate_src STATE_NA