What to use for language/locale identifiers? Lassi Kortela (27 Jul 2020 05:55 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)
(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: How would we use BCP 47 strings in a simple way? Lassi Kortela 02 Aug 2020 09:36 UTC

[Accidentally pasted the same code twice in the last mail.)

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

That should probably be:

(define (bcp-47-filter alist language-tag)
   (any (lambda (pair)
          (and (or (not language-tag)
                   (string=? language-tag (car pair))
                   (string-prefix? (string-append language-tag "-")  ; !
                                   (car pair)))                      ; !
               (cdr pair)))
        alist))

With this new version (foreign-error-ref e 'message "e")) returns #f and
not one of the "en-*" messages, which is right.