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

Re: [PATCH] Revert diffstat back to English

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 13, 2012, 18:40 UTC
Message-ID
<7va9wt9377.fsf@alter.siamese.dyndns.org>
In-Reply-To
<7vzk4t960y.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
Show 9 quoted lines
> Nguyễn Thái Ngọc Duy <pclouds@gmail.com> writes:
>
>>  Git is still partly i18n-ized, turning a few strings back does not
>>  seem a big regression.
>
> More than one people explicitly said that they do not want to see
> this in Klingon.  Even if the system is fully internationalized,
> these "... (+), ... (-)" should never be localized, just like we
> will never localize "diff --git", "index f00f..abcd", etc.

Nah, I was being silly. People complaining on Klingon on _this_ list does not argue for this to be in "C"; it just means the i18n.projectlang for this project is "C".

How about _not_ reverting it and doing something like this instead? I suspect that we may need to delay the call to git_setup_gettext() in a similar way that we delay the call to commit_pager_choice(), but that is a minor detail people smarter than I can surely figure out ;-)

 git.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
diff --git i/git.c w/git.c
index 8788b32..a2cb9c8 100644
--- i/git.c
+++ w/git.c
@@ -51,6 +51,15 @@ int check_pager_config(const char *cmd)
 	return c.want;
 }
 
+static int project_lang_config(const char *var, const char *value, void *cb_data)
+{
+	if (!strcmp(var, "i18n.projectlang")) {
+		setenv("LANG", val, 1);
+		setenv("LC_ALL", val, 1);
+	}
+	return 0;
+}
+
 static void commit_pager_choice(void) {
 	switch (use_pager) {
 	case 0:
@@ -538,6 +547,7 @@ int main(int argc, const char **argv)
 	if (!cmd)
 		cmd = "git-help";
 
+	git_config(project_lang_config, NULL);
 	git_setup_gettext();
 
 	/*
Previous: Junio C HamanoNext: Jeff King
Message 10 of 28 in “Mixing English and a local language”
  1. 0/2 Mixing English and a local languageNguyễn Thái Ngọc Duy, Aug 25, 2012
  2. 1/2 Allow to print diffstat in English regardless current localeNguyễn Thái Ngọc Duy, Aug 25, 2012
  3. 2/2 format-patch: always print diffstat in EnglishNguyễn Thái Ngọc Duy, Aug 25, 2012
  4. Nguyen Thai Ngoc DuySep 12, 2012
  5. Junio C HamanoSep 12, 2012
  6. Jeff KingSep 13, 2012
  7. Revert diffstat back to EnglishNguyễn Thái Ngọc Duy, Sep 13, 2012
  8. Jeff KingSep 13, 2012
  9. Junio C HamanoSep 13, 2012
  10. Junio C HamanoSep 13, 2012
  11. Jeff KingSep 13, 2012
  12. Junio C HamanoSep 13, 2012
  13. Jeff KingSep 13, 2012
  14. Junio C HamanoSep 13, 2012
  15. Jeff KingSep 13, 2012
  16. Junio C HamanoSep 13, 2012
  17. Jeff KingSep 14, 2012
  18. Nguyen Thai Ngoc DuySep 14, 2012
  19. Junio C HamanoSep 14, 2012
  20. Nguyen Thai Ngoc DuySep 15, 2012
  21. Junio C HamanoSep 13, 2012
  22. Junio C HamanoSep 13, 2012
  23. Jeff KingSep 13, 2012
  24. Jeff KingSep 13, 2012
  25. Michael J GruberSep 14, 2012
  26. Nguyen Thai Ngoc DuySep 14, 2012
  27. Makefile: respect $LINGUAS variable on selecting .mo files to installNguyễn Thái Ngọc Duy, Sep 14, 2012
  28. Michael J GruberSep 14, 2012

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.