all-locales 680 B

123456789101112131415161718192021222324252627
  1. #! /bin/sh
  2. # Prints the list of all locale names, one per line.
  3. locale -a
  4. test $? = 0 && exit 0
  5. host=`/bin/sh ../build-aux/config.guess`
  6. host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
  7. host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
  8. host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
  9. case "$host_os" in
  10. sunos* | solaris*)
  11. cd /usr/lib/locale && ls -1
  12. ;;
  13. freebsd*)
  14. cd /usr/share/locale && ls -1
  15. ;;
  16. darwin* | openbsd*)
  17. echo C
  18. cd /usr/share/locale && ls -1 */LC_CTYPE | sed -e 's,/LC_CTYPE$,,'
  19. ;;
  20. *)
  21. echo "Don't know how to determine list of locales on $host_os" 1>&2
  22. exit 1
  23. ;;
  24. esac