Changed locale function to getLocale and setLocale,
wchich works the same way as i18n library by mashpie.
Added tests.