Use built-in localization API.

Found your example after I've solved similar problem, so I decided to share my findings.
API reference: http://goo.gl/6LXGPC