Wednesday, January 26, 2011

Globalization

It's a big buzz word around my office for my real job.  It wasn't really something that I thought about when I started the android development.  However, when I used some of the Google clock code as a base for my clock, the localized strings came with it, so my desk clock was half globalized.

Last week, Paul from the Netherlands emailed me regarding the force close issues.  Fortunately, I think I have the issue resolved*.  We traded some emails and I got a small list of "wouldn't it be nice if".  Which, once again, is something I'm used to with my real job.  His first comment was the date formatting, I naturally formatted the date Month, Day and he would like it formatted Day, Month.  The change to the formatting is nothing, but the question is when to do it.  What's cool is that there's a function getDateFormatOrder that will return a character array with how to format the date.

His other request was for the weather conditions to be localized.  I'm getting my weather information from yahoo, parsing the XML return, and stuffing the value of Condition into the text box.  I tried to see if I could pass Yahoo a language ID and have it return the localize conditions, but no dice.  So, I opted to use the condition code and then get the string from inside my application.  Paul offered to translate the conditions into Dutch and all looked like it was good.  After typing out all 43 conditions in English yesterday, I wasn't looking forward to doing the same thing in Dutch today.  So, after some searching I found some really cool tools:
  1. App Localizer  This nifty web page you can copy and paste your XML strings file into a text box and tell it what language you want and after some google translating you get a translated XML file back.  It's pretty awesome (and pretty quick too).
  2. Androlate BETA  This is a plug in for Eclipse that will do the same thing but in line.  It is still beta, but I thought it worked pretty damned well, although I thought it was a bit slower than the App Localizer web page.  There was some goofiness with how I had to do things since I have my strings broken up in to multiple files, but all in all I'm happy with it.
So, I have the Desk Clock Plus application completely localized in Dutch, German and Spanish.  After I push it out to the market I'll have Paul check it out and if all looks good then I'll have it go to town on all the 2.2 languages.

*Another user reported that his previously working Droid 2 isn't working anymore once it gets docked... no rest for the wicked...