What to use for language/locale identifiers? Lassi Kortela (27 Jul 2020 05:55 UTC)
(missing)
(missing)
Fwd: What to use for language/locale identifiers? John Cowan (29 Jul 2020 02:37 UTC)
Re: What to use for language/locale identifiers? Lassi Kortela (29 Jul 2020 06:16 UTC)
Re: What to use for language/locale identifiers? Alex Shinn (29 Jul 2020 07:45 UTC)
Re: What to use for language/locale identifiers? John Cowan (29 Jul 2020 13:56 UTC)
Re: What to use for language/locale identifiers? Alex Shinn (29 Jul 2020 15:39 UTC)
Re: What to use for language/locale identifiers? John Cowan (29 Jul 2020 16:30 UTC)
Re: What to use for language/locale identifiers? Alex Shinn (30 Jul 2020 08:22 UTC)
SRFI 29 (Localization) Lassi Kortela (30 Jul 2020 16:55 UTC)
Re: SRFI 29 (Localization) Alex Shinn (31 Jul 2020 14:09 UTC)
Re: SRFI 29 (Localization) John Cowan (31 Jul 2020 15:31 UTC)
How would we use BCP 47 strings in a simple way? Lassi Kortela (31 Jul 2020 15:54 UTC)
Re: How would we use BCP 47 strings in a simple way? Lassi Kortela (31 Jul 2020 15:56 UTC)
Re: How would we use BCP 47 strings in a simple way? John Cowan (02 Aug 2020 03:40 UTC)
Re: How would we use BCP 47 strings in a simple way? Lassi Kortela (02 Aug 2020 08:34 UTC)
Re: How would we use BCP 47 strings in a simple way? Lassi Kortela (02 Aug 2020 09:27 UTC)
Re: How would we use BCP 47 strings in a simple way? Lassi Kortela (02 Aug 2020 09:36 UTC)
Re: How would we use BCP 47 strings in a simple way? Lassi Kortela (02 Aug 2020 09:51 UTC)
Re: How would we use BCP 47 strings in a simple way? John Cowan (06 Aug 2020 04:30 UTC)
Re: What to use for language/locale identifiers? Lassi Kortela (27 Jul 2020 06:03 UTC)
Re: What to use for language/locale identifiers? Lassi Kortela (27 Jul 2020 08:33 UTC)
Re: What to use for language/locale identifiers? John Cowan (28 Jul 2020 19:19 UTC)
Re: What to use for language/locale identifiers? Lassi Kortela (28 Jul 2020 20:57 UTC)
Re: What to use for language/locale identifiers? Alex Shinn (29 Jul 2020 01:07 UTC)
Re: What to use for language/locale identifiers? John Cowan (29 Jul 2020 01:09 UTC)
Re: What to use for language/locale identifiers? Alex Shinn (29 Jul 2020 01:44 UTC)

Re: How would we use BCP 47 strings in a simple way? Lassi Kortela 02 Aug 2020 09:51 UTC

(define (bcp-47-filter alist language-tag)
   (if (not language-tag)
       (and (not (null? alist))
            (cdar alist))
       (let ((prefix (string-append language-tag "-")))
         (any (lambda (pair)
                (and (or (string-ci=? language-tag (car pair))
                         (string-prefix-ci? prefix (car pair)))
                     (cdr pair)))
              alist))))

We could require the alist keys to be normalized to lowercase. Then we
could use lowercase the search key and use case sensitive string comparison.

But that may be overkill. The case-preserved tags (e.g. "en-US") are
nicer for display. It may be useful to dump the whole translations alist
into a REPL for example.