Created locales generator and fixed compatibility with ruby 1.8.7

It works :)