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

Re: Feature Request - Better i18n support

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Mar 9, 2023, 22:41 UTC
Message-ID
<ZApgtJqVxkory4/B@tapette.crustytoothpaste.net>
In-Reply-To
<xmqq7cvp8sdu.fsf@gitster.g>
On 2023-03-09 at 22:35:57, Junio C Hamano wrote:
Show 24 quoted lines
> "brian m. carlson" <sandals@crustytoothpaste.net> writes:
> 
> > More specifically, I think it could be fixed for progress output, but
> > there are a few places in diff output where it couldn't because it might
> > be parsed.  Would you be willing to try a patch for this?  I think the
> > code you're probably thinking about is in progress.c (search for "%%"),
> > but there might be other places you have in mind as well.
> 
> Ah, my earlier grep missed this, as it tried only to catch [fdi]%%
> and the progress thing uses "%u%%" like so:
> 
> 		if (percent != progress->last_percent || progress_update) {
> 			progress->last_percent = percent;
> 
> 			strbuf_reset(counters_sb);
> 			strbuf_addf(counters_sb,
> 				    "%3u%% (%"PRIuMAX"/%"PRIuMAX")%s", percent,
> 				    (uintmax_t)n, (uintmax_t)progress->total,
> 				    tp);
> 			show_update = 1;
> 		}
> 
> With the PRIuMAX thing, it won't be as simple as enclosing the
> entire format string inside _(), though.

Sure, but we can split it into two invocations of strbuf_addf, one localized, one not, no big deal. This was the place that immediately stood out to me as the place we see lots of percentages, but I'm glad you mentioned a couple other places as well.

-- 
brian m. carlson (he/him or they/them)
Toronto, Ontario, CA
Previous: Junio C HamanoNext: Emir SARI
Message 6 of 7 in “Feature Request - Better i18n support”
  1. Emir SARIMar 9, 2023
  2. Junio C HamanoMar 9, 2023
  3. Emir SARIMar 9, 2023
  4. brian m. carlsonMar 9, 2023
  5. Junio C HamanoMar 9, 2023
  6. brian m. carlsonMar 9, 2023
  7. Emir SARIMay 10, 2023

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.