Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: kopischke/alfred-pushdial
base: d69457bdfc
...
head fork: kopischke/alfred-pushdial
compare: ffcae635fe
Checking mergeability… Don't worry, you can still create the pull request.
  • 3 commits
  • 5 files changed
  • 0 commit comments
  • 1 contributor
Commits on Apr 09, 2013
@kopischke Fix sorting of results
Use OS X system locale for sort collation order
1627d91
@kopischke Addeds sourceable system function library 22697ca
@kopischke Rlease 1.1.1
Fixes sorting of script filter results.
ffcae63
View
BIN  Dial with PushDialer.alfredworkflow
Binary file not shown
View
14 src/lib/system.sh
@@ -0,0 +1,14 @@
+function get_global_locale {
+ defaults read .GlobalPreferences AppleLocale 2>/dev/null
+}
+
+function get_locale {
+ local locale
+ # get cached value if requested and present
+ [[ $1 == '--cached' && -f "$2" ]] && locale=$(while read -r; do echo "$REPLY"; break; done < "$2")
+ # get the defaults value if there is no cached value present, or if none has been requested
+ [[ -z "$locale" ]] && locale=$(get_global_locale)
+ # asynchronously refresh cache (if requested)
+ [[ $1 == '--cached' ]] && { { mkdir -p "${2%/*}"; get_global_locale > "$2"; } & disown; }
+ echo "$locale"
+}
View
10 src/numbers
@@ -1,8 +1,9 @@
#!/usr/bin/env bash
-export LC_CTYPE='en_US.UTF-8' # UTF-8 case awareness
-
scriptdir="${BASH_SOURCE[0]%/*}"
-source "$scriptdir"/lib/strings.sh
+
+source "$scriptdir"/lib/system.sh
+locale=$(get_locale --cached "$scriptdir"/cache/locale)
+export LC_ALL='en_US.UTF-8' # for UTF-8 case awareness
# Parse arguments
desc=''; icon=''
@@ -33,6 +34,7 @@ esac
desc="${desc:-${1#--} phone number}"
icon="${icon:-public.vcard}"
+source "$scriptdir"/lib/strings.sh
if ! is_blank $2; then
# Normalize Unicode representation of characters with diacritics
is_7bit "${*:2}" && query=(${*:2}) || query=($(utf8_normalize "${*:2}"))
@@ -83,7 +85,7 @@ if ! is_blank $2; then
# Store control var values
prev_title="$title"; prev_number="$number"; let matches++
fi
- done < <("$scriptdir"/contacts -SH -f "$code" ${query[0]} | sort)
+ done < <(LC_COLLATE="${locale%.*}.UTF-8" "$scriptdir"/contacts -SH -f "$code" ${query[0]} | sort)
# Create fallback item if no matching records are found
if (( $matches < 1 )); then
View
2  src/update.json
@@ -1,4 +1,4 @@
{
- "version": 1.1,
+ "version": 1.11,
"remote_json": "https://github.com/kopischke/alfred-pushdial/raw/master/versions.json"
}
View
2  versions.json
@@ -1,5 +1,5 @@
{
- "version": 1.1,
+ "version": 1.11,
"download_url": "https://github.com/kopischke/alfred-pushdial/raw/master/Dial%20with%20PushDialer.alfredworkflow",
"description": "Searchlight edition: much better call searches."
}

No commit comments for this range

Something went wrong with that request. Please try again.