1

What would be the best design to localize strings in Android that come from a web-service hosted on Google app engine?

My Android application calls a REST web-service that returns items. Each item has a "tags" attribute that contains strings.

Server-side, these tags are stored in the datastore, in English, in the item (with a StringListProperty). The handler is hardly more complex than:

class MyHandler(webapp2.RequestHandler):
    def get(self):
        item = MyModel.get_by_id(id)
        self.response.write(json.encode(item))

I wonder what design recommendations you can suggest to localize this "tags".

  • Localize server-side? This does not sound very usual (flickr, stackoverflow, etc.) don't do that. And, then, how to handle the localization? (see code snippet above)
  • Localize client-side? Then, what is the most efficient way to do that?
rds
  • 26,253
  • 19
  • 107
  • 134
  • related: [How to create an internationalized Google App Engine application](http://stackoverflow.com/questions/1946251/how-to-create-an-internationalized-google-app-engine-application) – Shay Erlichmen Jan 31 '12 at 11:20
  • Server-side & supply a suitable `Accept-Language` HTTP header from your Android application in the REST call? – Jens Jan 31 '12 at 11:39
  • @ShayErlichmen Are you confirming that Django's i18n works on gae with python2.7 & webapp2 ? – rds Jan 31 '12 at 14:07
  • @Jens Yes, this sounds like a best practice for serving the appropriate language. Question is: how do I internationalize this tags? Should I have both values in the datastore? Translate them at request time, and, if yes, how (gettext seems unavailable ; does Django i18n work with webapp2 ; is babel better?) – rds Jan 31 '12 at 14:09
  • Should work (famous last words) – Shay Erlichmen Jan 31 '12 at 15:33

1 Answers1

0

In www.cloud4apps.com you can find a free cloud web service that works similar to StackOverflow that enables the power of crowd-sourcing where users post and vote for best entries.

Then the services determine which string resources to use in your app based on votes and your approval or automatically if desired.

You can upload your current Android resource files into the online tool and Download latest translations as Android resource files or use the SDK to pull data in real-time.

Their SDK implements caching that allows your app to still use text resources even when offline.

Jaime Botero
  • 2,263
  • 2
  • 22
  • 14