read and write locales object to and from file