How would we use BCP 47 strings in a simple way?
Lassi Kortela 31 Jul 2020 15:54 UTC
> We may be able to cherry-pick ideas from SRFI 29, but I consider that it
> is now obsolete due to events outside Scheme. It's currently supported
> by Chez, Chicken, Gauche, Larceny, and Sagittarius, but I doubt if it is
> used much.
Probably right.
> I am more and more convinced that the UI should use standard BCP 47
> strings with hyphens/underscores and all.
>
> Since we want to return exactly one localized error message and not a
> set of them, we should use BCP 47 lookup and not matching.
I have nothing against that it we can figure out a simple algorithm for
returning (for example) US English when the caller asks for any English.
How would we do that with these strings -- would this do it:
(find (lambda (available-language)
(string-prefix? user-langauge available-language))
available-languages)
Would probably have to do something so that asking for "e" doesn't
return "en".