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

[PATCH] i18n: apply: split to fix a partial i18n message

From
Jiang Xin <worldhello.net@gmail.com>
Date
May 31, 2012, 11:20 UTC
Message-ID
<1338463242-10618-1-git-send-email-worldhello.net@gmail.com>

The 4th arg of "new mode (%o) of %s does not match old mode (%o)%s%s" is blank string or string " of ". Even mark the string " of " for a complete i18n, this message is still hard to translate right.

Split it into two slight different messages would make l10n teams happy.
Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
---
 builtin/apply.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/builtin/apply.c b/builtin/apply.c
index dda9ea0..b4428ea 100644
--- a/builtin/apply.c
+++ b/builtin/apply.c
@@ -3262,10 +3262,18 @@ static int check_patch(struct patch *patch)
 		int same = !strcmp(old_name, new_name);
 		if (!patch->new_mode)
 			patch->new_mode = patch->old_mode;
-		if ((patch->old_mode ^ patch->new_mode) & S_IFMT)
-			return error(_("new mode (%o) of %s does not match old mode (%o)%s%s"),
-				patch->new_mode, new_name, patch->old_mode,
-				same ? "" : " of ", same ? "" : old_name);
+		if ((patch->old_mode ^ patch->new_mode) & S_IFMT) {
+			if (same)
+				return error(_("new mode (%o) of %s does not "
+					       "match old mode (%o)"),
+					patch->new_mode, new_name,
+					patch->old_mode);
+			else
+				return error(_("new mode (%o) of %s does not "
+					       "match old mode (%o) of %s"),
+					patch->new_mode, new_name,
+					patch->old_mode, old_name);
+		}
 	}
 
 	if (apply_data(patch, &st, ce) < 0)
-- 
1.7.10.2.559.g0ba0f00
Next: Nguyễn Thái Ngọc Duy
Message 1 of 17 in “i18n: apply: split to fix a partial i18n message”
  1. i18n: apply: split to fix a partial i18n messageJiang Xin, May 31, 2012
  2. Nguyễn Thái Ngọc DuyMay 31, 2012
  3. 1/6 Remove i18n legos in notifying new branch tracking setupNguyễn Thái Ngọc Duy, May 31, 2012
  4. Jonathan NiederMay 31, 2012
  5. 2/6 reflog: remove i18n legos in pruning messageNguyễn Thái Ngọc Duy, May 31, 2012
  6. Jonathan NiederMay 31, 2012
  7. Nguyen Thai Ngoc DuyMay 31, 2012
  8. Jonathan NiederMay 31, 2012
  9. Nguyen Thai Ngoc DuyMay 31, 2012
  10. Junio C HamanoMay 31, 2012
  11. Jonathan NiederMay 31, 2012
  12. 3/6 merge-recursive: remove i18n legos in conflict messagesNguyễn Thái Ngọc Duy, May 31, 2012
  13. Jonathan NiederMay 31, 2012
  14. Nguyen Thai Ngoc DuyMay 31, 2012
  15. 4/6 notes-merge: remove i18n legos in merge result messageNguyễn Thái Ngọc Duy, May 31, 2012
  16. 5/6 rerere: remove i18n legos in result messageNguyễn Thái Ngọc Duy, May 31, 2012
  17. 6/6 unpack-trees: remove i18n legos in unpack's porcelain error messagesNguyễn Thái Ngọc Duy, May 31, 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.