Skip to content

Instantly share code, notes, and snippets.

@fabiankessler
fabiankessler / LocaleUtility.java
Last active January 3, 2017 07:54 — forked from phil-brown/LocaleUtility.java
Utility for getting the Script String using a Locale. This is useful, for example, in Android, where this is not part of the Locale Object. To use this, simply call `LocaleUtility.getScript(Locale.getDefault());` to get the script for the current users' Locale.
import com.google.common.base.Optional;
import com.google.common.collect.ImmutableMap;
import org.jetbrains.annotations.NotNull;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
/*
* Source https://gist.github.com/phil-brown/8056700