git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] http: Add Accept-Language header if possible

From
Yi, EungJun <semtlenori@gmail.com>
Date
Jul 9, 2014, 05:46 UTC
Message-ID
<CAFT+Tg8HZTsbWK2WHHg_q04LY5Vm7cjfNkfHGBEdbKjf1==rKw@mail.gmail.com>
In-Reply-To
<20140709051040.GB2318@sigill.intra.peff.net>
2014-07-09 14:10 GMT+09:00 Jeff King <peff@peff.net>:
Show 27 quoted lines
> On Wed, Jul 09, 2014 at 12:54:06AM +0900, Yi EungJun wrote:
>
>> From: Yi EungJun <eungjun.yi@navercorp.com>
>>
>> Add an Accept-Language header which indicates the user's preferred
>> languages defined by 'LANGUAGE' environment variable if the variable is
>> not empty.
>>
>> Example:
>>   LANGUAGE= -> ""
>>   LANGUAGE=ko -> "Accept-Language: ko; q=1.000, *; q=0.001"
>>   LANGUAGE=ko:en -> "Accept-Language: ko; q=1.000, en; q=0.999, *; q=0.001"
>>
>> This gives git servers a chance to display remote error messages in
>> the user's preferred language.
>
> Should this also take into account other language-related variables? I'd
> think $LC_ALL, $LC_MESSAGES, and $LANG would affect it, too.  Are
> colon-separated values a standard in $LANGUAGE? I have never seen them,
> but I admit I am not very knowledgeable about localization issues.
>
> Also, we do we need to do more parsing? My $LANG is set to en_US.UTF-8.
> The encoding part is presumably uninteresting to the remote server.  I
> also wonder if there are support functions in libc or as part of gettext
> that can help us get these values.
>
> -Peff

I agree with you. In fact, I tried to get user's preferred language in the same way as gettext. It has guess_category_value() to do that and the function is good enough because it considers $LANGUAGE, $LC_ALL, $LANG, and also system-dependent preferences. But the function does not seem a public API and I don't know how can I use the function in Git. So I chose to use $LANGUAGE only.

Previous: Jeff KingNext: Jeff King
Message 4 of 12 in “http: Add Accept-Language header if possible”
  1. http: Add Accept-Language header if possibleYi EungJun, Jul 8, 2014
  2. Eric SunshineJul 8, 2014
  3. Jeff KingJul 9, 2014
  4. Yi, EungJunJul 9, 2014
  5. Jeff KingJul 9, 2014
  6. Peter KreftingJul 9, 2014
  7. Jeff KingJul 10, 2014
  8. Yi, EungJunJul 11, 2014
  9. Peter KreftingJul 12, 2014
  10. Peter KreftingJul 9, 2014
  11. Yi, EungJunJul 11, 2014
  12. Yi, EungJunJul 11, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.