finished first version of locale implementation