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

2015-01-28 Thread Yi, EungJun
I agree that a list of char* is enough for language_tags. Thanks for your review and patch. I'll apply your patch and send v9. On Wed, Jan 28, 2015 at 3:15 PM, Junio C Hamano gits...@pobox.com wrote: On Tue, Jan 27, 2015 at 3:34 PM, Junio C Hamano gits...@pobox.com wrote: Yi EungJun

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

2015-01-27 Thread Junio C Hamano
Yi EungJun semtlen...@gmail.com writes: +static void write_accept_language(struct strbuf *buf) +{ + /* + * MAX_DECIMAL_PLACES must not be larger than 3. If it is larger than + * that, q-value will be smaller than 0.001, the minimum q-value the + * HTTP specification

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

2015-01-27 Thread Junio C Hamano
On Tue, Jan 27, 2015 at 3:34 PM, Junio C Hamano gits...@pobox.com wrote: Yi EungJun semtlen...@gmail.com writes: + + sprintf(q_format, ;q=0.%%0%dd, decimal_places); + + strbuf_addstr(buf, Accept-Language: ); + + for(i = 0; i num_langs; i++) { +

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

2015-01-27 Thread Yi EungJun
From: Yi EungJun eungjun...@navercorp.com Add an Accept-Language header which indicates the user's preferred languages defined by $LANGUAGE, $LC_ALL, $LC_MESSAGES and $LANG. Examples: LANGUAGE= - LANGUAGE=ko:en - Accept-Language: ko, en;q=0.9, *;q=0.1 LANGUAGE=ko LANG=en_US.UTF-8 -

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

2014-07-12 Thread Peter Krefting
Jeff King: If that is the case, though, I wonder if we should actually be adding it as a git-protocol header so that all transports can benefit (i.e., we could be localizing human-readable error messages in upload-pack, receive-pack, etc). That would be very nice, thre is a lot of language

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

2014-07-11 Thread Yi, EungJun
2014-07-09 19:40 GMT+09:00 Peter Krefting pe...@softwolves.pp.se: Yi EungJun: 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 Avoid adding q=1.000. It is redundant (the default for any

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

2014-07-11 Thread Yi, EungJun
2014-07-11 5:10 GMT+09:00 Jeff King p...@peff.net: On Wed, Jul 09, 2014 at 11:46:14AM +0100, Peter Krefting wrote: Jeff King: I did some digging, and I think the public API is setlocale with a NULL parameter, like: printf(%s\n, setlocale(LC_MESSAGES, NULL)); That still will end up

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

2014-07-11 Thread Yi, EungJun
2014-07-12 1:24 GMT+09:00 Eric Sunshine sunsh...@sunshineco.com: On Fri, Jul 11, 2014 at 5:22 AM, Yi, EungJun semtlen...@gmail.com wrote: 2014-07-09 6:52 GMT+09:00 Eric Sunshine sunsh...@sunshineco.com: + grep ^Accept-Language: ko; q=1.000, en; q=0.999, \*; q=0.001 actual Do you want

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

2014-07-10 Thread Jeff King
On Wed, Jul 09, 2014 at 11:46:14AM +0100, Peter Krefting wrote: Jeff King: I did some digging, and I think the public API is setlocale with a NULL parameter, like: printf(%s\n, setlocale(LC_MESSAGES, NULL)); That still will end up like en_US.UTF-8, though; And it only yields the

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

2014-07-09 Thread Jeff King
On Wed, Jul 09, 2014 at 02:46:35PM +0900, Yi, EungJun wrote: 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

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

2014-07-09 Thread Peter Krefting
Yi EungJun: 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 Avoid adding q=1.000. It is redundant (the default for any unqualified language names is 1.0, and additionally there has

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

2014-07-08 Thread Yi EungJun
From: Yi EungJun eungjun...@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 -

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

2014-07-08 Thread Eric Sunshine
On Tue, Jul 8, 2014 at 11:54 AM, Yi EungJun semtlen...@gmail.com wrote: From: Yi EungJun eungjun...@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= -

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

2014-07-08 Thread Jeff King
On Wed, Jul 09, 2014 at 12:54:06AM +0900, Yi EungJun wrote: From: Yi EungJun eungjun...@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= -

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

2014-07-08 Thread Yi, EungJun
2014-07-09 14:10 GMT+09:00 Jeff King p...@peff.net: On Wed, Jul 09, 2014 at 12:54:06AM +0900, Yi EungJun wrote: From: Yi EungJun eungjun...@navercorp.com Add an Accept-Language header which indicates the user's preferred languages defined by 'LANGUAGE' environment variable if the variable is