TakahikoKawasaki / nv-i18n

Package to support internationalization, containing ISO 3166-1 country code enum, ISO 639-1 language code enum, etc.
Apache License 2.0
389 stars 115 forks source link

Add getByLocale() and toLocale() to ScriptCode #87

Open dwalluck opened 2 years ago

dwalluck commented 2 years ago

Add getByLocale(Locale) and toLocale() to ScriptCode. These methods already exist in CountryCode, LanguageCode, and LocaleCode.

Calling toLocale() always returns a Locale with the just the script set.

Script support wasn't added to Locale until Java 1.7, so calling either method will increase the minimum Java version required at runtime from Java 1.5 to Java 1.7.