Imlement Java 7's toLanguageTag