Use built-in localization API.

Found your example after I've solved similar problem, so I decided to share my findings.