aboutsummaryrefslogtreecommitdiffhomepage
path: root/getfmt
diff options
context:
space:
mode:
Diffstat (limited to 'getfmt')
-rwxr-xr-xgetfmt41
1 files changed, 0 insertions, 41 deletions
diff --git a/getfmt b/getfmt
deleted file mode 100755
index fba9ac5..0000000
--- a/getfmt
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/bin/sh
-
-# https://github.com/unicode-org/cldr-json/blob/main/cldr-json/cldr-numbers-full/main/$1/numbers.json
-
-usage()
-{
- echo "Usage: getfmt currency|date|number|percent locale..." >&2
- exit 1
-}
-
-[ $# -lt 2 ] && usage
-
-mode="$1"
-shift
-
-case "$mode" in
-currency)
- url='https://raw.githubusercontent.com/unicode-org/cldr-json/refs/heads/main/cldr-json/cldr-numbers-full/main/$l/numbers.json'
- qry='.main.[$l].numbers.["currencyFormats-numberSystem-latn"].standard'
- ;;
-date)
- url='https://raw.githubusercontent.com/unicode-org/cldr-json/refs/heads/main/cldr-json/cldr-dates-full/main/$l/ca-gregorian.json'
- qry='.main.[$l].dates.calendars.gregorian.dateFormats.short'
- ;;
-number)
- url='https://raw.githubusercontent.com/unicode-org/cldr-json/refs/heads/main/cldr-json/cldr-numbers-full/main/$l/numbers.json'
- qry='"1\(.main.[$l].numbers.["symbols-numberSystem-latn"].group)234\(.main.[$l].numbers.["symbols-numberSystem-latn"].decimal)00"'
- ;;
-percent)
- url='https://raw.githubusercontent.com/unicode-org/cldr-json/refs/heads/main/cldr-json/cldr-numbers-full/main/$l/numbers.json'
- qry='.main.[$l].numbers.["percentFormats-numberSystem-latn"].standard'
- ;;
-*)
- usage
-esac
-
-for l in "$@"
-do
- [ $# -gt 1 ] && printf '%s:\t' "$l"
- curl -s "$(eval echo "$url")" | jq -r --arg l "$l" "$qry"
-done \ No newline at end of file