in locales-utils/src/main/java/com/spotify/i18n/locales/utils/hierarchy/LocalesHierarchyUtils.java [272:279]
private static String getLocaleScript(final ULocale locale) {
// We only calculate the script if it isn't yet present in the locale, as addLikelySubtag can be
// a time-consuming operation.
return Optional.of(locale)
.map(ULocale::getScript)
.filter(Predicate.not(String::isEmpty))
.orElseGet(() -> ULocale.addLikelySubtags(locale).getScript());
}