added functions to handle locale and Java 6 sniffer in build