Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: e19200241d
Fetching contributors…

Cannot retrieve contributors at this time

15 lines (13 sloc) 0.488 kB
function get_global_locale {
defaults read .GlobalPreferences AppleLocale 2>/dev/null
}
function get_locale {
local locale
# get cached value if requested and present, refresh asynchronously
if [[ $1 == '--cached' ]]; then
[[ -f "$2" ]] && locale=$(while read -r; do echo "$REPLY"; break; done < "$2")
{ { mkdir -p "${2%/*}"; get_global_locale > "$2"; } & disown; } 2>/dev/null
fi
# get the defaults value otherwise
[[ -n "$locale" ]] && echo "$locale" || get_global_locale
}
Jump to Line
Something went wrong with that request. Please try again.