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

[PATCH on ab/i18n] branch: remove lego in i18n tracking info strings

From
Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Date
May 3, 2012, 13:12 UTC
Message-ID
<1336050720-21200-1-git-send-email-pclouds@gmail.com>
In-Reply-To
<877gwtyalt.fsf@thomas.inf.ethz.ch>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 On Thu, May 3, 2012 at 2:42 PM, Thomas Rast <trast@inf.ethz.ch> wrote:
 > Christian Stimming <stimming@tuhh.de> writes:
 >
 >> As one of the earlier translators: I agree with most of those as well. Thanks
 >> a lot. However, one small remark:
 >>
 >> Am Mittwoch, 2. Mai 2012, 15:49:27 schrieb Thomas Rast:
 >>> @@ -676,11 +675,11 @@ msgstr "hinter "
 >>>
 >>>  #: wt-status.c:908 wt-status.c:911
 >>>  msgid "ahead "
 >>> -msgstr "über "
 >>> +msgstr "weiter: "
 >>>
 >>>  #: wt-status.c:913
 >>>  msgid ", behind "
 >>> -msgstr ", hinter "
 >>> +msgstr ", zurückgefallen "
 >>>
 >>>  #: builtin/add.c:62
 >>>  #, c-format
 >>> @@ -903,12 +902,12 @@ msgstr "Zweig '%s' zeigt auf keine Version"
 >>>  #: builtin/branch.c:396
 >>>  #, c-format
 >>>  msgid "behind %d] "
 >>> -msgstr "hinter %d] "
 >>> +msgstr "%d hinterher] "
 >>>
 >>>  #: builtin/branch.c:398
 >>>  #, c-format
 >>>  msgid "ahead %d] "
 >>> -msgstr "vor %d] "
 >>> +msgstr "%d voraus] "
 >>
 >> In the above hunk, you said "ahead = weiter" and "behind = zurückgefallen",
 >> but now you say "ahead = voraus" and "behind = hinterher". Is it helpful to
 >> use two different translations, or shouldn't those rather be chosen
 >> identically? The second set sounds somewhat better to me, but the more
 >> important question is whether both hunks should use the same translations.
 >
 > Yeah, sorry about that.  The whole thing is a mess because of the lego
 > going on.  It would probably be better to first patch the code into
 > shape so that it builds the displays in one step, and then translate
 > that.  As it stands, it's very hard to translate because wt-status.c
 > does not even let you reposition the number.
 The translator in me totally agrees with you. I'll look into
 wt-status legos, but we probably need better infrastructure to mix
 color and text. Pseudo html tags to to mark color, like
 "On branch <color1>%s</color1>" is probably not a bad idea.
 builtin/branch.c |   31 ++++++++++++++++++++++---------
 1 files changed, 22 insertions(+), 9 deletions(-)
diff --git a/builtin/branch.c b/builtin/branch.c
index 8813d2e..5011881 100644
--- a/builtin/branch.c
+++ b/builtin/branch.c
@@ -384,6 +384,7 @@ static void fill_tracking_info(struct strbuf *stat, const char *branch_name,
 		int show_upstream_ref)
 {
 	int ours, theirs;
+	const char *ref = NULL;
 	struct branch *branch = branch_get(branch_name);
 
 	if (!stat_tracking_info(branch, &ours, &theirs)) {
@@ -394,16 +395,28 @@ static void fill_tracking_info(struct strbuf *stat, const char *branch_name,
 		return;
 	}
 
-	strbuf_addch(stat, '[');
 	if (show_upstream_ref)
-		strbuf_addf(stat, "%s: ",
-			shorten_unambiguous_ref(branch->merge[0]->dst, 0));
-	if (!ours)
-		strbuf_addf(stat, _("behind %d] "), theirs);
-	else if (!theirs)
-		strbuf_addf(stat, _("ahead %d] "), ours);
-	else
-		strbuf_addf(stat, _("ahead %d, behind %d] "), ours, theirs);
+		ref = shorten_unambiguous_ref(branch->merge[0]->dst, 0);
+	if (!ours) {
+		if (ref)
+			strbuf_addf(stat, _("[%s: behind %d]"), ref, theirs);
+		else
+			strbuf_addf(stat, _("[behind %d]"), theirs);
+
+	} else if (!theirs) {
+		if (ref)
+			strbuf_addf(stat, _("[%s: ahead %d]"), ref, ours);
+		else
+			strbuf_addf(stat, _("[ahead %d]"), ours);
+	} else {
+		if (ref)
+			strbuf_addf(stat, _("[%s: ahead %d, behind %d]"),
+				    ref, ours, theirs);
+		else
+			strbuf_addf(stat, _("[ahead %d, behind %d]"),
+				    ours, theirs);
+	}
+	strbuf_addch(stat, ' ');
 }
 
 static int matches_merge_filter(struct commit *commit)
-- 
1.7.8.36.g69ee2
Previous: Thomas RastNext: Junio C Hamano
Message 19 of 28 in “Please pull git-po master branch”
  1. Jiang XinMay 2, 2012
  2. Junio C HamanoMay 2, 2012
  3. Thomas RastMay 2, 2012
  4. Ralf ThielowMay 2, 2012
  5. Thomas RastMay 2, 2012
  6. Ralf ThielowMay 2, 2012
  7. Christian StimmingMay 2, 2012
  8. 0/5 de.po suggested updatesThomas Rast, May 2, 2012
  9. 1/5 stash: make "saved" message translatableThomas Rast, May 2, 2012
  10. Junio C HamanoMay 2, 2012
  11. 2/5 de.po: translate "bare" as "bloß"Thomas Rast, May 2, 2012
  12. 3/5 de.po: hopefully uncontroversial fixesThomas Rast, May 2, 2012
  13. 4/5 de.po: translate "bad" as "ungültig" ("invalid")Thomas Rast, May 2, 2012
  14. 5/5 de.po: collection of suggestionsThomas Rast, May 2, 2012
  15. Ralf ThielowMay 2, 2012
  16. Thomas RastMay 2, 2012
  17. Christian StimmingMay 2, 2012
  18. Thomas RastMay 3, 2012
  19. branch: remove lego in i18n tracking info stringsNguyễn Thái Ngọc Duy, May 3, 2012
  20. Junio C HamanoMay 4, 2012
  21. Nguyen Thai Ngoc DuyMay 6, 2012
  22. Ralf ThielowMay 2, 2012
  23. Christian StimmingMay 2, 2012
  24. Junio C HamanoMay 2, 2012
  25. Jiang XinMay 3, 2012
  26. Junio C HamanoMay 3, 2012
  27. Jiang XinMay 3, 2012
  28. Thomas RastMay 3, 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.